Update xmonad config
b87251c40610fe6599e9b9327f5d4999c764bbb6
1 parent
6ae4dee4
.xmobarrc
+13 -12
| 1 | 1 | -- Xmobar configuration |
|
| 2 | 2 | -- vim: ft=haskell |
|
| 3 | - | ||
| 3 | + | -- |
|
| 4 | 4 | Config { |
|
| 5 | - | font = "xft:monospace:size=12,fallback:size=12" |
|
| 6 | - | , textOffset = 18 |
|
| 5 | + | font = "xft:monospace:size=11,fallback:size=11" |
|
| 7 | 6 | , borderColor = "black" |
|
| 8 | 7 | , border = TopB |
|
| 9 | 8 | , bgColor = "#000000" |
|
| 10 | - | , fgColor = "#777777" |
|
| 11 | - | , position = Bottom |
|
| 9 | + | , fgColor = "#dddddd" |
|
| 10 | + | , position = BottomSize C 99 36 |
|
| 12 | 11 | , persistent = True |
|
| 13 | - | , verbose = True, |
|
| 12 | + | , verbose = True |
|
| 14 | 13 | , commands = |
|
| 15 | 14 | [ Run StdinReader |
|
| 16 | - | , Run MultiCpu [ "--template", "<total0> <total1> <total2> <total3>", "-w", "3" ] 50 |
|
| 17 | - | , Run Memory [ "--template", "<available>" ] 50 |
|
| 15 | + | , Run Cpu [ "-t", "<fc=#555>CPU</fc> <total>%" ] 50 |
|
| 16 | + | , Run Alsa "default" "Master" ["--template", "<fc=#555>VOL</fc> <volume>%"] |
|
| 17 | + | , Run Memory [ "-t", "<fc=#555>RAM</fc> <available>" ] 50 |
|
| 18 | + | , Run Brightness [ "-t", "☀ <percent>", "--", "-D", "intel_backlight" ] 60 |
|
| 18 | 19 | , Run Date "%b %d %H:%M" "date" 10 |
|
| 19 | - | , Run DiskU [("/", "<free>"), ("/home", "<free>")] [] 20 |
|
| 20 | + | , Run DiskU [("/", "<fc=#555>/</fc> <free>"), ("/home", "<fc=#555>/home</fc> <free>")] [] 20 |
|
| 20 | 21 | , Run CommandReader "xmobar-sync-status" "sync" |
|
| 21 | 22 | , Run Com "todo-widget" [] "todo" 10 |
|
| 22 | 23 | , Run Com "xmobar-brightness" [] "brightness" 10 |
|
| 23 | - | , Run Wireless "wlp2s0" [ "--template", "<essid>/<fc=#666><quality></fc>"] 10 |
|
| 24 | - | , Run Battery [ "--template", "<fc=#555>⌁</fc> <left>" ] 100 |
|
| 24 | + | , Run Wireless "wlan0" [ "--template", "<essid>/<fc=#666><quality></fc>"] 10 |
|
| 25 | + | , Run Battery [ "-t", "⌁ <left>%" ] 100 |
|
| 25 | 26 | ] |
|
| 26 | 27 | , sepChar = "%" |
|
| 27 | 28 | , alignSep = "}{" |
|
| 28 | - | , template = " %StdinReader% }{ %sync% %todo% <fc=#555>☀</fc> %brightness% %battery% %wlp2s0wi% %disku% %memory% %multicpu% <fc=#aaaaaa>%date%</fc> " |
|
| 29 | + | , template = " %StdinReader% }{ %sync% %todo% %alsa:default:Master% %disku% %memory% %cpu% %wlan0wi% %bright% %battery% <fc=#aaaaaa>%date%</fc> " |
|
| 29 | 30 | } |
.xmonad/README
added
+9 -0
| 1 | + | XMONAD |
|
| 2 | + | ||
| 3 | + | git clone <xmonad.git> xmonad-git |
|
| 4 | + | git clone <xmonad-contrib.git> xmonad-contrib-git |
|
| 5 | + | git clone <xmobar.git> xmobar-git |
|
| 6 | + | ||
| 7 | + | curl -sSL https://get.haskellstack.org | sh |
|
| 8 | + | ||
| 9 | + | pacman -S libxss pkg-config |
.xmonad/stack.yaml
+2 -1
| 1 | - | resolver: lts-13.0 |
|
| 1 | + | resolver: lts-17.7 |
|
| 2 | 2 | ||
| 3 | 3 | packages: |
|
| 4 | 4 | - xmobar-git |
|
| 5 | 5 | - xmonad-git |
|
| 6 | 6 | - xmonad-contrib-git |
| 9 | 9 | xmobar: |
|
| 10 | 10 | all_extensions: true |
|
| 11 | 11 | ||
| 12 | 12 | extra-deps: |
|
| 13 | 13 | - iwlib-0.1.0 |
|
| 14 | + | - netlink-1.1.1.0 |
.xmonad/xmonad.hs
+8 -11
| 39 | 39 | data EnterPrompt = EnterPrompt String |
|
| 40 | 40 | ||
| 41 | 41 | instance XPrompt EnterPrompt where |
|
| 42 | 42 | showXPrompt (EnterPrompt n) = " " ++ n ++ " " |
|
| 43 | 43 | ||
| 44 | - | confirmPrompt :: XPConfig -> String -> X () -> X () |
|
| 45 | - | confirmPrompt config app func = mkXPrompt (EnterPrompt app) config (mkComplFunFromList []) $ const func |
|
| 46 | - | ||
| 47 | 44 | screenshotPrompt :: String -> Bool -> X () |
|
| 48 | 45 | screenshotPrompt home select = do |
|
| 49 | 46 | str <- inputPrompt cfg "~/screenshots/" |
|
| 50 | 47 | case str of |
|
| 51 | 48 | Just s -> spawn $ printf "sleep 0.3 && scrot %s '%s' -e 'mv $f ~/screenshots'" mode s |
| 113 | 110 | safeSpawnProg termName |
|
| 114 | 111 | ||
| 115 | 112 | barConfig :: Handle -> PP |
|
| 116 | 113 | barConfig h = xmobarPP |
|
| 117 | 114 | { ppCurrent = xmobarColor white black . wrap " " " " |
|
| 118 | - | , ppHiddenNoWindows = xmobarColor dred black . wrap " " " " |
|
| 115 | + | , ppHiddenNoWindows = xmobarColor dgrey black . wrap " " " " |
|
| 119 | 116 | , ppHidden = xmobarColor grey black . wrap " " " " |
|
| 120 | 117 | , ppUrgent = xmobarColor black red . wrap " " " " |
|
| 121 | 118 | , ppTitle = xmobarColor red black |
|
| 122 | 119 | , ppLayout = const "" |
|
| 123 | - | , ppWsSep = "" |
|
| 120 | + | , ppWsSep = " " |
|
| 124 | 121 | , ppSep = " " |
|
| 125 | 122 | , ppOutput = hPutStrLn h |
|
| 126 | 123 | } |
|
| 127 | 124 | where |
|
| 128 | 125 | red = "maroon" |
|
| 129 | 126 | dred = "maroon" |
|
| 130 | 127 | white = "white" |
|
| 131 | 128 | black = "black" |
|
| 132 | 129 | light = "#888888" |
|
| 133 | 130 | dark = "#333333" |
|
| 134 | - | grey = "#555555" |
|
| 131 | + | grey = "#777777" |
|
| 132 | + | dgrey = "#333333" |
|
| 135 | 133 | ||
| 136 | 134 | toggleStrutsKey :: XConfig t -> (KeyMask, KeySym) |
|
| 137 | 135 | toggleStrutsKey XConfig { XMonad.modMask = modMask } = (modMask, xK_b) |
|
| 138 | 136 | ||
| 139 | 137 | myXPConfig :: XPConfig |
| 150 | 148 | myKeys :: FilePath -> XConfig Layout -> Map (KeyMask, KeySym) (X ()) |
|
| 151 | 149 | myKeys home conf@XConfig { XMonad.modMask = modMask } = |
|
| 152 | 150 | Map.union ks (XMonad.keys def conf) |
|
| 153 | 151 | where |
|
| 154 | 152 | ks = Map.fromList |
|
| 155 | - | [ ((modMask, xK_F12), safeSpawn "sleep" []) |
|
| 153 | + | [ ((modMask, xK_F12), safeSpawnProg "sleep") |
|
| 156 | 154 | , ((modMask .|. shiftMask, xK_F12), safeSpawn "systemctl" ["hibernate"]) |
|
| 157 | - | , ((modMask, xK_F11), safeSpawn "slock" []) |
|
| 158 | - | , ((modMask, xK_F10), safeSpawn "toggle-displays" []) |
|
| 159 | - | , ((modMask, xK_F5), safeSpawn "refresh-display" []) |
|
| 155 | + | , ((modMask, xK_F11), safeSpawnProg "slock") |
|
| 156 | + | , ((modMask, xK_F10), safeSpawnProg "toggle-displays") |
|
| 157 | + | , ((modMask, xK_F5), safeSpawnProg "refresh-display") |
|
| 160 | 158 | , ((modMask, xK_p), runExecutable) |
|
| 161 | 159 | , ((modMask .|. shiftMask, xK_p), editPrompt home) |
|
| 162 | 160 | , ((modMask, xK_o), switchWindow) |
|
| 163 | 161 | , ((modMask, xK_Tab), toggleWS) |
|
| 164 | 162 | , ((modMask .|. controlMask, xK_Return), toggleFloatNext >> (spawn $ XMonad.terminal conf)) |
| 166 | 164 | , ((modMask .|. shiftMask, xK_Print), screenshotPrompt home True) |
|
| 167 | 165 | , ((modMask, xK_0), windows $ greedyView "ω") |
|
| 168 | 166 | , ((modMask .|. shiftMask, xK_0), windows $ shift "ω") |
|
| 169 | 167 | , ((modMask, xK_Left), prevWS) |
|
| 170 | 168 | , ((modMask, xK_Right), nextWS) |
|
| 171 | - | , ((modMask .|. shiftMask, xK_q), confirmPrompt myXPConfig "Exit?" $ io (exitWith ExitSuccess)) |
|
| 172 | 169 | ] |
|
| 173 | 170 | ||
| 174 | 171 | rofi :: String -> [String] -> X () |
|
| 175 | 172 | rofi mode opts = safeSpawn |
|
| 176 | 173 | "rofi" (opts ++ [ "-show", mode |