Minor edits

This commit is contained in:
Derek Taylor
2023-10-25 16:50:42 -05:00
parent 53e0adeec0
commit e81c6f3c1e
3 changed files with 60 additions and 43 deletions

View File

@@ -655,8 +655,8 @@ myKeys c =
, ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout") , ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout")
, ("M-S-c", addName "Kill focused window" $ kill1) , ("M-S-c", addName "Kill focused window" $ kill1)
, ("M-S-a", addName "Kill all windows on WS" $ killAll) , ("M-S-a", addName "Kill all windows on WS" $ killAll)
--, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) , ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"])
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"]) --, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"])
, ("M-S-b", addName "Toggle bar show/hide" $ sendMessage ToggleStruts) , ("M-S-b", addName "Toggle bar show/hide" $ sendMessage ToggleStruts)
, ("M-/", addName "DTOS Help" $ spawn "~/.local/bin/dtos-help")] , ("M-/", addName "DTOS Help" $ spawn "~/.local/bin/dtos-help")]

View File

@@ -25,7 +25,7 @@ import Data.Tree
import qualified Data.Map as M import qualified Data.Map as M
-- Hooks -- Hooks
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs. import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs.
import XMonad.Hooks.ManageDocks (avoidStruts, docks, manageDocks, ToggleStruts(..)) import XMonad.Hooks.ManageDocks (avoidStruts, docks, manageDocks, ToggleStruts(..))
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat) import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat)
@@ -67,7 +67,6 @@ import XMonad.Util.EZConfig (additionalKeysP, mkNamedKeymap)
import XMonad.Util.Hacks (windowedFullscreenFixEventHook, javaHack, trayerAboveXmobarEventHook, trayAbovePanelEventHook, trayerPaddingXmobarEventHook, trayPaddingXmobarEventHook, trayPaddingEventHook) import XMonad.Util.Hacks (windowedFullscreenFixEventHook, javaHack, trayerAboveXmobarEventHook, trayAbovePanelEventHook, trayerPaddingXmobarEventHook, trayPaddingXmobarEventHook, trayPaddingEventHook)
import XMonad.Util.NamedActions import XMonad.Util.NamedActions
import XMonad.Util.NamedScratchpad import XMonad.Util.NamedScratchpad
import XMonad.Util.NamedWindows (getName)
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe) import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
import XMonad.Util.SpawnOnce import XMonad.Util.SpawnOnce
@@ -123,19 +122,20 @@ myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce (mySoundPlayer ++ startupSound) spawnOnce (mySoundPlayer ++ startupSound)
spawn "killall conky" -- kill current conky on each restart spawn "killall conky" -- kill current conky on each restart
spawn "killall xmobar" -- adding this in case of switching between xmobar and polybar. spawn "killall trayer" -- kill current trayer on each restart
spawn "killall trayer" -- adding this in case of switching between xmobar and polybar. spawn "killall polybar" -- adding this in case of switching between xmobar and polybar.
spawnOnce "lxsession" spawnOnce "lxsession"
spawnOnce "picom" spawnOnce "picom"
spawnOnce "nm-applet" spawnOnce "nm-applet"
spawnOnce "volumeicon" spawnOnce "volumeicon"
spawnOnce "notify-log $HOME/.log/notify.log" spawnOnce "notify-log $HOME/.log/notify.log"
spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient
-- We killed any running conky processes earlier in the autostart,
-- so now we sleep for 2 seconds and then restart conky. -- We killed any running conky and trayer processes earlier in the autostart,
spawn "polybar-xmonad" -- so now we sleep for 2 seconds and then restart conky and trayer.
spawnOnce "sleep 2 && xmonad --restart" spawn ("sleep 2 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc")
spawn ("sleep 3 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc") spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 " ++ colorTrayer ++ " --height 22")
-- Select only =ONE= of the following four ways to set the wallpaper. -- Select only =ONE= of the following four ways to set the wallpaper.
spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall"
-- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper
@@ -441,8 +441,22 @@ myLayoutHook = avoidStruts
||| wideAccordion ||| wideAccordion
-- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "] -- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
-- myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "] myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "]
myWorkspaces = ["1: dev", "2: www", "3: sys", "4: doc", "5: vbox", "6: chat", "7: mus", "8: vid", "9: gfx"] -- myWorkspaces =
-- " 1 : <fn=2>\xf111</fn> " :
-- " 2 : <fn=2>\xf1db</fn> " :
-- " 3 : <fn=2>\xf192</fn> " :
-- " 4 : <fn=2>\xf025</fn> " :
-- " 5 : <fn=2>\xf03d</fn> " :
-- " 6 : <fn=2>\xf1e3</fn> " :
-- " 7 : <fn=2>\xf07b</fn> " :
-- " 8 : <fn=2>\xf21b</fn> " :
-- " 9 : <fn=2>\xf21e</fn> " :
-- []
myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y)
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
where i = fromJust $ M.lookup ws myWorkspaceIndices
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll myManageHook = composeAll
@@ -504,8 +518,8 @@ myKeys c =
, ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout") , ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout")
, ("M-S-c", addName "Kill focused window" $ kill1) , ("M-S-c", addName "Kill focused window" $ kill1)
, ("M-S-a", addName "Kill all windows on WS" $ killAll) , ("M-S-a", addName "Kill all windows on WS" $ killAll)
-- , ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) , ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"])
, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"]) --, ("M-S-<Return>", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"])
, ("M-S-b", addName "Toggle bar show/hide" $ sendMessage ToggleStruts) , ("M-S-b", addName "Toggle bar show/hide" $ sendMessage ToggleStruts)
, ("M-/", addName "DTOS Help" $ spawn "~/.local/bin/dtos-help")] , ("M-/", addName "DTOS Help" $ spawn "~/.local/bin/dtos-help")]
@@ -663,8 +677,7 @@ myKeys c =
, ("M-e i", addName "Emacsclient ERC (IRC)" $ spawn (myEmacs ++ ("--eval '(erc)'"))) , ("M-e i", addName "Emacsclient ERC (IRC)" $ spawn (myEmacs ++ ("--eval '(erc)'")))
, ("M-e n", addName "Emacsclient Elfeed (RSS)" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) , ("M-e n", addName "Emacsclient Elfeed (RSS)" $ spawn (myEmacs ++ ("--eval '(elfeed)'")))
, ("M-e s", addName "Emacsclient Eshell" $ spawn (myEmacs ++ ("--eval '(eshell)'"))) , ("M-e s", addName "Emacsclient Eshell" $ spawn (myEmacs ++ ("--eval '(eshell)'")))
--, ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) , ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'")))
, ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(vterm)'")))
, ("M-e w", addName "Emacsclient EWW Browser" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'")))] , ("M-e w", addName "Emacsclient EWW Browser" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'")))]
-- Multimedia Keys -- Multimedia Keys
@@ -688,9 +701,12 @@ myKeys c =
main :: IO () main :: IO ()
main = do main = do
-- Launching three instances of xmobar on their monitors.
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/" ++ colorScheme ++ "-xmobarrc")
-- the xmonad, ya know...what the WM is named after! -- the xmonad, ya know...what the WM is named after!
xmonad $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ docks . ewmh $ def xmonad $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh $ docks $ def
{ manageHook = myManageHook <+> manageDocks { manageHook = myManageHook <+> manageDocks
, handleEventHook = windowedFullscreenFixEventHook <> swallowEventHook (className =? "Alacritty" <||> className =? "st-256color" <||> className =? "XTerm") (return True) <> trayerPaddingXmobarEventHook , handleEventHook = windowedFullscreenFixEventHook <> swallowEventHook (className =? "Alacritty" <||> className =? "st-256color" <||> className =? "XTerm") (return True) <> trayerPaddingXmobarEventHook
, modMask = myModMask , modMask = myModMask
@@ -701,4 +717,28 @@ main = do
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, normalBorderColor = myNormColor , normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor , focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ filterOutWsPP [scratchpadWorkspaceTag] $ xmobarPP
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
>> hPutStrLn xmproc1 x -- xmobar on monitor 2
>> hPutStrLn xmproc2 x -- xmobar on monitor 3
, ppCurrent = xmobarColor color06 "" . wrap
("<box type=Bottom width=2 mb=2 color=" ++ color06 ++ ">") "</box>"
-- Visible but not current workspace
, ppVisible = xmobarColor color06 "" . clickable
-- Hidden workspace
, ppHidden = xmobarColor color05 "" . wrap
("<box type=Top width=2 mt=2 color=" ++ color05 ++ ">") "</box>" . clickable
-- Hidden workspaces (no windows)
, ppHiddenNoWindows = xmobarColor color05 "" . clickable
-- Title of active window
, ppTitle = xmobarColor color16 "" . shorten 60
-- Separator character
, ppSep = "<fc=" ++ color09 ++ "> <fn=1>|</fn> </fc>"
-- Urgent workspace
, ppUrgent = xmobarColor color02 "" . wrap "!" "!"
-- Adding # of windows on current workspace to the bar
, ppExtras = [windowCount]
-- order of things in xmobar
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t]
}
} }

23
LICENSE
View File

@@ -1,23 +0,0 @@
MIT License
Copyright (c) 2019 Derek Taylor
https://www.youtube.com/c/DistroTube
https://gitlab.com/dwt1/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.