DWM Keybindings & Autostart
- Replace commented out code with no tangle blocks - Port dwm keybindings and autostart to xmonad - Add more comments
This commit is contained in:
230
README.org
230
README.org
@@ -101,15 +101,19 @@ By default we use numeric strings, but any string may be used as a
|
|||||||
workspace name. The number of workspaces is determined by the length
|
workspace name. The number of workspaces is determined by the length
|
||||||
of this list.
|
of this list.
|
||||||
|
|
||||||
A tagging example:
|
*A tagging example:*
|
||||||
|
#+begin_src haskell :tangle no
|
||||||
#+begin_example
|
|
||||||
workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
||||||
#+end_example
|
#+end_src
|
||||||
|
|
||||||
|
*Workspace Names w/ Icons:*
|
||||||
|
#+begin_src haskell :tangle no
|
||||||
|
myWorkspaces = ["\xf868\x2081", "\xfd2c\x2082", "\xf2ce\x2083", "\xf1bc\x2084", "\xfa9e\x2085", "\xe795\x2086", "\xf667\x2087", "\xf11b\x2088", "\xf085\x2089"]
|
||||||
|
myWorkspaces = ["1:\xf868", "2:\xfd2c", "3:\xf2ce", "4:\xf1bc", "5:\xfa9e", "6:\xe795", "7:\xf667", "8:\xf11b", "9:\xf085"]
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*Actual Workspace Definition:*
|
||||||
#+begin_src haskell
|
#+begin_src haskell
|
||||||
-- myWorkspaces = ["\xf868\x2081", "\xfd2c\x2082", "\xf2ce\x2083", "\xf1bc\x2084", "\xfa9e\x2085", "\xe795\x2086", "\xf667\x2087", "\xf11b\x2088", "\xf085\x2089"]
|
|
||||||
-- myWorkspaces = ["1:\xf868", "2:\xfd2c", "3:\xf2ce", "4:\xf1bc", "5:\xfa9e", "6:\xe795", "7:\xf667", "8:\xf11b", "9:\xf085"]
|
|
||||||
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -126,114 +130,152 @@ is mod1Mask ("left alt"). You may also consider using mod3Mask
|
|||||||
myModMask = mod4Mask
|
myModMask = mod4Mask
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** General
|
** Default Keybindings
|
||||||
|
|
||||||
#+begin_src haskell
|
These default keybindings are left for reference, but are not actually used in my config. ~desktopConfig~ automatically uses the default keybindings shown below. I am overwriting some of these in the [[*EZConfig Keybindings]]
|
||||||
-- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|
||||||
-- -- launch a terminal
|
|
||||||
-- [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
|
||||||
|
|
||||||
-- -- launch rofi drun
|
*NOT IN USE*
|
||||||
-- , ((modm, xK_p ), spawn "rofi -show drun")
|
#+begin_src haskell :tangle no
|
||||||
|
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||||
|
-- launch a terminal
|
||||||
|
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
||||||
|
|
||||||
-- -- launch rofi clipboard
|
-- launch rofi drun
|
||||||
-- , ((modm, xK_c ), spawn "rofi -show clipboard")
|
, ((modm, xK_p ), spawn "rofi -show drun")
|
||||||
|
|
||||||
-- -- close focused window
|
-- close focused window
|
||||||
-- , ((modm .|. shiftMask, xK_c ), kill)
|
, ((modm .|. shiftMask, xK_c ), kill)
|
||||||
|
|
||||||
-- -- Rotate through the available layout algorithms
|
-- Rotate through the available layout algorithms
|
||||||
-- , ((modm, xK_space ), sendMessage NextLayout)
|
, ((modm, xK_space ), sendMessage NextLayout)
|
||||||
|
|
||||||
-- -- Reset the layouts on the current workspace to default
|
-- Reset the layouts on the current workspace to default
|
||||||
-- , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
||||||
|
|
||||||
-- -- Resize viewed windows to the correct size
|
-- Resize viewed windows to the correct size
|
||||||
-- , ((modm, xK_n ), refresh)
|
, ((modm, xK_n ), refresh)
|
||||||
|
|
||||||
-- -- Move focus to the next window
|
-- Move focus to the next window
|
||||||
-- , ((modm, xK_Tab ), windows W.focusDown)
|
, ((modm, xK_Tab ), windows W.focusDown)
|
||||||
|
|
||||||
-- -- Move focus to the next window
|
-- Move focus to the next window
|
||||||
-- , ((modm, xK_j ), windows W.focusDown)
|
, ((modm, xK_j ), windows W.focusDown)
|
||||||
|
|
||||||
-- -- Move focus to the previous window
|
-- Move focus to the previous window
|
||||||
-- , ((modm, xK_k ), windows W.focusUp )
|
, ((modm, xK_k ), windows W.focusUp )
|
||||||
|
|
||||||
-- -- Move focus to the master window
|
-- Move focus to the master window
|
||||||
-- , ((modm, xK_m ), windows W.focusMaster )
|
, ((modm, xK_m ), windows W.focusMaster )
|
||||||
|
|
||||||
-- -- Swap the focused window and the master window
|
-- Swap the focused window and the master window
|
||||||
-- , ((modm, xK_Return), windows W.swapMaster)
|
, ((modm, xK_Return), windows W.swapMaster)
|
||||||
|
|
||||||
-- -- Swap the focused window with the next window
|
-- Swap the focused window with the next window
|
||||||
-- , ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
, ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
||||||
|
|
||||||
-- -- Swap the focused window with the previous window
|
-- Swap the focused window with the previous window
|
||||||
-- , ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
, ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
||||||
|
|
||||||
-- -- Shrink the master area
|
-- Shrink the master area
|
||||||
-- , ((modm, xK_h ), sendMessage Shrink)
|
, ((modm, xK_h ), sendMessage Shrink)
|
||||||
|
|
||||||
-- -- Expand the master area
|
-- Expand the master area
|
||||||
-- , ((modm, xK_l ), sendMessage Expand)
|
, ((modm, xK_l ), sendMessage Expand)
|
||||||
|
|
||||||
-- -- Push window back into tiling
|
-- Push window back into tiling
|
||||||
-- , ((modm, xK_t ), withFocused $ windows . W.sink)
|
, ((modm, xK_t ), withFocused $ windows . W.sink)
|
||||||
|
|
||||||
-- -- Increment the number of windows in the master area
|
-- Increment the number of windows in the master area
|
||||||
-- , ((modm, xK_i ), sendMessage (IncMasterN 1))
|
, ((modm, xK_i ), sendMessage (IncMasterN 1))
|
||||||
|
|
||||||
-- -- Deincrement the number of windows in the master area
|
-- Deincrement the number of windows in the master area
|
||||||
-- , ((modm, xK_d), sendMessage (IncMasterN (-1)))
|
, ((modm, xK_d), sendMessage (IncMasterN (-1)))
|
||||||
|
|
||||||
-- -- Toggle the status bar gap
|
-- Quit xmonad
|
||||||
-- -- Use this binding with avoidStruts from Hooks.ManageDocks.
|
, ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
|
||||||
-- -- See also the statusBar function from Hooks.DynamicLog.
|
|
||||||
-- --
|
|
||||||
-- -- , ((modm , xK_b ), sendMessage ToggleStruts)
|
|
||||||
|
|
||||||
-- -- Quit xmonad
|
-- Restart xmonad
|
||||||
-- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
|
, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
|
||||||
|
|
||||||
-- -- Restart xmonad
|
-- Run xmessage with a summary of the default keybindings (useful for beginners)
|
||||||
-- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
|
, ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
|
||||||
|
]
|
||||||
|
++
|
||||||
|
|
||||||
-- -- Run xmessage with a summary of the default keybindings (useful for beginners)
|
-- mod-[1..9], Switch to workspace N
|
||||||
-- , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
|
-- mod-shift-[1..9], Move client to workspace N
|
||||||
-- ]
|
[((m .|. modm, k), windows $ f i)
|
||||||
-- ++
|
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
||||||
|
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
||||||
|
++
|
||||||
|
|
||||||
-- -- mod-[1..9], Switch to workspace N
|
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
||||||
-- -- mod-shift-[1..9], Move client to workspace N
|
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
||||||
-- [((m .|. modm, k), windows $ f i)
|
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
||||||
-- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
||||||
-- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
||||||
-- ++
|
|
||||||
|
|
||||||
-- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
|
||||||
-- -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
|
||||||
-- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
|
||||||
-- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
|
||||||
-- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Custom Bindings
|
** EZConfig Keybindings
|
||||||
|
|
||||||
#+begin_src haskell
|
#+begin_src haskell
|
||||||
myKeys =
|
myKeys =
|
||||||
[ ("M-" ++ m ++ k, windows $ f i)
|
[
|
||||||
|
-- dwm-like add window to a specific workspace
|
||||||
|
("M-" ++ m ++ k, windows $ f i)
|
||||||
| (i, k) <- zip (myWorkspaces) (map show [1 :: Int ..])
|
| (i, k) <- zip (myWorkspaces) (map show [1 :: Int ..])
|
||||||
, (f, m) <- [(W.view, ""), (W.shift, "S-"), (copy, "S-C-")]]
|
, (f, m) <- [(W.view, ""), (W.shift, "S-"), (copy, "S-C-")]
|
||||||
|
]
|
||||||
++
|
++
|
||||||
[ ("S-C-a", windows copyToAll) -- copy window to all workspaces
|
[
|
||||||
|
-- dwm-like add/remove window to/from all workspaces
|
||||||
|
("S-C-a", windows copyToAll) -- copy window to all workspaces
|
||||||
, ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces
|
, ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces
|
||||||
|
|
||||||
|
-- modify tiled window size
|
||||||
, ("M-a", sendMessage MirrorShrink) -- decrease vertical window size
|
, ("M-a", sendMessage MirrorShrink) -- decrease vertical window size
|
||||||
, ("M-z", sendMessage MirrorExpand) -- increase vertical window size
|
, ("M-z", sendMessage MirrorExpand) -- increase vertical window size
|
||||||
|
|
||||||
|
-- toggle struts for xmobar
|
||||||
, ("M-s", sendMessage ToggleStruts)
|
, ("M-s", sendMessage ToggleStruts)
|
||||||
|
|
||||||
|
-- switch directly to a layout
|
||||||
, ("M-f", sendMessage $ JumpToLayout "Full")
|
, ("M-f", sendMessage $ JumpToLayout "Full")
|
||||||
, ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall")
|
, ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall")
|
||||||
, ("M-g", sendMessage $ JumpToLayout "Spacing Grid")
|
, ("M-g", sendMessage $ JumpToLayout "Spacing Grid")
|
||||||
|
|
||||||
|
-- launch rofi
|
||||||
|
, ("M-p", spawn "rofi -show combi")
|
||||||
|
, ("M-c", spawn "rofi -show clipboard")
|
||||||
|
|
||||||
|
-- volume control
|
||||||
|
, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +1%") -- increase volume
|
||||||
|
, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -1%") -- decrease volume
|
||||||
|
, ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") -- mute volume
|
||||||
|
|
||||||
|
-- media control
|
||||||
|
, ("<XF86AudioPlay>", spawn "playerctl --player=playerctld play-pause") -- play / pause
|
||||||
|
, ("C-<XF86AudioPlay>", spawn "playerctl --player=playerctld next") -- next
|
||||||
|
, ("C-S-<XF86AudioPlay>", spawn "playerctl --player=playerctld previous") -- previous
|
||||||
|
, ("S-<XF86AudioPlay>", spawn "playerctld shift") -- change player
|
||||||
|
|
||||||
|
-- notification control
|
||||||
|
, ("M-n", spawn "dunstctl context") -- notification context menu
|
||||||
|
, ("M-C-n", spawn "dunstctl close") -- close notification
|
||||||
|
, ("M-S-n", spawn "dunstctl history-pop") -- pop history
|
||||||
|
, ("M-C-S-n", spawn "dunstctl set-paused toggle") -- toggle do not disturb
|
||||||
|
|
||||||
|
-- system control
|
||||||
|
, ("M-q", spawn "xmonad --recompile; xmonad --restart") -- recompile and restart xmonad
|
||||||
|
, ("M-C-S-q", io (exitWith ExitSuccess)) -- quit xmonad
|
||||||
|
, ("M-C-S-l", spawn "light-locker-command --lock") -- lock
|
||||||
|
, ("M-C-S-s", spawn "systemctl suspend") -- suspend
|
||||||
|
|
||||||
|
-- toggle compositor
|
||||||
|
, ("M-<Esc>", spawn "/home/sravan/.config/picom/toggle_picom.sh")
|
||||||
|
|
||||||
|
-- screenshot
|
||||||
|
, ("<Print>", spawn "flameshot gui")
|
||||||
]
|
]
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -320,17 +362,19 @@ which denotes layout choice.
|
|||||||
return (All True) if the default handler is to be run afterwards. To
|
return (All True) if the default handler is to be run afterwards. To
|
||||||
combine event hooks use mappend or mconcat from Data.Monoid.
|
combine event hooks use mappend or mconcat from Data.Monoid.
|
||||||
|
|
||||||
#+begin_src haskell
|
*NOT IN USE*
|
||||||
-- myEventHook = mempty
|
#+begin_src haskell :tangle no
|
||||||
#+end_src
|
myEventHook = mempty
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Status Bars & Logging
|
* Status Bars & Logging
|
||||||
|
|
||||||
Perform an arbitrary action on each internal state change or X event.
|
Perform an arbitrary action on each internal state change or X event.
|
||||||
See the ~XMonad.Hooks.DynamicLog~ extension for examples.
|
See the ~XMonad.Hooks.DynamicLog~ extension for examples.
|
||||||
|
|
||||||
#+begin_src haskell
|
*NOT IN USE*
|
||||||
-- myLogHook = return ()
|
#+begin_src haskell :tangle no
|
||||||
|
myLogHook = return ()
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Startup
|
* Startup
|
||||||
@@ -343,8 +387,28 @@ See the ~XMonad.Hooks.DynamicLog~ extension for examples.
|
|||||||
|
|
||||||
#+begin_src haskell
|
#+begin_src haskell
|
||||||
myStartupHook = do
|
myStartupHook = do
|
||||||
spawnOnce "nitrogen --restore &"
|
-- System Restore Processes
|
||||||
spawnOnce "picom &"
|
spawnOnce "/home/sravan/.screenlayout/default.sh &" -- restore default screen layout
|
||||||
|
spawnOnce "nitrogen --restore &" -- restore wallpaper
|
||||||
|
spawnOnce "numlockx on &" -- enable numlock
|
||||||
|
|
||||||
|
-- System Tray Applications
|
||||||
|
spawnOnce "volctl &" -- PulseAudio Volume Control
|
||||||
|
spawnOnce "nyrna &" -- Nyrna Application Suspend
|
||||||
|
spawnOnce "blueman-applet &" -- Blueman Bluetooth Manager
|
||||||
|
spawnOnce "nm-applet &" -- Network Manager Applet
|
||||||
|
spawnOnce "kdeconnect-indicator &" -- KDE Connect
|
||||||
|
spawnOnce "flameshot &" -- Flameshot Screenshot Tool
|
||||||
|
spawnOnce "xfce4-power-manager &" -- XFCE4 Power Manager
|
||||||
|
|
||||||
|
-- Background Processes
|
||||||
|
spawnOnce "/home/sravan/.config/picom/toggle_picom.sh &" -- Picom Compositor
|
||||||
|
spawnOnce "/home/sravan/.config/dunst/launch_dunst.sh &" -- Dunst Notification Daemon
|
||||||
|
spawnOnce "greenclip daemon &" -- Greenclip Clipboard Manager
|
||||||
|
spawnOnce "redshift -x &" -- Reset redshift display gamma
|
||||||
|
spawnOnce "redshift-gtk &" -- Redshift Blue Light Filter
|
||||||
|
spawnOnce "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &" -- GNOME Polkit Authentication Agent
|
||||||
|
spawnOnce "light-locker --lock-on-suspend --lock-on-lid &" -- screen lock for lightdm
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Main
|
** Main
|
||||||
|
168
xmonad.hs
168
xmonad.hs
@@ -43,113 +43,67 @@ myBorderWidth = 2
|
|||||||
myNormalBorderColor = "#4D4D4D"
|
myNormalBorderColor = "#4D4D4D"
|
||||||
myFocusedBorderColor = "#BD93F9"
|
myFocusedBorderColor = "#BD93F9"
|
||||||
|
|
||||||
-- myWorkspaces = ["\xf868\x2081", "\xfd2c\x2082", "\xf2ce\x2083", "\xf1bc\x2084", "\xfa9e\x2085", "\xe795\x2086", "\xf667\x2087", "\xf11b\x2088", "\xf085\x2089"]
|
|
||||||
-- myWorkspaces = ["1:\xf868", "2:\xfd2c", "3:\xf2ce", "4:\xf1bc", "5:\xfa9e", "6:\xe795", "7:\xf667", "8:\xf11b", "9:\xf085"]
|
|
||||||
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||||
|
|
||||||
myModMask = mod4Mask
|
myModMask = mod4Mask
|
||||||
|
|
||||||
-- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|
||||||
-- -- launch a terminal
|
|
||||||
-- [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
|
||||||
|
|
||||||
-- -- launch rofi drun
|
|
||||||
-- , ((modm, xK_p ), spawn "rofi -show drun")
|
|
||||||
|
|
||||||
-- -- launch rofi clipboard
|
|
||||||
-- , ((modm, xK_c ), spawn "rofi -show clipboard")
|
|
||||||
|
|
||||||
-- -- close focused window
|
|
||||||
-- , ((modm .|. shiftMask, xK_c ), kill)
|
|
||||||
|
|
||||||
-- -- Rotate through the available layout algorithms
|
|
||||||
-- , ((modm, xK_space ), sendMessage NextLayout)
|
|
||||||
|
|
||||||
-- -- Reset the layouts on the current workspace to default
|
|
||||||
-- , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
|
||||||
|
|
||||||
-- -- Resize viewed windows to the correct size
|
|
||||||
-- , ((modm, xK_n ), refresh)
|
|
||||||
|
|
||||||
-- -- Move focus to the next window
|
|
||||||
-- , ((modm, xK_Tab ), windows W.focusDown)
|
|
||||||
|
|
||||||
-- -- Move focus to the next window
|
|
||||||
-- , ((modm, xK_j ), windows W.focusDown)
|
|
||||||
|
|
||||||
-- -- Move focus to the previous window
|
|
||||||
-- , ((modm, xK_k ), windows W.focusUp )
|
|
||||||
|
|
||||||
-- -- Move focus to the master window
|
|
||||||
-- , ((modm, xK_m ), windows W.focusMaster )
|
|
||||||
|
|
||||||
-- -- Swap the focused window and the master window
|
|
||||||
-- , ((modm, xK_Return), windows W.swapMaster)
|
|
||||||
|
|
||||||
-- -- Swap the focused window with the next window
|
|
||||||
-- , ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
|
||||||
|
|
||||||
-- -- Swap the focused window with the previous window
|
|
||||||
-- , ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
|
||||||
|
|
||||||
-- -- Shrink the master area
|
|
||||||
-- , ((modm, xK_h ), sendMessage Shrink)
|
|
||||||
|
|
||||||
-- -- Expand the master area
|
|
||||||
-- , ((modm, xK_l ), sendMessage Expand)
|
|
||||||
|
|
||||||
-- -- Push window back into tiling
|
|
||||||
-- , ((modm, xK_t ), withFocused $ windows . W.sink)
|
|
||||||
|
|
||||||
-- -- Increment the number of windows in the master area
|
|
||||||
-- , ((modm, xK_i ), sendMessage (IncMasterN 1))
|
|
||||||
|
|
||||||
-- -- Deincrement the number of windows in the master area
|
|
||||||
-- , ((modm, xK_d), sendMessage (IncMasterN (-1)))
|
|
||||||
|
|
||||||
-- -- Toggle the status bar gap
|
|
||||||
-- -- Use this binding with avoidStruts from Hooks.ManageDocks.
|
|
||||||
-- -- See also the statusBar function from Hooks.DynamicLog.
|
|
||||||
-- --
|
|
||||||
-- -- , ((modm , xK_b ), sendMessage ToggleStruts)
|
|
||||||
|
|
||||||
-- -- Quit xmonad
|
|
||||||
-- , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
|
|
||||||
|
|
||||||
-- -- Restart xmonad
|
|
||||||
-- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
|
|
||||||
|
|
||||||
-- -- Run xmessage with a summary of the default keybindings (useful for beginners)
|
|
||||||
-- , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
|
|
||||||
-- ]
|
|
||||||
-- ++
|
|
||||||
|
|
||||||
-- -- mod-[1..9], Switch to workspace N
|
|
||||||
-- -- mod-shift-[1..9], Move client to workspace N
|
|
||||||
-- [((m .|. modm, k), windows $ f i)
|
|
||||||
-- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
|
||||||
-- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
|
||||||
-- ++
|
|
||||||
|
|
||||||
-- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
|
||||||
-- -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
|
||||||
-- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
|
||||||
-- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
|
||||||
-- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
|
||||||
|
|
||||||
myKeys =
|
myKeys =
|
||||||
[ ("M-" ++ m ++ k, windows $ f i)
|
[
|
||||||
|
-- dwm-like add window to a specific workspace
|
||||||
|
("M-" ++ m ++ k, windows $ f i)
|
||||||
| (i, k) <- zip (myWorkspaces) (map show [1 :: Int ..])
|
| (i, k) <- zip (myWorkspaces) (map show [1 :: Int ..])
|
||||||
, (f, m) <- [(W.view, ""), (W.shift, "S-"), (copy, "S-C-")]]
|
, (f, m) <- [(W.view, ""), (W.shift, "S-"), (copy, "S-C-")]
|
||||||
|
]
|
||||||
++
|
++
|
||||||
[ ("S-C-a", windows copyToAll) -- copy window to all workspaces
|
[
|
||||||
|
-- dwm-like add/remove window to/from all workspaces
|
||||||
|
("S-C-a", windows copyToAll) -- copy window to all workspaces
|
||||||
, ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces
|
, ("S-C-z", killAllOtherCopies) -- kill copies of window on other workspaces
|
||||||
|
|
||||||
|
-- modify tiled window size
|
||||||
, ("M-a", sendMessage MirrorShrink) -- decrease vertical window size
|
, ("M-a", sendMessage MirrorShrink) -- decrease vertical window size
|
||||||
, ("M-z", sendMessage MirrorExpand) -- increase vertical window size
|
, ("M-z", sendMessage MirrorExpand) -- increase vertical window size
|
||||||
|
|
||||||
|
-- toggle struts for xmobar
|
||||||
, ("M-s", sendMessage ToggleStruts)
|
, ("M-s", sendMessage ToggleStruts)
|
||||||
|
|
||||||
|
-- switch directly to a layout
|
||||||
, ("M-f", sendMessage $ JumpToLayout "Full")
|
, ("M-f", sendMessage $ JumpToLayout "Full")
|
||||||
, ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall")
|
, ("M-t", sendMessage $ JumpToLayout "Spacing ResizableTall")
|
||||||
, ("M-g", sendMessage $ JumpToLayout "Spacing Grid")
|
, ("M-g", sendMessage $ JumpToLayout "Spacing Grid")
|
||||||
|
|
||||||
|
-- launch rofi
|
||||||
|
, ("M-p", spawn "rofi -show combi")
|
||||||
|
, ("M-c", spawn "rofi -show clipboard")
|
||||||
|
|
||||||
|
-- volume control
|
||||||
|
, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +1%") -- increase volume
|
||||||
|
, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -1%") -- decrease volume
|
||||||
|
, ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") -- mute volume
|
||||||
|
|
||||||
|
-- media control
|
||||||
|
, ("<XF86AudioPlay>", spawn "playerctl --player=playerctld play-pause") -- play / pause
|
||||||
|
, ("C-<XF86AudioPlay>", spawn "playerctl --player=playerctld next") -- next
|
||||||
|
, ("C-S-<XF86AudioPlay>", spawn "playerctl --player=playerctld previous") -- previous
|
||||||
|
, ("S-<XF86AudioPlay>", spawn "playerctld shift") -- change player
|
||||||
|
|
||||||
|
-- notification control
|
||||||
|
, ("M-n", spawn "dunstctl context") -- notification context menu
|
||||||
|
, ("M-C-n", spawn "dunstctl close") -- close notification
|
||||||
|
, ("M-S-n", spawn "dunstctl history-pop") -- pop history
|
||||||
|
, ("M-C-S-n", spawn "dunstctl set-paused toggle") -- toggle do not disturb
|
||||||
|
|
||||||
|
-- system control
|
||||||
|
, ("M-q", spawn "xmonad --recompile; xmonad --restart") -- recompile and restart xmonad
|
||||||
|
, ("M-C-S-q", io (exitWith ExitSuccess)) -- quit xmonad
|
||||||
|
, ("M-C-S-l", spawn "light-locker-command --lock") -- lock
|
||||||
|
, ("M-C-S-s", spawn "systemctl suspend") -- suspend
|
||||||
|
|
||||||
|
-- toggle compositor
|
||||||
|
, ("M-<Esc>", spawn "/home/sravan/.config/picom/toggle_picom.sh")
|
||||||
|
|
||||||
|
-- screenshot
|
||||||
|
, ("<Print>", spawn "flameshot gui")
|
||||||
]
|
]
|
||||||
|
|
||||||
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
|
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||||
@@ -193,13 +147,29 @@ myManageHook = composeAll
|
|||||||
, resource =? "desktop_window" --> doIgnore
|
, resource =? "desktop_window" --> doIgnore
|
||||||
, resource =? "kdesktop" --> doIgnore ]
|
, resource =? "kdesktop" --> doIgnore ]
|
||||||
|
|
||||||
-- myEventHook = mempty
|
|
||||||
|
|
||||||
-- myLogHook = return ()
|
|
||||||
|
|
||||||
myStartupHook = do
|
myStartupHook = do
|
||||||
spawnOnce "nitrogen --restore &"
|
-- System Restore Processes
|
||||||
spawnOnce "picom &"
|
spawnOnce "/home/sravan/.screenlayout/default.sh &" -- restore default screen layout
|
||||||
|
spawnOnce "nitrogen --restore &" -- restore wallpaper
|
||||||
|
spawnOnce "numlockx on &" -- enable numlock
|
||||||
|
|
||||||
|
-- System Tray Applications
|
||||||
|
spawnOnce "volctl &" -- PulseAudio Volume Control
|
||||||
|
spawnOnce "nyrna &" -- Nyrna Application Suspend
|
||||||
|
spawnOnce "blueman-applet &" -- Blueman Bluetooth Manager
|
||||||
|
spawnOnce "nm-applet &" -- Network Manager Applet
|
||||||
|
spawnOnce "kdeconnect-indicator &" -- KDE Connect
|
||||||
|
spawnOnce "flameshot &" -- Flameshot Screenshot Tool
|
||||||
|
spawnOnce "xfce4-power-manager &" -- XFCE4 Power Manager
|
||||||
|
|
||||||
|
-- Background Processes
|
||||||
|
spawnOnce "/home/sravan/.config/picom/toggle_picom.sh &" -- Picom Compositor
|
||||||
|
spawnOnce "/home/sravan/.config/dunst/launch_dunst.sh &" -- Dunst Notification Daemon
|
||||||
|
spawnOnce "greenclip daemon &" -- Greenclip Clipboard Manager
|
||||||
|
spawnOnce "redshift -x &" -- Reset redshift display gamma
|
||||||
|
spawnOnce "redshift-gtk &" -- Redshift Blue Light Filter
|
||||||
|
spawnOnce "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &" -- GNOME Polkit Authentication Agent
|
||||||
|
spawnOnce "light-locker --lock-on-suspend --lock-on-lid &" -- screen lock for lightdm
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
-- `xmobar -x 0` launches the bar on monitor 0
|
-- `xmobar -x 0` launches the bar on monitor 0
|
||||||
|
Reference in New Issue
Block a user