about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Test.hs50
-rw-r--r--src/XMonad/Actions/FloatSnapSpaced.hs2
-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
-rw-r--r--src/XMonad/Util/ALSA.hs12
8 files changed, 47 insertions, 71 deletions
diff --git a/src/Test.hs b/src/Test.hs
deleted file mode 100644
index eea5d61..0000000
--- a/src/Test.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-module Main where
-
-import Control.Monad (void)
-import qualified Data.Map as M
-import qualified Data.Set as S
-import XMonad
-import XMonad.Prompt
-import XMonad.StackSet (new)
-import XMonad.Util.EZConfig (checkKeymap)
-import XMonad.Util.Font
-import XMonad.Custom.Bindings (rawKeys)
-import XMonad.Custom.Theme (promptTheme)
-
-main :: IO ()
-main = do
-    dpy   <- openDisplay ""
-    rootw <- rootWindow dpy $ defaultScreen dpy
-
-    let xmc = def {layoutHook = Layout $ layoutHook def}
-        initialWinset = new (layoutHook xmc) (workspaces xmc) []
-
-    let cf = XConf { display       = dpy
-                   , config        = xmc
-                   , theRoot       = rootw
-                   , normalBorder  = 0
-                   , focusedBorder = 0
-                   , keyActions    = M.empty
-                   , buttonActions = M.empty
-                   , mouseFocused  = False
-                   , mousePosition = Nothing
-                   , currentEvent  = Nothing
-                   }
-
-    let st = XState { windowset       = initialWinset
-                    , numberlockMask  = 0
-                    , mapped          = S.empty
-                    , waitingUnmap    = M.empty
-                    , dragging        = Nothing
-                    , extensibleState = M.empty
-                    }
-
-    void $ runX cf st $ do
-        checkKeymap xmc (rawKeys xmc)
-
-        xmf <- initXMF (font promptTheme)
-
-        case xmf of
-            Core _ -> io (putStrLn "Font: core")
-            Utf8 _ -> io (putStrLn "Font: utf8")
-            Xft  _ -> io (putStrLn "Font: xft")
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 <ankaan@gmail.com>
 -- 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 ())
-    , ("<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
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

Consider giving Nix/NixOS a try! <3