From 5b619f106191d3fedfc3ba6bd3ee63eb715b3b83 Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 2 May 2022 00:44:35 +0100 Subject: some simplifications --- xmobars.sh | 8 +++++++- xmonad.hs | 29 +++++++++++++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/xmobars.sh b/xmobars.sh index e119eda..280d597 100755 --- a/xmobars.sh +++ b/xmobars.sh @@ -2,13 +2,19 @@ killall trayer +if [[ $JAO_COLOR_SCHEME == dark ]]; then + alpha=255 +else + alpha=60 +fi + trayer --margin 2 --distancefrom left \ --distance 1 --edge top \ --align left --SetDockType true --SetPartialStrut false \ --widthtype request \ --height 21 --heighttype pixel \ --transparent true \ - --alpha 60 --padding 1 & + --alpha $alpha --padding 1 & killall xmobar-exwm xmobar-exwm $* & diff --git a/xmonad.hs b/xmonad.hs index 3b9cf31..0bf5350 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -16,7 +16,6 @@ import qualified XMonad.Hooks.EwmhDesktops as Ewm import qualified XMonad.Layout.NoBorders as NB import XMonad.Layout.IM (withIM, Property(ClassName)) import XMonad.Layout.LayoutCombinators ((|||)) --- import XMonad.Layout.WindowNavigation import qualified XMonad.Layout.LayoutCombinators as LJ import qualified XMonad.Layout.Renamed as LR import qualified XMonad.Layout.Spacing as SP @@ -102,9 +101,8 @@ keyDefs conf = , ("", spawn "amixer sset Master 10%+") , ("", spawn "amixer sset Master 10%-") , ("", spawn "amixer sset Master toggle") + , ("", emacsclient "message \"audio play\"") , ("", spawn "import -window root ~/screenshot.png") - , ("C-c", bindAll [(isntEmacs, raiseEmacs), (pure True, sendCtrlC)]) - , ("C-S-c", bindFirst [(isntEmacs, sendCtrlC)]) , ("M-", move (10,0)) , ("M-", move (-10,0)) , ("M-", move (0,-10)) @@ -119,10 +117,9 @@ keyDefs conf = , ("M-C-", resize (-10,0) (0,1)) , ("M-C-", resize (0,-10) (0,0)) , ("M-C-", resize (0,10) (0,0)) - , ("M-C-b", sendMessage $ MD.ToggleStruts) + , ("M-b", sendMessage $ MD.ToggleStruts) , ("M-d", NS.namedScratchpadAction scratchpads "deezer") - , ("M-e", runOrRaiseEmacs) - , ("M-f", toggleEmacs runOrRaiseFirefox) + , ("M-e", toggleEmacs runOrRaiseFirefox) , ("M-m", raiseEmacs >> emacsclient "jao-transient-media") , ("M-S-r", PS.shellPrompt $ conf {P.position = P.Top}) , ("M-C-r", PS.shellPrompt $ conf {P.position = P.Top}) @@ -164,7 +161,7 @@ keyDefs conf = spacing n = SP.spacingRaw False (SP.Border n 0 n 0) True (SP.Border 0 n 0 n) True namedLyt n = LR.renamed [LR.Replace n] -lytFull = namedLyt "F" $ NB.smartBorders Full +lytFull = namedLyt "F" Full lytTall = namedLyt "T" $ spacing 1 (Tall 1 (1/100) (1/2)) lytLeft = namedLyt "L" $ withIM (9/26) (ClassName "Emacs") Full lytRight = namedLyt "R" $ Refl.reflectHoriz lytLeft @@ -180,22 +177,22 @@ centerFloat width height where marginLeft = (1 - width) / 2 marginTop = (1 - height) / 2 -mHook = MD.manageDocks <+> MH.composeOne dlgs <+> composeAll cl +mHook = MH.composeOne dlgs <+> composeAll cl where dlgs = [MH.isDialog -?> MH.doCenterFloat] - cfs = ["Display", "Gitk", "MPlayer", "Vlc", "Ekiga", "xli", "Skype", - "Gpick", "Blueman-services", "Blueman-manager", "Wicd-client.py", - "Pavumeter", "Xmessage", "XLogo", "mpv", "Mpv"] + cfs = ["Display", "Gitk", "MPlayer", "Vlc", "xli", + "Blueman-services", "Blueman-manager", + "Pavucontrol", "Pavumeter", "Xmessage", "XLogo", "mpv", "Mpv"] cl = [className =? x --> MH.doCenterFloat | x <- cfs] main = do scheme <- lookupEnv "JAO_COLOR_SCHEME" let dark = Just "dark" == scheme popCfg = if dark then darkPopConfig else lightPopConfig - defBorder = if dark then "grey10" else "grey90" - defFBorder = if dark then "grey15" else "grey50" + defBorder = if dark then "grey80" else "grey70" + defFBorder = if dark then "grey85" else "grey20" ehook = SM.serverModeEventHook <+> UH.trayerPaddingXmobarEventHook - lyt = lytFull ||| lytRight ||| lytLeft ||| lytTall + lyt = NB.smartBorders $ lytFull ||| lytRight ||| lytLeft ||| lytTall localStartupHook = spawn "xmobars.sh" >> runOrRaiseEmacs xmonad $ MD.docks $ Ewm.ewmhFullscreen $ Ewm.ewmh def { manageHook = scratchpad <+> mHook <+> manageHook def @@ -203,11 +200,11 @@ main = do , layoutHook = MD.avoidStruts lyt , startupHook = localStartupHook , modMask = mod4Mask - , borderWidth = 0 + , borderWidth = 1 , focusedBorderColor = defFBorder , normalBorderColor = defBorder , terminal = (jaoscript "term") , workspaces = defWorkspaces , focusFollowsMouse = False - } `EZ.removeKeysP` ["M-j", "M-n", "M-w", "M-m", "M-r", "M-"] + } `EZ.removeKeysP` ["M-j", "M-n", "M-w", "M-m", "M-r", "M-p", "M-"] `EZ.additionalKeysP` (keyDefs popCfg) -- cgit v1.2.3