From 8e20389ce238d979e6cb9253643bc181d698f5a9 Mon Sep 17 00:00:00 2001 From: azahi Date: Sat, 13 Oct 2018 14:12:30 +0300 Subject: Huge update, yet again Move to ~/.xmonad Completely redo directory structure Remove Test.hs with xmonad-ng-test because it breaks cabal Add headers for new files Add proper "copyright" entries and mention upstream xmonad developers Other minor fixes --- src/XMonad/Actions/FloatSnapSpaced.hs | 2 +- src/XMonad/Custom/Bindings.hs | 24 +++++++++++------------- src/XMonad/Custom/Log.hs | 4 +--- src/XMonad/Custom/Prompt.hs | 18 ++++++++++++++++++ src/XMonad/Custom/Scratchpads.hs | 4 ++-- src/XMonad/Custom/Startup.hs | 4 ++-- src/XMonad/Util/ALSA.hs | 12 ++++++++++++ 7 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 src/XMonad/Custom/Prompt.hs (limited to 'src/XMonad') diff --git a/src/XMonad/Actions/FloatSnapSpaced.hs b/src/XMonad/Actions/FloatSnapSpaced.hs index 5b5d572..a579376 100644 --- a/src/XMonad/Actions/FloatSnapSpaced.hs +++ b/src/XMonad/Actions/FloatSnapSpaced.hs @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.FloatSnapSpaced --- Copyright : (c) azahi 2018 +-- Copyright : (c) 2009 Anders Engstrom -- License : BSD3-style (see LICENSE) -- -- Maintainer : azahi@teknik.io diff --git a/src/XMonad/Custom/Bindings.hs b/src/XMonad/Custom/Bindings.hs index 7504526..b31599a 100644 --- a/src/XMonad/Custom/Bindings.hs +++ b/src/XMonad/Custom/Bindings.hs @@ -50,7 +50,6 @@ import XMonad.Layout.Reflect import XMonad.Layout.ResizableTile import XMonad.Layout.SubLayouts import XMonad.Prompt.ConfirmPrompt -import XMonad.Prompt.Pass import XMonad.Prompt.Shell import XMonad.Prompt.Window import XMonad.Prompt.Workspace @@ -133,17 +132,17 @@ keysBase _ = keysSystem :: XConfig Layout -> [(String, X ())] keysSystem _ = [ ("M-C-g" , return ()) - , ("" , spawn "~/.xmonad/bin/screenlock.sh") + , ("" , spawn "~/.xmonad/scripts/screenlock.sh") -- , ("M-S-c" , xSelectionNotify) - , ("M-" , spawn "~/.xmonad/bin/xshot-upload.sh") - , ("M-S-" , spawn "~/.xmonad/bin/xshot-select-upload.sh") - , ("M-" , spawn "~/.xmonad/bin/xcast.sh --webm") - , ("M-S-" , spawn "~/.xmonad/bin/xcast.sh --gif") + , ("M-" , spawn "~/.xmonad/scripts/xshot-upload.sh") + , ("M-S-" , spawn "~/.xmonad/scripts/xshot-select-upload.sh") + , ("M-" , spawn "~/.xmonad/scripts/xcast.sh --webm") + , ("M-S-" , spawn "~/.xmonad/scripts/xcast.sh --gif") , ("M-C-" , spawn "pkill ffmpeg") - , ("M-C-c" , spawn "~/.xmonad/bin/toggle-compton.sh") - , ("M-C-r" , spawn "~/.xmonad/bin/toggle-redshift.sh") - , ("M-C-p" , spawn "~/.xmonad/bin/toggle-touchpad.sh") - , ("M-C-t" , spawn "~/.xmonad/bin/toggle-trackpoint.sh") + , ("M-C-c" , spawn "~/.xmonad/scripts/toggle-compton.sh") + , ("M-C-r" , spawn "~/.xmonad/scripts/toggle-redshift.sh") + , ("M-C-p" , spawn "~/.xmonad/scripts/toggle-touchpad.sh") + , ("M-C-t" , spawn "~/.xmonad/scripts/toggle-trackpoint.sh") ] keysMedia :: XConfig Layout -> [(String, X ())] @@ -151,7 +150,7 @@ keysMedia _ = [ ("" , void toggleMute) , ("" , void $ lowerVolume 5) , ("" , void $ raiseVolume 5) - , ("" , spawn "~/.xmonad/bin/mpc-play-pause.sh") + , ("" , spawn "~/.xmonad/scripts/mpc-play-pause.sh") , ("" , spawn "mpc --no-status stop") , ("" , spawn "mpc --no-status prev") , ("" , spawn "mpc --no-status next") @@ -159,7 +158,7 @@ keysMedia _ = keysWorkspaces :: XConfig Layout -> [(String, X ())] keysWorkspaces _ = - [ ("M-p" , switchProjectPrompt promptTheme) + [ ("M-S-o" , switchProjectPrompt promptTheme) , ("M-S-p" , shiftToProjectPrompt promptTheme) , ("M-," , nextNonEmptyWS) , ("M-." , prevNonEmptyWS) @@ -174,7 +173,6 @@ keysSpawnables :: XConfig Layout -> [(String, X ())] keysSpawnables _ = [ ("M-" , spawn (C.term C.applications)) , ("M-b" , spawn (C.browser C.applications)) - , ("M-C-p" , passPrompt promptTheme) , ("M-c" , namedScratchpadAction scratchpads "console") , ("M-m" , namedScratchpadAction scratchpads "music") , ("M-t" , namedScratchpadAction scratchpads "top") diff --git a/src/XMonad/Custom/Log.hs b/src/XMonad/Custom/Log.hs index 461634e..e441a02 100644 --- a/src/XMonad/Custom/Log.hs +++ b/src/XMonad/Custom/Log.hs @@ -44,9 +44,7 @@ topBarPP = def , ppWsSep = " " , ppTitle = xmobarColor white1 "" . shorten 50 , ppTitleSanitize = xmobarStrip - , ppLayout = xmobarColor white1 "" . \case "Spacing 12 Tabbed Hidden BSP" -> "Omni.Gaps" - "Tabbed Hidden BSP" -> "Omni" - _ -> "Misc" + , ppLayout = xmobarColor white1 "" , ppOrder = id , ppSort = (namedScratchpadFilterOutWorkspace .) <$> getSortByIndex , ppExtras = [] diff --git a/src/XMonad/Custom/Prompt.hs b/src/XMonad/Custom/Prompt.hs new file mode 100644 index 0000000..15aab2c --- /dev/null +++ b/src/XMonad/Custom/Prompt.hs @@ -0,0 +1,18 @@ +module XMonad.Custom.Prompt + ( listCompFunc + , aListCompFunc + , predicateFunction + ) where + +import Data.Char +import Data.List +import XMonad.Prompt + +listCompFunc :: XPConfig -> [String] -> String -> IO [String] +listCompFunc c xs s = return (filter (searchPredicate c s) xs) + +aListCompFunc :: XPConfig -> [(String, a)] -> String -> IO [String] +aListCompFunc c xs = listCompFunc c (map fst xs) + +predicateFunction :: String -> String -> Bool +predicateFunction x y = lc x `isInfixOf` lc y where lc = map toLower diff --git a/src/XMonad/Custom/Scratchpads.hs b/src/XMonad/Custom/Scratchpads.hs index 98ddaf5..d463b87 100644 --- a/src/XMonad/Custom/Scratchpads.hs +++ b/src/XMonad/Custom/Scratchpads.hs @@ -34,7 +34,7 @@ floatingNSP = customFloating $ S.RationalRect x y w h scratchpads :: [NamedScratchpad] scratchpads = [ NS "console" - (spawnTerminalWith "NSPConsole" "~/.xmonad/bin/nsp-console.sh") + (spawnTerminalWith "NSPConsole" "~/.xmonad/scripts/nsp-console.sh") (title =? "NSPConsole") floatingNSP , NS "volume" @@ -42,7 +42,7 @@ scratchpads = (title =? "NSPVolume") floatingNSP , NS "music" - (spawnTerminalWith "NSPMusic" "~/.bin/mp") + (spawnTerminalWith "NSPMusic" "mp") (title =? "NSPMusic") floatingNSP , NS "top" diff --git a/src/XMonad/Custom/Startup.hs b/src/XMonad/Custom/Startup.hs index 3738f6a..6050dff 100644 --- a/src/XMonad/Custom/Startup.hs +++ b/src/XMonad/Custom/Startup.hs @@ -51,8 +51,8 @@ addEWMHFullscreen = do startupHook :: X () startupHook = do - spawnNamedPipe "xmobar ~/.xmonad/xmobarrcTop.hs" "xmobarTop" - spawnNamedPipe "xmobar ~/.xmonad/xmobarrcBot.hs" "xmobarBot" + spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/top.hs" "xmobarTop" + spawnNamedPipe "xmobar ~/.xmonad/xmobarrc/bot.hs" "xmobarBot" docksStartupHook addEWMHFullscreen setDefaultCursor xC_left_ptr diff --git a/src/XMonad/Util/ALSA.hs b/src/XMonad/Util/ALSA.hs index 3e543df..0bccfd8 100644 --- a/src/XMonad/Util/ALSA.hs +++ b/src/XMonad/Util/ALSA.hs @@ -1,5 +1,17 @@ {-# LANGUAGE CPP #-} +---------------------------------------------------------------------------- +-- | +-- Module : XMonad.Util.ALSA +-- Copyright : (c) daniel@wagner-home.com +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : azahi@teknik.io +-- Stability : unstable +-- Portability : unportable +-- +---------------------------------------------------------------------------- + module XMonad.Util.ALSA ( toggleMute , raiseVolume -- cgit 1.4.1