From 6b45bac21bfa168dd8e2bb4f0ea77b03e7f6b2cf Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Wed, 21 Apr 2021 16:38:06 -0500 Subject: [PATCH] Adding options for xwallpaper OR feh. --- .xmonad/README.org | 39 +++++++++++++++++++++++---------------- .xmonad/xmonad.hs | 32 ++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/.xmonad/README.org b/.xmonad/README.org index 7395a27..26f98c4 100644 --- a/.xmonad/README.org +++ b/.xmonad/README.org @@ -6,7 +6,7 @@ - [[#about-this-config][About This Config]] - [[#imports][Imports]] - [[#variables][Variables]] -- [[#autostart][Autostart]] +- [[#autostart-the-startup-hook][Autostart (The Startup Hook)]] - [[#gridselect][Gridselect]] - [[#scratchpads][Scratchpads]] - [[#layouts][Layouts]] @@ -143,25 +143,31 @@ windowCount :: X (Maybe String) windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset #+END_SRC -* Autostart +* Autostart (The Startup Hook) These are commands we want XMonad to execute on startup, such as running a compositor, setting our wallpaper, starting the emacs daemon, and starting our system tray and the applications that belong in it. #+BEGIN_SRC haskell myStartupHook :: X () myStartupHook = do - spawnOnce "lxsession &" - spawnOnce "~/.fehbg &" -- set last saved wallpaper - -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- set random wallpaper - spawnOnce "picom &" - spawnOnce "nm-applet &" - spawnOnce "volumeicon &" - spawnOnce "conky -c $HOME/.config/conky/xmonad.conkyrc" - spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x282c34 --height 22 &" - spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient - -- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance - -- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance - -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh for wallpaper setter - setWMName "LG3D" + spawnOnce "lxsession &" + spawnOnce "picom &" + spawnOnce "nm-applet &" + spawnOnce "volumeicon &" + spawnOnce "conky -c $HOME/.config/conky/xmonad.conkyrc" + spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x282c34 --height 22 &" + spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient + -- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance + -- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance +#+END_SRC + +Uncomment only ONE of the following options for setting wallpaper. +#+BEGIN_SRC haskell + spawnOnce "xargs xwallpaper --stretch < ~/.xwallpaper" -- set last saved with xwallpaper + -- spawnOnce "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch" -- set random xwallpaper + -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper + -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper + -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh + setWMName "LG3D" #+END_SRC * Gridselect @@ -545,7 +551,8 @@ myKeys = -- Set wallpaper with 'feh'. Type 'SUPER+F1' to launch sxiv in the wallpapers directory. -- Then in sxiv, type 'C-x w' to set the wallpaper that you choose. , ("M-", spawn "sxiv -r -q -t -o ~/wallpapers/*") - , ("M-", spawn "feh --randomize --bg-fill ~/wallpapers/*") + , ("M-", spawn "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch") + --, ("M-", spawn "feh --randomize --bg-fill ~/wallpapers/*") -- Controls for mocp music player (SUPER-u followed by a key) , ("M-u p", spawn "mocp --play") diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 6cdece9..66bbbc4 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -104,19 +104,22 @@ windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace myStartupHook :: X () myStartupHook = do - spawnOnce "lxsession &" - spawnOnce "~/.fehbg &" -- set last saved wallpaper - -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- set random wallpaper - spawnOnce "picom &" - spawnOnce "nm-applet &" - spawnOnce "volumeicon &" - spawnOnce "conky -c $HOME/.config/conky/xmonad.conkyrc" - spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x282c34 --height 22 &" - spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient - -- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance - -- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance - -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh for wallpaper setter - setWMName "LG3D" + spawnOnce "lxsession &" + spawnOnce "picom &" + spawnOnce "nm-applet &" + spawnOnce "volumeicon &" + spawnOnce "conky -c $HOME/.config/conky/xmonad.conkyrc" + spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x282c34 --height 22 &" + spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient + -- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance + -- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance + + spawnOnce "xargs xwallpaper --stretch < ~/.xwallpaper" -- set last saved with xwallpaper + -- spawnOnce "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch" -- set random xwallpaper + -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper + -- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper + -- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh + setWMName "LG3D" myColorizer :: Window -> Bool -> X (String, String) myColorizer = colorRangeFromClassName @@ -445,7 +448,8 @@ myKeys = -- Set wallpaper with 'feh'. Type 'SUPER+F1' to launch sxiv in the wallpapers directory. -- Then in sxiv, type 'C-x w' to set the wallpaper that you choose. , ("M-", spawn "sxiv -r -q -t -o ~/wallpapers/*") - , ("M-", spawn "feh --randomize --bg-fill ~/wallpapers/*") + , ("M-", spawn "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch") + --, ("M-", spawn "feh --randomize --bg-fill ~/wallpapers/*") -- Controls for mocp music player (SUPER-u followed by a key) , ("M-u p", spawn "mocp --play")