From e81c6f3c1e8a914cbf8573e84e192cf32693dd76 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Wed, 25 Oct 2023 16:50:42 -0500 Subject: [PATCH] Minor edits --- .config/xmonad/xmonad-with-xmobar.org | 4 +- .config/xmonad/xmonad.hs | 76 ++++++++++++++++++++------- LICENSE | 23 -------- 3 files changed, 60 insertions(+), 43 deletions(-) delete mode 100644 LICENSE diff --git a/.config/xmonad/xmonad-with-xmobar.org b/.config/xmonad/xmonad-with-xmobar.org index 38bfe5d..afaaf4f 100644 --- a/.config/xmonad/xmonad-with-xmobar.org +++ b/.config/xmonad/xmonad-with-xmobar.org @@ -655,8 +655,8 @@ myKeys c = , ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout") , ("M-S-c", addName "Kill focused window" $ kill1) , ("M-S-a", addName "Kill all windows on WS" $ killAll) - --, ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) - , ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"]) + , ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) + --, ("M-S-", 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-/", addName "DTOS Help" $ spawn "~/.local/bin/dtos-help")] diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 904fdf7..c5eb12f 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -25,7 +25,7 @@ import Data.Tree import qualified Data.Map as M -- 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.ManageDocks (avoidStruts, docks, manageDocks, ToggleStruts(..)) 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.NamedActions import XMonad.Util.NamedScratchpad -import XMonad.Util.NamedWindows (getName) import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe) import XMonad.Util.SpawnOnce @@ -122,20 +121,21 @@ windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace myStartupHook :: X () myStartupHook = do spawnOnce (mySoundPlayer ++ startupSound) - 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" -- adding this in case of switching between xmobar and polybar. + spawn "killall conky" -- kill current conky on each restart + spawn "killall trayer" -- kill current trayer on each restart + spawn "killall polybar" -- adding this in case of switching between xmobar and polybar. spawnOnce "lxsession" spawnOnce "picom" spawnOnce "nm-applet" spawnOnce "volumeicon" spawnOnce "notify-log $HOME/.log/notify.log" 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. - spawn "polybar-xmonad" - spawnOnce "sleep 2 && xmonad --restart" - spawn ("sleep 3 && conky -c $HOME/.config/conky/xmonad/" ++ colorScheme ++ "-01.conkyrc") + + -- We killed any running conky and trayer processes earlier in the autostart, + -- so now we sleep for 2 seconds and then restart conky and trayer. + spawn ("sleep 2 && 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. spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper @@ -441,8 +441,22 @@ myLayoutHook = avoidStruts ||| wideAccordion -- myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "] --- 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 = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "] +-- myWorkspaces = +-- " 1 : \xf111 " : +-- " 2 : \xf1db " : +-- " 3 : \xf192 " : +-- " 4 : \xf025 " : +-- " 5 : \xf03d " : +-- " 6 : \xf1e3 " : +-- " 7 : \xf07b " : +-- " 8 : \xf21b " : +-- " 9 : \xf21e " : +-- [] +myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y) + +clickable ws = ""++ws++"" + where i = fromJust $ M.lookup ws myWorkspaceIndices myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook = composeAll @@ -504,8 +518,8 @@ myKeys c = , ("M-S-q", addName "Quit XMonad" $ spawn "dm-logout") , ("M-S-c", addName "Kill focused window" $ kill1) , ("M-S-a", addName "Kill all windows on WS" $ killAll) - -- , ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) - , ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "emacsclient -cF '((visibility . nil))' -e '(emacs-run-launcher)'"]) + , ("M-S-", addName "Run prompt" $ sequence_ [spawn (mySoundPlayer ++ dmenuSound), spawn "~/.local/bin/dm-run"]) + --, ("M-S-", 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-/", 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 n", addName "Emacsclient Elfeed (RSS)" $ spawn (myEmacs ++ ("--eval '(elfeed)'"))) , ("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)'"))) + , ("M-e v", addName "Emacsclient Vterm" $ spawn (myEmacs ++ ("--eval '(+vterm/here nil)'"))) , ("M-e w", addName "Emacsclient EWW Browser" $ spawn (myEmacs ++ ("--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'")))] -- Multimedia Keys @@ -688,9 +701,12 @@ myKeys c = main :: IO () 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! - xmonad $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ docks . ewmh $ def + xmonad $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmh $ docks $ def { manageHook = myManageHook <+> manageDocks , handleEventHook = windowedFullscreenFixEventHook <> swallowEventHook (className =? "Alacritty" <||> className =? "st-256color" <||> className =? "XTerm") (return True) <> trayerPaddingXmobarEventHook , modMask = myModMask @@ -701,4 +717,28 @@ main = do , borderWidth = myBorderWidth , normalBorderColor = myNormColor , 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 + ("") "" + -- Visible but not current workspace + , ppVisible = xmobarColor color06 "" . clickable + -- Hidden workspace + , ppHidden = xmobarColor color05 "" . wrap + ("") "" . clickable + -- Hidden workspaces (no windows) + , ppHiddenNoWindows = xmobarColor color05 "" . clickable + -- Title of active window + , ppTitle = xmobarColor color16 "" . shorten 60 + -- Separator character + , ppSep = " | " + -- 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] + } } diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e1c9e41..0000000 --- a/LICENSE +++ /dev/null @@ -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.