diff --git a/.config/xmonad/xmonad-with-polybar.org b/.config/xmonad/xmonad-with-polybar.org index ec038eb..2c9ed02 100644 --- a/.config/xmonad/xmonad-with-polybar.org +++ b/.config/xmonad/xmonad-with-polybar.org @@ -44,7 +44,6 @@ These are Haskell modules that we must import so that we can use their functions #+BEGIN_SRC haskell -- Base import XMonad -import Control.Monad (join) import System.Directory import System.IO (hClose, hPutStr, hPutStrLn) import System.Exit (exitSuccess) @@ -63,8 +62,6 @@ import qualified XMonad.Actions.Search as S -- Data import Data.Char (isSpace, toUpper) -import Data.Function (on) -import Data.List (sortBy) import Data.Maybe (fromJust) import Data.Monoid import Data.Maybe (isJust) @@ -118,11 +115,6 @@ import XMonad.Util.NamedWindows (getName) import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe) import XMonad.Util.SpawnOnce - -- Required For Polybar -import qualified DBus as D -import qualified DBus.Client as D -import qualified Codec.Binary.UTF8.String as UTF8 - -- ColorScheme module (SET ONLY ONE!) -- Possible choice are: -- DoomOne diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index be24f6e..a4f8785 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 (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..)) +import XMonad.Hooks.DynamicLog 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,6 +67,7 @@ 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,7 +123,7 @@ myStartupHook :: X () myStartupHook = do spawnOnce (mySoundPlayer ++ startupSound) spawn "killall conky" -- kill current conky on each restart - spawn "killall trayer" -- kill current trayer on each restart + spawn "killall polybar" -- kill current polybar on each restart spawnOnce "lxsession" spawnOnce "picom" @@ -132,7 +133,7 @@ myStartupHook = do spawn "/usr/bin/emacs --daemon" -- emacs daemon for the emacsclient 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") + spawn "sleep 2 && $HOME/.config/polybar/launch.sh" spawnOnce "xargs xwallpaper --stretch < ~/.cache/wall" -- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper @@ -438,22 +439,8 @@ 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 : \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 +-- 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 "] myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) myManageHook = composeAll @@ -696,12 +683,9 @@ 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 $ ewmh $ docks $ def + xmonad $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ docks . ewmh $ def { manageHook = myManageHook <+> manageDocks , handleEventHook = windowedFullscreenFixEventHook <> swallowEventHook (className =? "Alacritty" <||> className =? "st-256color" <||> className =? "XTerm") (return True) <> trayerPaddingXmobarEventHook , modMask = myModMask @@ -712,28 +696,7 @@ 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] - } + -- , logHook = dynamicLogWithPP $ filterOutWsPP [scratchpadWorkspaceTag] $ xmobarPP + --, logHook = dynamicLogWithPP (myLogHook dbus) + -- , logHook = eventLogHookForPolyBar }