From a83eac15abab876a880fef9f46e3d66ea880d2fc Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 14 Aug 2021 11:06:01 +0200 Subject: [PATCH] bar stuff --- eww-bar/.config/eww-bar/eww.yuck | 10 +++++++--- eww-bar/.config/eww-bar/update-workspaces.sh | 12 +++++++----- nvim/.config/nvim/fnl/dots/plugins.fnl | 1 + xmonad/.xmonad/lib/Config.hs | 4 ++-- xmonad/.xmonad/lib/Rofi.hs | 4 ++-- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/eww-bar/.config/eww-bar/eww.yuck b/eww-bar/.config/eww-bar/eww.yuck index b093f62..5a8a589 100644 --- a/eww-bar/.config/eww-bar/eww.yuck +++ b/eww-bar/.config/eww-bar/eww.yuck @@ -100,9 +100,13 @@ (defpoll month :interval "1h" "date +%m") (defpoll year :interval "1h" "date +%y") -(deflisten workspaces_0_yuck "./workspaces.sh 0") -(deflisten workspaces_1_yuck "./workspaces.sh 1") -(deflisten workspaces_2_yuck "./workspaces.sh 2") +(defvar workspaces_1_yuck "") +(defvar workspaces_2_yuck "") + +; these are not needed because updates are done via update-workspaces.sh triggered from xmonad +;(deflisten workspaces_0_yuck "./workspaces.sh 0") +;(deflisten workspaces_1_yuck "./workspaces.sh 1") +;(deflisten workspaces_2_yuck "./workspaces.sh 2") (defwindow bar_1 :monitor 1 diff --git a/eww-bar/.config/eww-bar/update-workspaces.sh b/eww-bar/.config/eww-bar/update-workspaces.sh index 89b59c0..7e12e3f 100755 --- a/eww-bar/.config/eww-bar/update-workspaces.sh +++ b/eww-bar/.config/eww-bar/update-workspaces.sh @@ -1,17 +1,15 @@ #!/usr/bin/env bash -monitor="$1" - gib_workspace_names() { wmctrl -d \ | awk '{ print $1 " " $2 " " $9 }' \ | grep -v NSP \ - | grep "${monitor}_" + | grep "${1}_" } gib_workspace_yuck() { buffered="" - gib_workspace_names | while read -r id active name; do + gib_workspace_names $1 | while read -r id active name; do name="${name#*_}" if [ "$active" == '*' ]; then active_class="active" @@ -34,4 +32,8 @@ gib_workspace_yuck() { done } -echo '(box :orientation "v" :class "workspaces" :space-evenly true :halign "center" :valign "center" :vexpand true '"$(gib_workspace_yuck)"')' + +box_attrs=':orientation "v" :class "workspaces" :space-evenly true :halign "center" :valign "center" :vexpand true ' + +eww -c ~/.config/eww-bar update workspaces_1_yuck='(box '"$box_attrs"' '"$(gib_workspace_yuck 1)"')' +eww -c ~/.config/eww-bar update workspaces_2_yuck='(box '"$box_attrs"' '"$(gib_workspace_yuck 2)"')' diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index f20c6b9..288631a 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -7,6 +7,7 @@ :elkowar/antifennel-nvim {:config #(set vim.g.antifennel_executable "/home/leon/tmp/antifennel/antifennel")} :elkowar/kmonad.vim {} + :ruanyl/vim-gh-line {} :rhysd/conflict-marker.vim {} :wellle/visual-split.vim {} :sindrets/diffview.nvim {} diff --git a/xmonad/.xmonad/lib/Config.hs b/xmonad/.xmonad/lib/Config.hs index ce5b28f..3f2e230 100644 --- a/xmonad/.xmonad/lib/Config.hs +++ b/xmonad/.xmonad/lib/Config.hs @@ -402,8 +402,8 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program , ("M-M1-", sendMessage Rotate) -- Media - , ("", spawn "~/.config/eww/popup.sh 3 volume_popup && amixer sset Master 5%+") - , ("", spawn "~/.config/eww/popup.sh 3 volume_popup && amixer sset Master 5%-") + , ("", spawn "amixer sset Master 5%+") + , ("", spawn "amixer sset Master 5%-") , ("M-S-C-,", (notify "hi" (show $ map (\(a, _) -> show a) workspaceBindings)) >> (notify "ho" (show removedKeys))) , ("M-", spawn "flash_window") , ("M-g", incScreenWindowSpacing 5) diff --git a/xmonad/.xmonad/lib/Rofi.hs b/xmonad/.xmonad/lib/Rofi.hs index 029cd7e..e74d4aa 100644 --- a/xmonad/.xmonad/lib/Rofi.hs +++ b/xmonad/.xmonad/lib/Rofi.hs @@ -51,9 +51,9 @@ promptRunCommand config = XCommands.runCommandConfig (Rofi.promptSimple config) -- |prompt a single rofi mode. ex: `showNormal def "run"` showNormal :: RofiConfig -> String -> X () showNormal config mode = - spawn $ asCommand config ["-sort -modi " ++ mode, "-show " ++ mode] + spawn $ asCommand config ["-modi " ++ mode, "-show " ++ mode] -- |Show a rofi combi prompt, combining all given modes showCombi :: RofiConfig -> [String] -> X () showCombi config modi = spawn - $ asCommand config ["-sort -show combi", "-combi-modi " ++ intercalate "," modi] + $ asCommand config ["-show combi", "-combi-modi " ++ intercalate "," modi]