├── README.org ├── my-xmonad.cabal ├── screenshots ├── screenshot1.png └── screenshot2.png ├── stack.yaml ├── startup.sh ├── taffybar.hs ├── xmobarrc.hs └── xmonad.hs /README.org: -------------------------------------------------------------------------------- 1 | #+MACRO: kbd @@html:@@$1@@html:@@ 2 | 3 | * xmonad-config 4 | 5 | xmonad-config is my [[http://xmonad.org/][xmonad]] configuration was inspired by [[https://github.com/vicfryzel/xmonad-config][Vic Fryzel]], [[https://gist.github.com/gilbertw1/c33e79eb76fcb5a47411da881c621639][gilbertw1]] and [[https://github.com/altercation/dotfiles-tilingwm][Ethan Schoonover]] 6 | * Introduction 7 | 8 | If you are unfamiliar with xmonad, it is a tiling window manager that is notoriously minimal, stable, beautiful, and featureful. If you find yourself spending a lot of time organizing or managing windows, you may consider trying xmonad. 9 | 10 | However, xmonad can be somewhat difficult to configure if you're new to Haskell or even to xmonad itself. 11 | 12 | This project contains a completely working and very usable xmonad configuration "out of the box". If you are just starting out with xmonad, this will give you a configuration that I personally use every day. Thought it has been put into the colors, key bindings, layouts, and supplementary scripts to make life easier. 13 | 14 | This project is also recommended for advanced xmonad users, who may just not want to reinvent the wheel. All source provided with this project is well documented and simple to customize. 15 | 16 | [[file:screenshots/screenshot1.png]] 17 | [[file:screenshots/screenshot2.png]] 18 | * Requirements 19 | 20 | - xmonad 21 | - xmonad-contrib 22 | - [[http://projects.haskell.org/xmobar/][xmobar]] 23 | - [[http://stalonetray.sourceforge.net/][stalonetray]] 24 | - [[https://davedavenport.github.io/rofi/][rofi]] 25 | ** Installing requirements on [[http://www.archlinux.org/][Arch Linux]] 26 | #+BEGIN_SRC 27 | sudo pacman -S xmonad xmonad-contrib xmobar stalonetray \ 28 | xcompmgr rofi 29 | #+END_SRC 30 | ** Installing requirements on [[http://www.ubuntu.com/][Ubuntu Linux]] 31 | #+BEGIN_SRC 32 | sudo aptitude install xmonad libghc-xmonad-contrib-dev xmobar stalonetray \ 33 | rofi 34 | #+END_SRC 35 | * Installation 36 | 37 | Installing xmonad-config is a matter of backing up any xmonad configuration you may already have, cloning the git repository, and updating your PATH. 38 | #+BEGIN_SRC 39 | cd 40 | mv .xmonad .xmonad.orig 41 | git clone https://github.com/randomthought/xmonad-config.git .xmonad 42 | #+END_SRC 43 | Once xmonad-config is installed, you also need to ensure you can actually start xmonad. The mechanism to do this varies based on each environment, but here are some instructions for some common login managers. 44 | ** Starting xmonad from lightdm, xdm, kdm, or gdm 45 | #+BEGIN_SRC 46 | ln -s ~/.xmonad/bin/xsession ~/.xsession 47 | # Logout, login from lightdm/xdm/kdm/gdm 48 | #+END_SRC 49 | ** Starting xmonad from slim 50 | #+BEGIN_SRC 51 | ln -s ~/.xmonad/bin/xsession ~/.xinitrc 52 | # Logout, login from slim 53 | #+END_SRC 54 | * Keyboard shortcuts 55 | 56 | After starting xmonad, use the following keyboard shortcuts to function in your new window manager. I recommend you print these out so that you don't get stranded once you logout and back in. 57 | 58 | | *Key Binding* | *Action* | 59 | |--------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------| 60 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Return@@html:@@ | Start a terminal | 61 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@0@@html:@@ | Lock screen | 62 | | @@html:@@Win@@html:@@+@@html:@@p@@html:@@ | Start dmenu. Once it comes up, type the name of a program and enter | 63 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@p@@html:@@ | Take screenshot in select mode. Click or click and drag to select | 64 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Shift@@html:@@+@@html:@@p@@html:@@ | Take fullscreen screenshot. Supports multiple monitors | 65 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@c@@html:@@ | Close focused window | 66 | | @@html:@@Win@@html:@@+@@html:@@Space@@html:@@ | Change workspace layout | 67 | | @@html:@@Win@@html:@@+@@html:@@r@@html:@@ | Rotates a split between vertical and horizontal BinarySpacePartition layout | 68 | | @@html:@@Win@@html:@@+@@html:@@s@@html:@@ | Swaps to sibling nodes BinarySpacePartition layout | 69 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Space@@html:@@ | Change back to default workspace layout | 70 | | @@html:@@Win@@html:@@+@@html:@@n@@html:@@ | Resize viewed windows to the correct size | 71 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Left@@html:@@ | Tab current focused window with the window to the left | 72 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Right@@html:@@ | Tab current focused window with the window to the right | 73 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Up@@html:@@ | Tab current focused window with the window above | 74 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Down@@html:@@ | Tab current focused window with the window below | 75 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@u@@html:@@ | Ungroup the current tabbed windows | 76 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@m@@html:@@ | Merge all windows in the current workspace to one tabbed window | 77 | | @@html:@@Win@@html:@@+@@html:@@Tab@@html:@@ | Focus next tabbed window | 78 | | @@html:@@Win@@html:@@+@@html:@@Left@@html:@@ | Focus on window to the Left | 79 | | @@html:@@Win@@html:@@+@@html:@@Right@@html:@@ | Focus on window to the Right | 80 | | @@html:@@Win@@html:@@+@@html:@@Up@@html:@@ | Focus on window above | 81 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Left@@html:@@ | Swap adjacent window to the left | 82 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Right@@html:@@ | Swap adjacent window to the right | 83 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Up@@html:@@ | Swap adjacent window above | 84 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@Down@@html:@@ | Swap adjacent window below | 85 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Left@@html:@@ | Expand / Shrink window to the left | 86 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Left@@html:@@ | Expand / Shrink window to the right | 87 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Up@@html:@@ | Expand / Shrink window to the up | 88 | | @@html:@@Win@@html:@@+@@html:@@Ctrl@@html:@@+@@html:@@Down@@html:@@ | Expand / Shrink window to the down | 89 | | @@html:@@Win@@html:@@+@@html:@@h@@html:@@ | Shrink master window area | 90 | | @@html:@@Win@@html:@@+@@html:@@l@@html:@@ | Expand master window area | 91 | | @@html:@@Win@@html:@@+@@html:@@m@@html:@@ | Focus master window | 92 | | @@html:@@Win@@html:@@+@@html:@@Return@@html:@@ | Swap focused window with master window | 93 | | @@html:@@Win@@html:@@+@@html:@@t@@html:@@ | Push floating window back into tiling | 94 | | @@html:@@Win@@html:@@+@@html:@@,@@html:@@ | Increment number of windows in master window area | 95 | | @@html:@@Win@@html:@@+@@html:@@.@@html:@@ | Decrement number of windows in master window area | 96 | | @@html:@@Win@@html:@@+@@html:@@q@@html:@@ | Restart xmonad. This reloads xmonad configuration, does not logout | 97 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@q@@html:@@ | Quit xmonad and logout | 98 | | @@html:@@Win@@html:@@+@@html:@@[1-9]@@html:@@ | Switch to workspace 1-9, depending on which number was pressed | 99 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@[1-9]@@html:@@ | Send focused window to workspace 1-9 | 100 | | @@html:@@Win@@html:@@+@@html:@@w@@html:@@ | Focus left-most monitor Xinerama screen 1 | 101 | | @@html:@@Win@@html:@@+@@html:@@e@@html:@@ | Focus center-most monitor Xinerama screen 2 | 102 | | @@html:@@Win@@html:@@+@@html:@@r@@html:@@ | Focus right-most monitor Xinerama screen 3 | 103 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@w@@html:@@ | Send focused window to workspace on left-most monitor | 104 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@e@@html:@@ | Send focused window to workspace on center-most monitor | 105 | | @@html:@@Win@@html:@@+@@html:@@Shift@@html:@@+@@html:@@r@@html:@@ | Send focused window to workspace on right-most monitor | 106 | | @@html:@@Win@@html:@@+@@html:@@Left Mouse Drag@@html:@@ | Drag focused window out of tiling | 107 | | @@html:@@Win@@html:@@+@@html:@@Right Mouse Drag@@html:@@ | Resize focused window, bring out of tiling if needed | 108 | | @@html:@@Win@@html:@@+@@html:@@Right Mouse Drag@@html:@@ | Resize focused window, bring out of tiling if needed | 109 | 110 | * Personalizing or modifying xmonad-config 111 | 112 | Once cloned, xmonad-config is laid out as follows. 113 | 114 | All xmonad configuration is in ~/.xmonad/xmonad.hs. This includes things like key bindings, colors, layouts, etc. You may need to have some basic understanding of [[https://wiki.haskell.org/Haskell][Haskell]] in order to modify this file, but most people have no problems. 115 | 116 | Most of the xmobar configuration is in ~/.xmonad/xmobar.hs. 117 | 118 | All scripts are in ~/.xmonad/bin/. Scripts are provided to do things like take screenshots, start the system tray, start dmenu, or fix your multi-head layout after a fullscreen application may have turned off one of the screens. 119 | 120 | Colors set in the xmobar config and dmenu script are meant to coincide with the [[http://toddwerth.com/2008/04/30/the-last-vim-color-scheme-youll-ever-need/][IR_Black terminal and vim themes]]. 121 | -------------------------------------------------------------------------------- /my-xmonad.cabal: -------------------------------------------------------------------------------- 1 | name: my-xmonad 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable my-xmonad 7 | main-is: xmonad.hs 8 | -- other-modules lists custom modules in my ~/.xmonad/lib/ directory 9 | other-modules: 10 | build-depends: base 11 | , xmonad >= 0.13 12 | , xmonad-contrib >= 0.13 13 | , xmonad-extras >= 0.13 14 | , X11 >= 1.8 15 | , X11-xft >= 0.3 16 | , containers 17 | -- hs-source-dirs: lib 18 | default-language: Haskell2010 19 | ghc-options: -Wall -Werror -fno-warn-missing-signatures -threaded 20 | -------------------------------------------------------------------------------- /screenshots/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/randomthought/xmonad-config/ea896fb6f8a8ce9975e9c86ceb924a38d63a6403/screenshots/screenshot1.png -------------------------------------------------------------------------------- /screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/randomthought/xmonad-config/ea896fb6f8a8ce9975e9c86ceb924a38d63a6403/screenshots/screenshot2.png -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by 'stack init' 2 | # 3 | # Some commonly used options have been documented as comments in this file. 4 | # For advanced use and comprehensive documentation of the format, please see: 5 | # https://docs.haskellstack.org/en/stable/yaml_configuration/ 6 | 7 | # Resolver to choose a 'specific' stackage snapshot or a compiler version. 8 | # A snapshot resolver dictates the compiler version and the set of packages 9 | # to be used for project dependencies. For example: 10 | # 11 | # resolver: lts-3.5 12 | # resolver: nightly-2015-09-21 13 | # resolver: ghc-7.10.2 14 | # resolver: ghcjs-0.1.0_ghc-7.10.2 15 | # 16 | # The location of a snapshot can be provided as a file or url. Stack assumes 17 | # a snapshot provided as a file might change, whereas a url resource does not. 18 | # 19 | # resolver: ./custom-snapshot.yaml 20 | # resolver: https://example.com/snapshots/2018-01-01.yaml 21 | resolver: lts-11.22 22 | 23 | # User packages to be built. 24 | # Various formats can be used as shown in the example below. 25 | # 26 | # packages: 27 | # - some-directory 28 | # - https://example.com/foo/bar/baz-0.0.2.tar.gz 29 | # - location: 30 | # git: https://github.com/commercialhaskell/stack.git 31 | # commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a 32 | # - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a 33 | # subdirs: 34 | # - auto-update 35 | # - wai 36 | packages: 37 | - . 38 | # Dependency packages to be pulled from upstream that are not in the resolver 39 | # using the same syntax as the packages field. 40 | # (e.g., acme-missiles-0.3) 41 | # extra-deps: [] 42 | 43 | # Override default flag values for local packages and extra-deps 44 | # flags: {} 45 | 46 | # Extra package databases containing global packages 47 | # extra-package-dbs: [] 48 | 49 | # Control whether we use the GHC we find on the path 50 | # system-ghc: true 51 | # 52 | # Require a specific version of stack, using version ranges 53 | # require-stack-version: -any # Default 54 | # require-stack-version: ">=1.7" 55 | # 56 | # Override the architecture used by stack, especially useful on Windows 57 | # arch: i386 58 | # arch: x86_64 59 | # 60 | # Extra directories used by stack for building 61 | # extra-include-dirs: [/path/to/dir] 62 | # extra-lib-dirs: [/path/to/dir] 63 | # 64 | # Allow a newer minor version of GHC than the snapshot specifies 65 | # compiler-check: newer-minor -------------------------------------------------------------------------------- /startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # System tray 4 | if [ -z "$(pgrep trayer)" ] ; then 5 | trayer --edge top \ 6 | --align right \ 7 | --widthtype percent \ 8 | --height 24 \ 9 | --alpha 0 \ 10 | --transparent true \ 11 | --width 5 \ 12 | --tint 0x282c34 & 13 | fi 14 | 15 | # Power manager 16 | if [ -z "$(pgrep xfce4-power-manager)" ] ; then 17 | xfce4-power-manager & 18 | fi 19 | 20 | # Taffybar 21 | # if [ -z "$(pgrep taffybar)" ] ; then 22 | # taffybar & 23 | # fi 24 | 25 | # Redshift 26 | if [ -z "$(pgrep redshift)" ] ; then 27 | redshift & 28 | fi 29 | 30 | # Autolock 31 | # if [ -z "$(pgrep xautolock)" ] ; then 32 | # xautolock -time 1 -locker "if ! grep 'RUNNING' /proc/asound/card*/pcm*/sub*/status;then xscreensaver-command -lock; else echo 'Sound on'; fi" 33 | # fi 34 | 35 | # Wallpaper 36 | if [ -z "$(pgrep nitrogen)" ] ; then 37 | nitrogen --restore & 38 | fi 39 | 40 | # Screensaver 41 | if [ -z "$(pgrep xscreensaver)" ] ; then 42 | xscreensaver -no-splash & 43 | fi 44 | 45 | # compton 46 | if [ -z "$(pgrep compton)" ] ; then 47 | compton -b & 48 | fi 49 | 50 | # Network Applet 51 | if [ -z "$(pgrep nm-applet)" ] ; then 52 | nm-applet & 53 | fi 54 | 55 | # Google Drive 56 | if [ -z "$(pgrep insync)" ] ; then 57 | insync start & 58 | fi 59 | # xbindkeys 60 | xbindkeys 61 | -------------------------------------------------------------------------------- /taffybar.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | {-# LANGUAGE PackageImports #-} 3 | 4 | import System.Information.Battery 5 | import System.Information.CPU 6 | import System.Taffybar 7 | import System.Taffybar.Battery 8 | import System.Taffybar.FreedesktopNotifications 9 | import System.Taffybar.MPRIS2 10 | import System.Taffybar.Pager 11 | import System.Taffybar.SimpleClock 12 | import System.Taffybar.Systray 13 | import System.Taffybar.TaffyPager 14 | import System.Taffybar.Widgets.PollingGraph 15 | import System.Taffybar.Widgets.PollingLabel 16 | 17 | import Control.Exception (throwIO) 18 | import Data.Aeson 19 | import Data.Char 20 | import Data.List 21 | import Data.Maybe 22 | import Data.Monoid 23 | import Safe 24 | import System.Process 25 | import qualified "gtk" Graphics.UI.Gtk as Gtk 26 | import qualified Data.Text as T 27 | import qualified System.IO as IO 28 | 29 | data Resolution = HD | UHD 30 | data Device = Desktop | Laptop 31 | 32 | main :: IO () 33 | main = do 34 | let dev = Desktop 35 | res = HD 36 | clock = textClockNew Nothing ("" ++ fontAwesome "\xf017 " ++ "%a %b %_d %I:%M") 1 37 | -- pager = taffyPagerNew defaultPagerConfig 38 | pager = taffyPagerNew myPagerConfig 39 | tray = systrayNew 40 | music = customW 1 musicString 41 | battery = customW 30 batString 42 | vol = customW 1 volString 43 | notify = notifyAreaNew myNotificationConfig 44 | sep = textW . colorize (colors "darkgrey") "" $ " / " 45 | buffer = textW " " 46 | 47 | batDev Desktop = [] 48 | batDev Laptop = [battery, sep] 49 | 50 | monitorDev Desktop x = x 51 | monitorDev Laptop x = x { monitorNumber = 1 } 52 | 53 | startW = [pager] 54 | endW = [tray, buffer, clock, sep] 55 | ++ batDev dev 56 | ++ [vol, sep, music, buffer, notify] 57 | 58 | defaultTaffybar 59 | . monitorDev dev 60 | $ defaultTaffybarConfig { startWidgets = startW 61 | , endWidgets = endW 62 | , barHeight = barSize res 63 | , barPosition = Top 64 | , widgetSpacing = 0 65 | } 66 | 67 | myPagerConfig = 68 | defaultPagerConfig { activeWindow = colorize (colors "yellow") "" 69 | . escape 70 | , activeLayout = escape 71 | , activeWorkspace = colorize (colors "blue") "" 72 | . escape . wrap "[" "]" 73 | , hiddenWorkspace = colorize (colors "white") "" 74 | . escape 75 | , visibleWorkspace = colorize (colors "darkgreen") "" 76 | . escape 77 | , urgentWorkspace = colorize (colors "darkmagenta") "" 78 | . escape 79 | , widgetSep = " : " 80 | } 81 | myNotificationConfig :: NotificationConfig 82 | myNotificationConfig = defaultNotificationConfig { notificationFormatter = myFormatter 83 | , notificationMaxLength = 40 84 | } 85 | 86 | myFormatter :: Notification -> String 87 | myFormatter note = msg 88 | where 89 | msg = case T.null (noteBody note) of 90 | True -> T.unpack $ noteSummary note 91 | False -> T.unpack 92 | $ mconcat [ mconcat [""] 93 | , noteSummary note 94 | , " | " 95 | , noteBody note 96 | , "" 97 | ] 98 | 99 | -- | Returns text as a widget 100 | textW :: String -> IO Gtk.Widget 101 | textW x = do 102 | label <- Gtk.labelNew (Nothing :: Maybe String) 103 | Gtk.labelSetMarkup label x 104 | 105 | let l = Gtk.toWidget label 106 | 107 | Gtk.widgetShowAll l 108 | return l 109 | 110 | -- | A simple textual battery widget that auto-updates once every 111 | -- polling period (specified in seconds). 112 | customW :: Double -- ^ Poll period in seconds 113 | -> IO String 114 | -> IO Gtk.Widget 115 | customW interval f = do 116 | l <- pollingLabelNew "" interval f 117 | Gtk.widgetShowAll l 118 | return l 119 | 120 | -- | Returns the MPRIS string. 121 | musicString :: IO String 122 | musicString = do 123 | (_, artist, _) <- readProcessWithExitCode "playerctl" ["metadata", "artist"] [] 124 | (_, album, _) <- readProcessWithExitCode "playerctl" ["metadata", "album"] [] 125 | (_, title, _) <- readProcessWithExitCode "playerctl" ["metadata", "title"] [] 126 | 127 | let format = escape . take 90 $ title ++ " - " ++ album ++ " - " ++ artist 128 | music = colorize 129 | (colors "darkblue") 130 | "" 131 | (fontAwesome "\xf001 " ++ format) 132 | 133 | return music 134 | 135 | -- | Returns the battery text 136 | batString :: IO String 137 | batString = do 138 | batList <- fmap (headMay . filter (isInfixOf "battery") . lines) 139 | . readProcess "upower" ["-e"] 140 | $ [] 141 | batInfo <- readProcess "upower" ["-i", fromMaybe "" batList] [] 142 | 143 | let batPercent = filter (/= ' ') 144 | . dropWhile (not . isNumber) 145 | . fromMaybe "" 146 | . headMay 147 | . filter (isInfixOf "percentage:") 148 | . lines 149 | $ batInfo 150 | batState = fmap toUpper 151 | . filter (/= ' ') 152 | . dropWhile (/= ' ') 153 | . dropWhile (== ' ') 154 | . fromMaybe "" 155 | . headMay 156 | . filter (isInfixOf "state:") 157 | . lines 158 | $ batInfo 159 | charge :: String -> String 160 | charge x 161 | | isInfixOf "DISCHARGING" x = "-" 162 | | isInfixOf "CHARGING" x = "+" 163 | | isInfixOf "UNKNOWN" x = "+" 164 | | otherwise = "" 165 | battery = colorize (colors "darkred") "" 166 | . (flip (++) (charge batState)) 167 | . batteryIcon 168 | $ batPercent 169 | 170 | return battery 171 | 172 | -- | Returns the volume string. 173 | volString :: IO String 174 | volString = do 175 | output1 <- readProcess "amixer" ["sget", "Master"] [] 176 | output2 <- readProcess "egrep" ["-o", "[0-9]+%\\] \\[[a-z]+\\]"] output1 177 | output3 <- readProcess "head" ["-n", "1"] output2 178 | 179 | let volume = colorize (colors "darkmagenta") "" . volumeIcon $ output3 180 | 181 | return volume 182 | 183 | -- | Get the correct icon for the battery 184 | volumeIcon :: String -> String 185 | volumeIcon x 186 | | mute == "[off]" = fontAwesome "\xf026 " ++ "MUTE" 187 | | read volNum > 50 = fontAwesome "\xf028 " ++ volNum ++ "%" 188 | | read volNum > 0 = fontAwesome "\xf027 " ++ volNum ++ "%" 189 | | otherwise = fontAwesome "\xf026 " ++ volNum ++ "%" 190 | where 191 | mute = dropWhile (/= '[') . reverse . dropWhile (/= ']') . reverse $ x 192 | volNum = takeWhile (/= '%') x 193 | 194 | -- | Get the correct icon for the battery 195 | batteryIcon :: String -> String 196 | batteryIcon x 197 | | bat > 90 = fontAwesome "\xf240 " ++ show bat ++ "%" 198 | | bat > 60 = fontAwesome "\xf241 " ++ show bat ++ "%" 199 | | bat > 40 = fontAwesome "\xf242 " ++ show bat ++ "%" 200 | | bat > 10 = fontAwesome "\xf243 " ++ show bat ++ "%" 201 | | otherwise = fontAwesome "\xf244 " ++ show bat ++ "%" 202 | where 203 | bat = read . reverse . takeWhile (/= ' ') . drop 1 . dropWhile (/= '%') . reverse $ x 204 | 205 | -- | Change the font to font awesome here 206 | fontAwesome :: String -> String 207 | fontAwesome x = "" ++ x ++ "" 208 | 209 | -- | Size of the bar 210 | barSize :: Resolution -> Int 211 | barSize HD = 25 212 | barSize UHD = 55 213 | 214 | colors :: String -> String 215 | colors "background" = "#282828" 216 | colors "foreground" = "#ebdbb2" 217 | colors "black" = "#282828" 218 | colors "darkgrey" = "#928374" 219 | colors "darkred" = "#cc241d" 220 | colors "red" = "#fb4934" 221 | colors "darkgreen" = "#98971a" 222 | colors "green" = "#b8bb26" 223 | colors "darkyellow" = "#d79921" 224 | colors "yellow" = "#fabd2f" 225 | colors "darkblue" = "#458588" 226 | -- colors "blue" = "#83a598" 227 | colors "blue" = "#51AFEF" 228 | 229 | colors "brightblue" = "#2e9ef4" 230 | colors "darkmagenta" = "#b16286" 231 | colors "magenta" = "#d3869b" 232 | colors "darkcyan" = "#689d6a" 233 | colors "cyan" = "#8ec07c" 234 | colors "lightgrey" = "#a89984" 235 | colors "white" = "#ebdbb2" 236 | -------------------------------------------------------------------------------- /xmobarrc.hs: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "xft:Zekton:size=13:bold:antialias=true" 3 | , additionalFonts = [ "xft:FontAwesome:size=11" ] 4 | , allDesktops = True 5 | , bgColor = "#282c34" 6 | , fgColor = "#bbc2cf" 7 | , position = TopW L 95 8 | , commands = [ Run Cpu [ "--template", "%" 9 | , "--Low","3" 10 | , "--High","50" 11 | , "--low","#bbc2cf" 12 | , "--normal","#bbc2cf" 13 | , "--high","#fb4934"] 50 14 | 15 | , Run Memory ["-t","%" 16 | ,"-H","80" 17 | ,"-L","10" 18 | ,"-l","#bbc2cf" 19 | ,"-n","#bbc2cf" 20 | ,"-h","#fb4934"] 50 21 | 22 | , Run Date " %a %b %_d %I:%M" "date" 300 23 | , Run DynNetwork ["-t",", " 24 | ,"-H","200" 25 | ,"-L","10" 26 | ,"-h","#bbc2cf" 27 | ,"-l","#bbc2cf" 28 | ,"-n","#bbc2cf"] 50 29 | 30 | , Run CoreTemp ["-t", "°" 31 | , "-L", "30" 32 | , "-H", "75" 33 | , "-l", "lightblue" 34 | , "-n", "#bbc2cf" 35 | , "-h", "#aa4450"] 50 36 | 37 | -- battery monitor 38 | , Run BatteryP [ "BAT0" ] 39 | [ "--template" , "" 40 | , "--Low" , "10" -- units: % 41 | , "--High" , "80" -- units: % 42 | , "--low" , "#fb4934" -- #ff5555 43 | , "--normal" , "#bbc2cf" 44 | , "--high" , "#98be65" 45 | 46 | , "--" -- battery specific options 47 | -- discharging status 48 | , "-o" , "% ()" 49 | -- AC "on" status 50 | , "-O" , "% (Charging)" -- 50fa7b 51 | -- charged status 52 | , "-i" , "Charged" 53 | ] 50 54 | , Run StdinReader 55 | ] 56 | , sepChar = "%" 57 | , alignSep = "}{" 58 | , template = "%StdinReader% }{ %cpu% | %coretemp% | %memory% | %battery% | %dynnetwork% | %date% |" -- #69DFFA 59 | } 60 | -------------------------------------------------------------------------------- /xmonad.hs: -------------------------------------------------------------------------------- 1 | -- xmonad config used by Malcolm MD 2 | -- https://github.com/randomthought/xmonad-config 3 | 4 | import System.IO 5 | import System.Exit 6 | -- import System.Taffybar.Hooks.PagerHints (pagerHints) 7 | 8 | import qualified Data.List as L 9 | 10 | import XMonad 11 | import XMonad.Actions.Navigation2D 12 | import XMonad.Actions.UpdatePointer 13 | 14 | import XMonad.Hooks.DynamicLog 15 | import XMonad.Hooks.ManageDocks 16 | import XMonad.Hooks.ManageHelpers 17 | import XMonad.Hooks.SetWMName 18 | import XMonad.Hooks.EwmhDesktops (ewmh) 19 | 20 | import XMonad.Layout.Gaps 21 | import XMonad.Layout.Fullscreen 22 | import XMonad.Layout.BinarySpacePartition as BSP 23 | import XMonad.Layout.NoBorders 24 | import XMonad.Layout.Tabbed 25 | import XMonad.Layout.ThreeColumns 26 | import XMonad.Layout.Spacing 27 | import XMonad.Layout.MultiToggle 28 | import XMonad.Layout.MultiToggle.Instances 29 | import XMonad.Layout.NoFrillsDecoration 30 | import XMonad.Layout.Renamed 31 | import XMonad.Layout.Simplest 32 | import XMonad.Layout.SubLayouts 33 | import XMonad.Layout.WindowNavigation 34 | import XMonad.Layout.ZoomRow 35 | 36 | import XMonad.Util.Run(spawnPipe) 37 | import XMonad.Util.EZConfig(additionalKeys) 38 | import XMonad.Util.Cursor 39 | 40 | import Graphics.X11.ExtraTypes.XF86 41 | import qualified XMonad.StackSet as W 42 | import qualified Data.Map as M 43 | 44 | 45 | ----------------------------mupdf-------------------------------------------- 46 | -- Terminimport XMonad.Hooks.EwmhDesktopsal 47 | -- The preferred terminal program, which is used in a binding below and by 48 | -- certain contrib modules. 49 | -- 50 | myTerminal = "termite" 51 | 52 | -- The command to lock the screen or show the screensaver. 53 | myScreensaver = "dm-tool switch-to-greeter" 54 | 55 | -- The command to take a selective screenshot, where you select 56 | -- what you'd like to capture on the screen. 57 | mySelectScreenshot = "select-screenshot" 58 | 59 | -- The command to take a fullscreen screenshot. 60 | myScreenshot = "xfce4-screenshooter" 61 | 62 | -- The command to use as a launcher, to launch commands that don't have 63 | -- preset keybindings. 64 | myLauncher = "rofi -show" 65 | 66 | 67 | 68 | ------------------------------------------------------------------------ 69 | -- Workspaces 70 | -- The default number of workspaces (virtual screens) and their names. 71 | -- 72 | myWorkspaces = ["1: term","2: web","3: code","4: media"] ++ map show [5..9] 73 | 74 | 75 | ------------------------------------------------------------------------ 76 | -- Window rules 77 | -- Execute arbitrary actions and WindowSet manipulations when managing 78 | -- a new window. You can use this to, for example, always float a 79 | -- particular program, or have a client always appear on a particular 80 | -- workspace. 81 | -- 82 | -- To find the property name associated with a program, use 83 | -- > xprop | grep WM_CLASS 84 | -- and click on the client you're interested in. 85 | -- 86 | -- To match on the WM_NAME, you can use 'title' in the same way that 87 | -- 'className' and 'resource' are used below. 88 | -- 89 | myManageHook = composeAll 90 | [ 91 | className =? "Google-chrome" --> doShift "2:web" 92 | , resource =? "desktop_window" --> doIgnore 93 | , className =? "Galculator" --> doCenterFloat 94 | , className =? "Steam" --> doCenterFloat 95 | , className =? "Gimp" --> doCenterFloat 96 | , resource =? "gpicview" --> doCenterFloat 97 | , className =? "MPlayer" --> doCenterFloat 98 | , className =? "Pavucontrol" --> doCenterFloat 99 | , className =? "Mate-power-preferences" --> doCenterFloat 100 | , className =? "Xfce4-power-manager-settings" --> doCenterFloat 101 | , className =? "VirtualBox" --> doShift "4:vm" 102 | , className =? "Xchat" --> doShift "5:media" 103 | , className =? "stalonetray" --> doIgnore 104 | , isFullscreen --> (doF W.focusDown <+> doFullFloat) 105 | -- , isFullscreen --> doFullFloat 106 | ] 107 | 108 | 109 | 110 | ------------------------------------------------------------------------ 111 | -- Layouts 112 | -- You can specify and transform your layouts by modifying these values. 113 | -- If you change layout bindings be sure to use 'mod-shift-space' after 114 | -- restarting (with 'mod-q') to reset your layout state to the new 115 | -- defaults, as xmonad preserves your old layout settings by default. 116 | -- 117 | -- The available layouts. Note that each layout is separated by |||, 118 | -- which denotes layout choice. 119 | 120 | outerGaps = 10 121 | myGaps = gaps [(U, outerGaps), (R, outerGaps), (L, outerGaps), (D, outerGaps)] 122 | addSpace = renamed [CutWordsLeft 2] . spacing gap 123 | tab = avoidStruts 124 | $ renamed [Replace "Tabbed"] 125 | $ addTopBar 126 | $ myGaps 127 | $ tabbed shrinkText myTabTheme 128 | 129 | layouts = avoidStruts ( 130 | ( 131 | renamed [CutWordsLeft 1] 132 | $ addTopBar 133 | $ windowNavigation 134 | $ renamed [Replace "BSP"] 135 | $ addTabs shrinkText myTabTheme 136 | $ subLayout [] Simplest 137 | $ myGaps 138 | $ addSpace (BSP.emptyBSP) 139 | ) 140 | ||| tab 141 | ) 142 | 143 | myLayout = smartBorders 144 | $ mkToggle (NOBORDERS ?? FULL ?? EOT) 145 | $ layouts 146 | 147 | myNav2DConf = def 148 | { defaultTiledNavigation = centerNavigation 149 | , floatNavigation = centerNavigation 150 | , screenNavigation = lineNavigation 151 | , layoutNavigation = [("Full", centerNavigation) 152 | -- line/center same results ,("Tabs", lineNavigation) 153 | -- ,("Tabs", centerNavigation) 154 | ] 155 | , unmappedWindowRect = [("Full", singleWindowRect) 156 | -- works but breaks tab deco ,("Tabs", singleWindowRect) 157 | -- doesn't work but deco ok ,("Tabs", fullScreenRect) 158 | ] 159 | } 160 | 161 | 162 | ------------------------------------------------------------------------ 163 | -- Colors and borders 164 | 165 | -- Color of current window title in xmobar. 166 | xmobarTitleColor = "#C678DD" 167 | 168 | -- Color of current workspace in xmobar. 169 | xmobarCurrentWorkspaceColor = "#51AFEF" 170 | 171 | -- Width of the window border in pixels. 172 | myBorderWidth = 0 173 | 174 | myNormalBorderColor = "#000000" 175 | myFocusedBorderColor = active 176 | 177 | base03 = "#002b36" 178 | base02 = "#073642" 179 | base01 = "#586e75" 180 | base00 = "#657b83" 181 | base0 = "#839496" 182 | base1 = "#93a1a1" 183 | base2 = "#eee8d5" 184 | base3 = "#fdf6e3" 185 | yellow = "#b58900" 186 | orange = "#cb4b16" 187 | red = "#dc322f" 188 | magenta = "#d33682" 189 | violet = "#6c71c4" 190 | blue = "#268bd2" 191 | cyan = "#2aa198" 192 | green = "#859900" 193 | 194 | -- sizes 195 | gap = 10 196 | topbar = 10 197 | border = 0 198 | prompt = 20 199 | status = 20 200 | 201 | active = blue 202 | activeWarn = red 203 | inactive = base02 204 | focusColor = blue 205 | unfocusColor = base02 206 | 207 | -- myFont = "-*-Zekton-medium-*-*-*-*-160-*-*-*-*-*-*" 208 | -- myBigFont = "-*-Zekton-medium-*-*-*-*-240-*-*-*-*-*-*" 209 | myFont = "xft:Zekton:size=9:bold:antialias=true" 210 | myBigFont = "xft:Zekton:size=9:bold:antialias=true" 211 | myWideFont = "xft:Eurostar Black Extended:" 212 | ++ "style=Regular:pixelsize=180:hinting=true" 213 | 214 | -- this is a "fake title" used as a highlight bar in lieu of full borders 215 | -- (I find this a cleaner and less visually intrusive solution) 216 | topBarTheme = def 217 | { 218 | fontName = myFont 219 | , inactiveBorderColor = base03 220 | , inactiveColor = base03 221 | , inactiveTextColor = base03 222 | , activeBorderColor = active 223 | , activeColor = active 224 | , activeTextColor = active 225 | , urgentBorderColor = red 226 | , urgentTextColor = yellow 227 | , decoHeight = topbar 228 | } 229 | 230 | addTopBar = noFrillsDeco shrinkText topBarTheme 231 | 232 | myTabTheme = def 233 | { fontName = myFont 234 | , activeColor = active 235 | , inactiveColor = base02 236 | , activeBorderColor = active 237 | , inactiveBorderColor = base02 238 | , activeTextColor = base03 239 | , inactiveTextColor = base00 240 | } 241 | 242 | ------------------------------------------------------------------------ 243 | -- Key bindings 244 | -- 245 | -- modMask lets you specify which modkey you want to use. The default 246 | -- is mod1Mask ("left alt"). You may also consider using mod3Mask 247 | -- ("right alt"), which does not conflict with emacs keybindings. The 248 | -- "windows key" is usually mod4Mask. 249 | -- 250 | myModMask = mod4Mask 251 | altMask = mod1Mask 252 | 253 | myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 254 | ---------------------------------------------------------------------- 255 | -- Custom key bindings 256 | -- 257 | 258 | -- Start a terminal. Terminal to start is specified by myTerminal variable. 259 | [ ((modMask .|. shiftMask, xK_Return), 260 | spawn $ XMonad.terminal conf) 261 | 262 | -- Lock the screen using command specified by myScreensaver. 263 | , ((modMask, xK_0), 264 | spawn myScreensaver) 265 | 266 | -- Spawn the launcher using command specified by myLauncher. 267 | -- Use this to launch programs without a key binding. 268 | , ((modMask, xK_p), 269 | spawn myLauncher) 270 | 271 | -- Take a selective screenshot using the command specified by mySelectScreenshot. 272 | , ((modMask .|. shiftMask, xK_p), 273 | spawn mySelectScreenshot) 274 | 275 | -- Take a full screenshot using the command specified by myScreenshot. 276 | , ((modMask .|. controlMask .|. shiftMask, xK_p), 277 | spawn myScreenshot) 278 | 279 | -- Toggle current focus window to fullscreen 280 | , ((modMask, xK_f), sendMessage $ Toggle FULL) 281 | 282 | -- Mute volume. 283 | , ((0, xF86XK_AudioMute), 284 | spawn "amixer -q set Master toggle") 285 | 286 | -- Decrease volume. 287 | , ((0, xF86XK_AudioLowerVolume), 288 | spawn "amixer -q set Master 5%-") 289 | 290 | -- Increase volume. 291 | , ((0, xF86XK_AudioRaiseVolume), 292 | spawn "amixer -q set Master 5%+") 293 | 294 | -- Audio previous. 295 | , ((0, 0x1008FF16), 296 | spawn "") 297 | 298 | -- Play/pause. 299 | , ((0, 0x1008FF14), 300 | spawn "") 301 | 302 | -- Audio next. 303 | , ((0, 0x1008FF17), 304 | spawn "") 305 | 306 | -- Eject CD tray. 307 | , ((0, 0x1008FF2C), 308 | spawn "eject -T") 309 | 310 | -------------------------------------------------------------------- 311 | -- "Standard" xmonad key bindings 312 | -- 313 | 314 | -- Close focused window. 315 | , ((modMask .|. shiftMask, xK_c), 316 | kill) 317 | 318 | -- Cycle through the available layout algorithms. 319 | , ((modMask, xK_space), 320 | sendMessage NextLayout) 321 | 322 | -- Reset the layouts on the current workspace to default. 323 | , ((modMask .|. shiftMask, xK_space), 324 | setLayout $ XMonad.layoutHook conf) 325 | 326 | -- Resize viewed windows to the correct size. 327 | , ((modMask, xK_n), 328 | refresh) 329 | 330 | -- Move focus to the next window. 331 | , ((modMask, xK_j), 332 | windows W.focusDown) 333 | 334 | -- Move focus to the previous window. 335 | , ((modMask, xK_k), 336 | windows W.focusUp ) 337 | 338 | -- Move focus to the master window. 339 | , ((modMask, xK_m), 340 | windows W.focusMaster ) 341 | 342 | -- Swap the focused window and the master window. 343 | , ((modMask, xK_Return), 344 | windows W.swapMaster) 345 | 346 | -- Swap the focused window with the next window. 347 | , ((modMask .|. shiftMask, xK_j), 348 | windows W.swapDown ) 349 | 350 | -- Swap the focused window with the previous window. 351 | , ((modMask .|. shiftMask, xK_k), 352 | windows W.swapUp ) 353 | 354 | -- Shrink the master area. 355 | , ((modMask, xK_h), 356 | sendMessage Shrink) 357 | 358 | -- Expand the master area. 359 | , ((modMask, xK_l), 360 | sendMessage Expand) 361 | 362 | -- Push window back into tiling. 363 | , ((modMask, xK_t), 364 | withFocused $ windows . W.sink) 365 | 366 | -- Increment the number of windows in the master area. 367 | , ((modMask, xK_comma), 368 | sendMessage (IncMasterN 1)) 369 | 370 | -- Decrement the number of windows in the master area. 371 | , ((modMask, xK_period), 372 | sendMessage (IncMasterN (-1))) 373 | 374 | -- Toggle the status bar gap. 375 | -- TODO: update this binding with avoidStruts, ((modMask, xK_b), 376 | 377 | -- Quit xmonad. 378 | , ((modMask .|. shiftMask, xK_q), 379 | io (exitWith ExitSuccess)) 380 | 381 | -- Restart xmonad. 382 | , ((modMask, xK_q), 383 | restart "xmonad" True) 384 | ] 385 | ++ 386 | 387 | -- mod-[1..9], Switch to workspace N 388 | -- mod-shift-[1..9], Move client to workspace N 389 | [((m .|. modMask, k), windows $ f i) 390 | | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] 391 | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 392 | ++ 393 | 394 | -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 395 | -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 396 | [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) 397 | | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..] 398 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] 399 | 400 | 401 | ++ 402 | -- Bindings for manage sub tabs in layouts please checkout the link below for reference 403 | -- https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Layout-SubLayouts.html 404 | [ 405 | -- Tab current focused window with the window to the left 406 | ((modMask .|. controlMask, xK_h), sendMessage $ pullGroup L) 407 | -- Tab current focused window with the window to the right 408 | , ((modMask .|. controlMask, xK_l), sendMessage $ pullGroup R) 409 | -- Tab current focused window with the window above 410 | , ((modMask .|. controlMask, xK_k), sendMessage $ pullGroup U) 411 | -- Tab current focused window with the window below 412 | , ((modMask .|. controlMask, xK_j), sendMessage $ pullGroup D) 413 | 414 | -- Tab all windows in the current workspace with current window as the focus 415 | , ((modMask .|. controlMask, xK_m), withFocused (sendMessage . MergeAll)) 416 | -- Group the current tabbed windows 417 | , ((modMask .|. controlMask, xK_u), withFocused (sendMessage . UnMerge)) 418 | 419 | -- Toggle through tabes from the right 420 | , ((modMask, xK_Tab), onGroup W.focusDown') 421 | ] 422 | 423 | ++ 424 | -- Some bindings for BinarySpacePartition 425 | -- https://github.com/benweitzman/BinarySpacePartition 426 | [ 427 | ((modMask .|. controlMask, xK_Right ), sendMessage $ ExpandTowards R) 428 | , ((modMask .|. controlMask .|. shiftMask, xK_Right ), sendMessage $ ShrinkFrom R) 429 | , ((modMask .|. controlMask, xK_Left ), sendMessage $ ExpandTowards L) 430 | , ((modMask .|. controlMask .|. shiftMask, xK_Left ), sendMessage $ ShrinkFrom L) 431 | , ((modMask .|. controlMask, xK_Down ), sendMessage $ ExpandTowards D) 432 | , ((modMask .|. controlMask .|. shiftMask, xK_Down ), sendMessage $ ShrinkFrom D) 433 | , ((modMask .|. controlMask, xK_Up ), sendMessage $ ExpandTowards U) 434 | , ((modMask .|. controlMask .|. shiftMask, xK_Up ), sendMessage $ ShrinkFrom U) 435 | , ((modMask, xK_r ), sendMessage BSP.Rotate) 436 | , ((modMask, xK_s ), sendMessage BSP.Swap) 437 | -- , ((modMask, xK_n ), sendMessage BSP.FocusParent) 438 | -- , ((modMask .|. controlMask, xK_n ), sendMessage BSP.SelectNode) 439 | -- , ((modMask .|. shiftMask, xK_n ), sendMessage BSP.MoveNode) 440 | ] 441 | 442 | ------------------------------------------------------------------------ 443 | -- Mouse bindings 444 | -- 445 | -- Focus rules 446 | -- True if your focus should follow your mouse cursor. 447 | myFocusFollowsMouse :: Bool 448 | myFocusFollowsMouse = True 449 | 450 | myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ 451 | [ 452 | -- mod-button1, Set the window to floating mode and move by dragging 453 | ((modMask, button1), 454 | (\w -> focus w >> mouseMoveWindow w)) 455 | 456 | -- mod-button2, Raise the window to the top of the stack 457 | , ((modMask, button2), 458 | (\w -> focus w >> windows W.swapMaster)) 459 | 460 | -- mod-button3, Set the window to floating mode and resize by dragging 461 | , ((modMask, button3), 462 | (\w -> focus w >> mouseResizeWindow w)) 463 | 464 | -- you may also bind events to the mouse scroll wheel (button4 and button5) 465 | ] 466 | 467 | 468 | ------------------------------------------------------------------------ 469 | -- Status bars and logging 470 | -- Perform an arbitrary action on each internal state change or X event. 471 | -- See the 'DynamicLog' extension for examples. 472 | -- 473 | -- To emulate dwm's status bar 474 | -- 475 | -- > logHook = dynamicLogDzen 476 | -- 477 | 478 | 479 | ------------------------------------------------------------------------ 480 | -- Startup hook 481 | -- Perform an arbitrary action each time xmonad starts or is restarted 482 | -- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize 483 | -- per-workspace layout choices. 484 | -- 485 | -- By default, do nothing. 486 | myStartupHook = do 487 | setWMName "LG3D" 488 | spawn "bash ~/.xmonad/startup.sh" 489 | setDefaultCursor xC_left_ptr 490 | 491 | 492 | ------------------------------------------------------------------------ 493 | -- Run xmonad with all the defaults we set up. 494 | -- 495 | main = do 496 | xmproc <- spawnPipe "xmobar ~/.xmonad/xmobarrc.hs" 497 | -- xmproc <- spawnPipe "taffybar" 498 | xmonad $ docks 499 | $ withNavigation2DConfig myNav2DConf 500 | $ additionalNav2DKeys (xK_Up, xK_Left, xK_Down, xK_Right) 501 | [ 502 | (mod4Mask, windowGo ) 503 | , (mod4Mask .|. shiftMask, windowSwap) 504 | ] 505 | False 506 | $ ewmh 507 | -- $ pagerHints -- uncomment to use taffybar 508 | $ defaults { 509 | logHook = dynamicLogWithPP xmobarPP { 510 | ppCurrent = xmobarColor xmobarCurrentWorkspaceColor "" . wrap "[" "]" 511 | , ppTitle = xmobarColor xmobarTitleColor "" . shorten 50 512 | , ppSep = " " 513 | , ppOutput = hPutStrLn xmproc 514 | } >> updatePointer (0.75, 0.75) (0.75, 0.75) 515 | } 516 | 517 | ------------------------------------------------------------------------ 518 | -- Combine it all together 519 | -- A structure containing your configuration settings, overriding 520 | -- fields in the default config. Any you don't override, will 521 | -- use the defaults defined in xmonad/XMonad/Config.hs 522 | -- 523 | -- No need to modify this. 524 | -- 525 | defaults = def { 526 | -- simple stuff 527 | terminal = myTerminal, 528 | focusFollowsMouse = myFocusFollowsMouse, 529 | borderWidth = myBorderWidth, 530 | modMask = myModMask, 531 | workspaces = myWorkspaces, 532 | normalBorderColor = myNormalBorderColor, 533 | focusedBorderColor = myFocusedBorderColor, 534 | 535 | -- key bindings 536 | keys = myKeys, 537 | mouseBindings = myMouseBindings, 538 | 539 | -- hooks, layouts 540 | layoutHook = myLayout, 541 | -- handleEventHook = E.fullscreenEventHook, 542 | handleEventHook = fullscreenEventHook, 543 | manageHook = manageDocks <+> myManageHook, 544 | startupHook = myStartupHook 545 | } 546 | --------------------------------------------------------------------------------