about summary refs log tree commit diff
path: root/src/XMonad/Custom
diff options
context:
space:
mode:
authorazahi <azahi@teknik.io>2018-10-13 14:12:30 +0300
committerazahi <azahi@teknik.io>2018-10-13 14:12:30 +0300
commit8e20389ce238d979e6cb9253643bc181d698f5a9 (patch)
treed777052e5ac411cfa79de596ecc99d7d596705d8 /src/XMonad/Custom
parentRework Custom (diff)
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
Diffstat (limited to 'src/XMonad/Custom')
-rw-r--r--src/XMonad/Custom/Bindings.hs24
-rw-r--r--src/XMonad/Custom/Log.hs4
-rw-r--r--src/XMonad/Custom/Prompt.hs18
-rw-r--r--src/XMonad/Custom/Scratchpads.hs4
-rw-r--r--src/XMonad/Custom/Startup.hs4
5 files changed, 34 insertions, 20 deletions
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 ())
-    , ("<XF86ScreenSaver>" , spawn "~/.xmonad/bin/screenlock.sh")
+    , ("<XF86ScreenSaver>" , spawn "~/.xmonad/scripts/screenlock.sh")
     -- , ("M-S-c"             , xSelectionNotify)
-    , ("M-<Print>"         , spawn "~/.xmonad/bin/xshot-upload.sh")
-    , ("M-S-<Print>"       , spawn "~/.xmonad/bin/xshot-select-upload.sh")
-    , ("M-<Insert>"        , spawn "~/.xmonad/bin/xcast.sh --webm")
-    , ("M-S-<Insert>"      , spawn "~/.xmonad/bin/xcast.sh --gif")
+    , ("M-<Print>"         , spawn "~/.xmonad/scripts/xshot-upload.sh")
+    , ("M-S-<Print>"       , spawn "~/.xmonad/scripts/xshot-select-upload.sh")
+    , ("M-<Insert>"        , spawn "~/.xmonad/scripts/xcast.sh --webm")
+    , ("M-S-<Insert>"      , spawn "~/.xmonad/scripts/xcast.sh --gif")
     , ("M-C-<Insert>"      , 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 _ =
     [ ("<XF86AudioMute>"        , void   toggleMute)
     , ("<XF86AudioLowerVolume>" , void $ lowerVolume 5)
     , ("<XF86AudioRaiseVolume>" , void $ raiseVolume 5)
-    , ("<XF86AudioPlay>"        , spawn "~/.xmonad/bin/mpc-play-pause.sh")
+    , ("<XF86AudioPlay>"        , spawn "~/.xmonad/scripts/mpc-play-pause.sh")
     , ("<XF86AudioStop>"        , spawn "mpc --no-status stop")
     , ("<XF86AudioPrev>"        , spawn "mpc --no-status prev")
     , ("<XF86AudioNext>"        , 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-<Return>" , 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

Consider giving Nix/NixOS a try! <3