Merge branch 'master' of github.com:hektor/dots
						commit
						3113852985
					
				|  | @ -48,12 +48,13 @@ alias df="df -kTh" | ||||||
| alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S" | alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S" | ||||||
| alias o="xdg-open" | alias o="xdg-open" | ||||||
| alias path="echo -e ${PATH//:/\\n}" # Pretty print path variables | alias path="echo -e ${PATH//:/\\n}" # Pretty print path variables | ||||||
| alias wiki="vim +WikiIndex" |  | ||||||
| 
 | 
 | ||||||
| # Programs | # Programs | ||||||
| 
 | 
 | ||||||
| alias feh="feh -B black --scale-down --auto-zoom" | alias feh="feh -B black --scale-down --auto-zoom" | ||||||
| alias fm='pcmanfm' | alias fm='pcmanfm' | ||||||
|  | alias v="nvim" | ||||||
|  | alias w="nvim +WikiIndex" | ||||||
| alias g='git' | alias g='git' | ||||||
| alias lm='xbacklight -set' | alias lm='xbacklight -set' | ||||||
| alias py='python' | alias py='python' | ||||||
|  |  | ||||||
							
								
								
									
										21
									
								
								.xmobarrc
								
								
								
								
							
							
						
						
									
										21
									
								
								.xmobarrc
								
								
								
								
							|  | @ -1,13 +1,21 @@ | ||||||
| Config { overrideRedirect = False | Config { overrideRedirect = False | ||||||
|        , font =         "xft:Iosevka Term SS08:size=12:antialias=true" |        , font =         "xft:Iosevka Term SS08:size=12:antialias=true" | ||||||
|        , bgColor =      "#111" |        , bgColor =      "#cccccc" | ||||||
|        , fgColor =      "#ccc" |        , fgColor =      "#111" | ||||||
|        , position = TopW L 90 |        , position = TopW L 100 | ||||||
|        , commands = [ Run Cpu |        , commands = [ Run Cpu | ||||||
|                         [ "-L", "3" |                         [ "-L", "3" | ||||||
|                         , "-H", "50" |                         , "-H", "50" | ||||||
|                         , "--high"  , "red" |                         , "--high"  , "red" | ||||||
|                         , "--normal", "green" |                         ] 10 | ||||||
|  |                     , Run Battery [ | ||||||
|  |                         "-t", "<acstatus>: <left>% - <timeleft>", | ||||||
|  |                         "--", | ||||||
|  |                         --"-c", "charge_full", | ||||||
|  |                         "-O", "AC", | ||||||
|  |                         "-o", "Bat", | ||||||
|  |                         "-h", "green", | ||||||
|  |                         "-l", "red" | ||||||
|                         ] 10 |                         ] 10 | ||||||
|                     , Run Alsa "default" "Master" |                     , Run Alsa "default" "Master" | ||||||
|                         [ "--template", "Vol: <volumestatus>" |                         [ "--template", "Vol: <volumestatus>" | ||||||
|  | @ -17,9 +25,12 @@ Config { overrideRedirect = False | ||||||
|                         ] |                         ] | ||||||
|                     , Run Memory ["--template", "Mem: <usedratio>%"] 10 |                     , Run Memory ["--template", "Mem: <usedratio>%"] 10 | ||||||
|                     , Run Date "%a %Y-%m-%d %H:%M" "date" 10 |                     , Run Date "%a %Y-%m-%d %H:%M" "date" 10 | ||||||
|  |                     , Run Com "sb-pomo" [] "pomo" 10 | ||||||
|  |                     , Run Com "sb-anki" [] "anki" 10 | ||||||
|  |                     , Run Com "sb-tasks" [] "tasks" 10 | ||||||
|                     , Run XMonadLog |                     , Run XMonadLog | ||||||
|                     ] |                     ] | ||||||
|        , sepChar  = "%" |        , sepChar  = "%" | ||||||
|        , alignSep = "}{" |        , alignSep = "}{" | ||||||
|        , template = "%XMonadLog% }{ %alsa:default:Master% | %cpu% | %memory% | %date% " |        , template = "%XMonadLog%%anki%%pomo%%tasks% }{ %alsa:default:Master% | %battery% | %date%" | ||||||
|        } |        } | ||||||
|  |  | ||||||
|  | @ -1,177 +1,203 @@ | ||||||
| import           XMonad | import XMonad | ||||||
| 
 | import XMonad.Hooks.DynamicLog | ||||||
| import           XMonad.Hooks.DynamicLog | import XMonad.Hooks.EwmhDesktops | ||||||
| import           XMonad.Hooks.EwmhDesktops | import XMonad.Hooks.ManageDocks | ||||||
| import           XMonad.Hooks.ManageDocks | import XMonad.Hooks.ManageHelpers | ||||||
| import           XMonad.Hooks.ManageHelpers | import XMonad.Hooks.StatusBar | ||||||
| import           XMonad.Hooks.StatusBar | import XMonad.Hooks.StatusBar.PP | ||||||
| import           XMonad.Hooks.StatusBar.PP | import XMonad.Layout.Magnifier | ||||||
| 
 | import qualified XMonad.Layout.Magnifier as Mag (MagnifyMsg (..)) | ||||||
| import           XMonad.Layout.Magnifier | import XMonad.Layout.NoBorders (hasBorder, smartBorders) | ||||||
| import qualified XMonad.Layout.Magnifier        as Mag (MagnifyMsg (..)) | import XMonad.Layout.PerScreen | ||||||
| import           XMonad.Layout.NoBorders        (hasBorder, smartBorders) | import XMonad.Layout.ResizableTile | ||||||
| import           XMonad.Layout.PerScreen | import XMonad.Layout.Spacing | ||||||
| import           XMonad.Layout.ResizableTile | import XMonad.Layout.ThreeColumns | ||||||
| import           XMonad.Layout.Spacing | import XMonad.Layout.ToggleLayouts | ||||||
| import           XMonad.Layout.ThreeColumns |   ( ToggleLayout (..), | ||||||
| import           XMonad.Layout.ToggleLayouts    (ToggleLayout (..), |     toggleLayouts, | ||||||
|                                                  toggleLayouts) |   ) | ||||||
| import           XMonad.Layout.WindowNavigation | import XMonad.Layout.WindowNavigation | ||||||
| 
 | import qualified XMonad.StackSet as W | ||||||
| import qualified XMonad.StackSet                as W | import XMonad.Util.EZConfig | ||||||
| 
 | import qualified XMonad.Util.Hacks as Hacks | ||||||
| import           XMonad.Util.EZConfig | import XMonad.Util.Loggers | ||||||
| import qualified XMonad.Util.Hacks              as Hacks | import XMonad.Util.Paste | ||||||
| import           XMonad.Util.Loggers | import XMonad.Util.Run | ||||||
| import           XMonad.Util.Paste |   ( spawnExternalProcess, | ||||||
| import           XMonad.Util.Run                (spawnExternalProcess, |     spawnPipe, | ||||||
|                                                  spawnPipe) |   ) | ||||||
| import           XMonad.Util.Ungrab | import XMonad.Util.Ungrab | ||||||
| 
 | 
 | ||||||
| -- Statusbar | -- Statusbar | ||||||
| myXmobarPP :: PP | myXmobarPP :: PP | ||||||
| myXmobarPP = def | myXmobarPP = | ||||||
|     { ppSep             = tertiaryColor " | " |   def | ||||||
|     , ppCurrent         = brackitify |     { ppSep = tertiaryColor " | ", | ||||||
|     , ppHidden          = secondaryColor |       ppCurrent = brackitify, | ||||||
|     , ppHiddenNoWindows = tertiaryColor |       ppHidden = secondaryColor, | ||||||
|     , ppUrgent          = red . wrap (yellow "!") (yellow "!") |       ppHiddenNoWindows = tertiaryColor, | ||||||
|     , ppLayout  = \l -> case l of "Tall"                        -> "[]=" |       ppUrgent = red . wrap (yellow "!") (yellow "!"), | ||||||
|                                   "Magnifier Tall"              -> "[]+" |       ppLayout = \l -> case l of | ||||||
|                                   "Magnifier (off) Tall"        -> "[]=" |         "Tall" -> "[]=" | ||||||
|                                   "Magnifier Mirror Tall"       -> "+[]" |         "Magnifier Tall" -> "[]+" | ||||||
|                                   "Magnifier (off) Mirror Tall" -> "=[]" |         "Magnifier (off) Tall" -> "[]=" | ||||||
|                                   "Full"                        -> "[ ]" |         "Magnifier Mirror Tall" -> "+[]" | ||||||
|                                   "ThreeCol"                    -> "|||" |         "Magnifier (off) Mirror Tall" -> "=[]" | ||||||
|                                   _                             -> l |         "Full" -> "[ ]" | ||||||
|     , ppTitle   = shorten 80 |         "ThreeCol" -> "|||" | ||||||
|     , ppTitleSanitize   = xmobarStrip |         _ -> l, | ||||||
|     , ppOrder           = \[ws, l, _, wins] -> [ws, l, wins] |       ppTitle = shorten 80, | ||||||
|     , ppExtras          = [logTitles formatFocused formatUnfocused] |       ppTitleSanitize = xmobarStrip, | ||||||
|  |       ppOrder = \[ws, l, _, wins] -> [ws, l, wins], | ||||||
|  |       ppExtras = [logTitles formatFocused formatUnfocused] | ||||||
|     } |     } | ||||||
|   where |   where | ||||||
|     brackitify = wrap "[" "]" |     brackitify = wrap "[" "]" | ||||||
|     formatFocused   = secondaryColor . brackitify . ppWindow |     formatFocused = secondaryColor . brackitify . ppWindow | ||||||
|     formatUnfocused = tertiaryColor . ppWindow |     formatUnfocused = tertiaryColor . ppWindow | ||||||
| 
 | 
 | ||||||
|     ppWindow = xmobarRaw . (\w -> if null w then "Untitled" else w) . shorten 16 |     ppWindow = xmobarRaw . (\w -> if null w then "Untitled" else w) . shorten 16 | ||||||
| 
 | 
 | ||||||
|     primaryColor = xmobarColor "#eeeeee" "" |     primaryColor = xmobarColor "#000000" "" | ||||||
|     secondaryColor = xmobarColor "#aaaaaa" "" |     secondaryColor = xmobarColor "#333333" "" | ||||||
|     tertiaryColor = xmobarColor "#888888" "" |     tertiaryColor = xmobarColor "#555555" "" | ||||||
|     yellow   = xmobarColor "#ff0" "" |     yellow = xmobarColor "#ff0" "" | ||||||
|     red      = xmobarColor "#ff5555" "" |     red = xmobarColor "#ff5555" "" | ||||||
| 
 | 
 | ||||||
| -- Shift to workspace and view workspace | -- Shift to workspace and view workspace | ||||||
| shiftAndView id = doF (W.view id) <> doF (W.shift id) | shiftAndView id = doF (W.view id) <> doF (W.shift id) | ||||||
| 
 | 
 | ||||||
| -- manageHook | -- manageHook | ||||||
| myManageHook = composeAll | myManageHook = | ||||||
|                  [ |   composeAll | ||||||
|                    className =? "Zathura"    --> doShift "pdf" |     [ className =? "Zathura" --> doShift "pdf", | ||||||
|                  , className =? "firefox"    --> shiftAndView "www" |       className =? "firefox" --> shiftAndView "www", | ||||||
|                  , className =? "Anki"       --> shiftAndView "etc" |       className =? "Anki" --> shiftAndView "etc", | ||||||
|                  , className =? "Obsidian"   --> shiftAndView "etc" |       className =? "Obsidian" --> shiftAndView "etc", | ||||||
|                  , className =? "Launcher"   --> doRectFloat (W.RationalRect 0.05 0.4 0.9 0.5) |       className =? "Launcher" --> doRectFloat (W.RationalRect 0.05 0.4 0.9 0.5), | ||||||
|                  , className =? "Calculator" --> doCenterFloat |       className =? "Calculator" --> doCenterFloat, | ||||||
|                  , className =? "feh"        --> doCenterFloat |       className =? "feh" --> doCenterFloat, | ||||||
|                  , className =? "albert"     --> hasBorder False |       className =? "albert" --> hasBorder False, | ||||||
|                  , className =? "Xournalpp"  --> doRectFloat (W.RationalRect 0.5 0.5 0.5 0.5) |       className =? "Xournalpp" --> doRectFloat (W.RationalRect 0.5 0.5 0.5 0.5) | ||||||
|                  ] |     ] | ||||||
| 
 | 
 | ||||||
| -- layoutHook | -- layoutHook | ||||||
| myLayoutHook= smartBorders $ | myLayoutHook = | ||||||
|              -- Column layouts |   smartBorders $ | ||||||
|              threeCol ||| |     -- Column layouts | ||||||
|              threeColMid ||| |     threeCol | ||||||
|              -- Tiled layouts |       ||| threeColMid | ||||||
|              --   Note: magnifier is off by default |       -- Tiled layouts | ||||||
|              --   (controllable usingarrow keys) |       --   Note: magnifier is off by default | ||||||
|              magnifiercz magnificationFactorH tiled ||| |       --   (controllable usingarrow keys) | ||||||
|              magnifiercz magnificationFactorV (Mirror tiled) ||| |       ||| magnifiercz magnificationFactorH tiled | ||||||
|              -- Single window / monocle layout |       ||| magnifiercz magnificationFactorV (Mirror tiled) | ||||||
|              Full |       -- Single window / monocle layout | ||||||
|  |       ||| Full | ||||||
|   where |   where | ||||||
|     magnificationFactorV = 1.384 |     magnificationFactorV = 1.384 | ||||||
|     magnificationFactorH = 1.621 |     magnificationFactorH = 1.621 | ||||||
|     tiled   = Tall nmaster delta ratio |     tiled = Tall nmaster delta ratio | ||||||
|     threeCol = ThreeCol nmaster delta ratio |     threeCol = ThreeCol nmaster delta ratio | ||||||
|     threeColMid = ThreeColMid nmaster delta ratio |     threeColMid = ThreeColMid nmaster delta ratio | ||||||
|     nmaster = 1 |     nmaster = 1 | ||||||
|     ratio   = 1/2 |     ratio = 1 / 2 | ||||||
|     delta   = 4/100 |     delta = 4 / 100 | ||||||
| 
 | 
 | ||||||
| myConfig = def | myConfig = | ||||||
|   { |   def | ||||||
|     terminal = "alacritty" |     { terminal = "alacritty", | ||||||
| 
 |       -- Use Win key instead of Alt | ||||||
|   -- Use Win key instead of Alt |       modMask = mod4Mask, | ||||||
|   , modMask = mod4Mask |       -- , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"] | ||||||
|   , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"] |       workspaces = | ||||||
| 
 |         [ "sh", | ||||||
|   -- Styling |           "www", | ||||||
|   , focusedBorderColor = "#888" |           "dev", | ||||||
|   , normalBorderColor = "#000" |           -- "nix", | ||||||
|   , borderWidth = 2 |           "pdf", | ||||||
| 
 |           "etc" | ||||||
|   -- Hooks |         ], | ||||||
|   , manageHook = myManageHook <+> manageHook def |       -- Styling | ||||||
|   , layoutHook = avoidStruts myLayoutHook |       focusedBorderColor = "#888", | ||||||
|   , handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook |       normalBorderColor = "#000", | ||||||
|   } `additionalKeysP` myKeysP |       borderWidth = 2, | ||||||
|  |       -- Hooks | ||||||
|  |       manageHook = myManageHook <+> manageHook def, | ||||||
|  |       layoutHook = avoidStruts myLayoutHook, | ||||||
|  |       handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook | ||||||
|  |     } | ||||||
|  |     `additionalKeysP` myKeysP | ||||||
|     `removeKeysP` myRemoveKeysP |     `removeKeysP` myRemoveKeysP | ||||||
| 
 | 
 | ||||||
| -- Keybindings to be added/overridden | -- Keybindings to be added/overridden | ||||||
| myKeysP = [ | myKeysP = | ||||||
|   -- Fit floating windows back to layout |   [ -- Fit floating windows back to layout | ||||||
|     ("M-S-<Space>", withFocused $ windows . W.sink) |     ("M-S-<Space>", withFocused $ windows . W.sink), | ||||||
| 
 |     -- Launchers | ||||||
|   -- Launchers |     ("M-S-p", spawn "alacritty --class Launcher,Launcher"), | ||||||
|   , ("M-p", spawn "albert toggle") |     ("M-p", spawn "albert toggle"), | ||||||
| 
 |     -- Map insert key to paste from clipboard | ||||||
|   -- Map insert key to paste from clipboard |     ("<Insert>", pasteSelection), | ||||||
|   , ("<Insert>", pasteSelection) |     -- Map print screen to take a screenshot with flameshot | ||||||
| 
 |     ("<Print>", spawn "flameshot gui"), | ||||||
|   -- Map print screen to take a screenshot with flameshot |     -- Map audio keys to control volume | ||||||
|   , ("<Print>", spawn "flameshot gui") |     ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%"), | ||||||
| 
 |     ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%"), | ||||||
|   -- Map audio keys to control volume |     ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle"), | ||||||
|   , ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%") |     -- Map brightness keys to control brightness with brightnessctl | ||||||
|   , ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%") |     ("<XF86MonBrightnessUp>", spawn "brightnessctl set 20+"), | ||||||
|   , ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") |     ("<XF86MonBrightnessDown>", spawn "brightnessctl set 20-"), | ||||||
| 
 |     -- Map brightness keys + shift to adjust redshift temperature | ||||||
|   -- Map brightness keys to control brightness with brightnessctl |     ("S-<XF86MonBrightnessUp>", spawn "echo $(($(cat /tmp/temperature) + 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything"), | ||||||
|   , ("<XF86MonBrightnessUp>", spawn "brightnessctl set 20+") |     ("S-<XF86MonBrightnessDown>", spawn "echo $(($(cat /tmp/temperature) - 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything"), | ||||||
|   , ("<XF86MonBrightnessDown>", spawn "brightnessctl set 20-") |     -- Reset redshift temperature | ||||||
| 
 |     ("M-S-<XF86MonBrightnessUp>", spawn "echo 3000 > /tmp/temperature && redshift -x"), | ||||||
|   -- Map brightness keys + shift to adjust redshift temperature |     ("M-S-<XF86MonBrightnessDown>", spawn "echo 3000 > /tmp/temperature && redshift -x"), | ||||||
|   , ("S-<XF86MonBrightnessUp>", spawn "echo $(($(cat /tmp/temperature) + 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything") |     -- Use power down key to suspend | ||||||
|   , ("S-<XF86MonBrightnessDown>", spawn "echo $(($(cat /tmp/temperature) - 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything") |     ("<XF86PowerOff>", spawn "systemctl suspend"), | ||||||
| 
 |     -- FIXME: Spawn firefox in fullscreen, but not in kiosk mode | ||||||
|   -- Reset redshift temperature |     ("M-S-b", spawn "firefox --fullscreen"), | ||||||
|   , ("M-S-<XF86MonBrightnessUp>", spawn "echo 3000 > /tmp/temperature && redshift -x") |     -- Magnify window using arrow keys | ||||||
|   , ("M-S-<XF86MonBrightnessDown>", spawn "echo 3000 > /tmp/temperature && redshift -x") |     ("M-=", sendMessage MagnifyMore >> sendMessage Mag.ToggleOn), | ||||||
| 
 |     ("M--", sendMessage MagnifyLess >> sendMessage Mag.ToggleOn), | ||||||
|   -- Use power down key to suspend |     -- Reset magnification | ||||||
|   , ("<XF86PowerOff>", spawn "systemctl suspend") |     ("M-S-=", sendMessage Mag.ToggleOff), | ||||||
| 
 |     ("<XF86Calculator>", spawn "alacritty --class 'Calculator' -e ipython -i /home/h/.bin/calc.py"), | ||||||
|   -- FIXME: Spawn firefox in fullscreen, but not in kiosk mode |     -- playerctl ncspot using arrow keys | ||||||
|   , ("M-S-b", spawn "firefox --fullscreen") |     ("M-<Right>", spawn "playerctl next"), | ||||||
| 
 |     ("M-<Left>", spawn "playerctl previous"), | ||||||
|   -- Magnify window using arrow keys |     ("M-<Up>", spawn "playerctl play"), | ||||||
|   , ("M-=", sendMessage MagnifyMore >> sendMessage Mag.ToggleOn) |     ("M-<Down>", spawn "playerctl pause"), | ||||||
|   , ("M--", sendMessage MagnifyLess >> sendMessage Mag.ToggleOn) |     -- Use a,s,d,f,g to switch to workspaces | ||||||
|   -- Reset magnification |     ("M-a", windows $ W.greedyView "sh"), | ||||||
|   , ("M-S-=", sendMessage Mag.ToggleOff) |     ("M-s", windows $ W.greedyView "www"), | ||||||
|   -- Layouts |     ("M-d", windows $ W.greedyView "dev"), | ||||||
|   , ("M-t", sendMessage $ JumpToLayout "Magnifier Tall") |     ("M-f", windows $ W.greedyView "pdf"), | ||||||
|   , ("M-c", sendMessage $ JumpToLayout "ThreeCol") |     ("M-g", windows $ W.greedyView "etc"), | ||||||
|   , ("M-f", sendMessage $ JumpToLayout "Full") |     -- Use shift + a,s,d,f,g to move window to workspace | ||||||
|  |     ("M-S-a", windows $ W.shift "sh"), | ||||||
|  |     ("M-S-s", windows $ W.shift "www"), | ||||||
|  |     ("M-S-d", windows $ W.shift "dev"), | ||||||
|  |     ("M-S-f", windows $ W.shift "pdf"), | ||||||
|  |     ("M-S-g", windows $ W.shift "etc") | ||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
| -- Keybindings to be removed | -- Keybindings to be removed | ||||||
| myRemoveKeysP = [ ] | myRemoveKeysP = | ||||||
| 
 |   [ -- Remove 1,2,3,4,5 bindings for workspaces | ||||||
|  |     "M-1", | ||||||
|  |     "M-2", | ||||||
|  |     "M-3", | ||||||
|  |     "M-4", | ||||||
|  |     "M-5", | ||||||
|  |     -- Remove shift + 1,2,3,4,5 bindings for workspaces | ||||||
|  |     "M-S-1", | ||||||
|  |     "M-S-2", | ||||||
|  |     "M-S-3", | ||||||
|  |     "M-S-4", | ||||||
|  |     "M-S-5" | ||||||
|  |   ] | ||||||
| 
 | 
 | ||||||
| main :: IO () | main :: IO () | ||||||
| main = do xmonad $ docks $ ewmh $ withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey myConfig | main = do xmonad $ docks $ ewmh $ withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey myConfig | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue