From f6d0847c39a6b84b016b8717208fd279afd53c38 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 5 Oct 2024 12:10:18 +0200 Subject: [PATCH] WIP --- home/programs/xmonad/xmonad.hs | 4 ++- home/services/polybar.nix | 47 ++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/home/programs/xmonad/xmonad.hs b/home/programs/xmonad/xmonad.hs index 7bab33c..12a44f2 100644 --- a/home/programs/xmonad/xmonad.hs +++ b/home/programs/xmonad/xmonad.hs @@ -86,6 +86,7 @@ myScratchpads = [ NS "ncmpcpp" spawnNC findNC layoutA where spawnNC = myTerminal ++ " --title ncmpcppScratchpad -e ncmpcpp" spawnTM = myTerminal ++ " --class floatingTerminal -e tmux new-session -A -s f" + spawnTW = myTerminal ++ " --class taskWarriorTerminal -e taskwarrior-tui" -- spawnMX = "element" spawnFB = "thunar --class=floatingThunar" spawnEX = "emacs --name=floatingEmacs" @@ -94,6 +95,7 @@ myScratchpads = [ NS "ncmpcpp" spawnNC findNC layoutA findNC = title =? "ncmpcppScratchpad" findTM = className =? "floatingTerminal" + findTW = className =? "taskWarriorTerminal" findSC = className =? "floatingSchedule" -- findMX = className =? "element" findFB = className =? "floatingThunar" @@ -168,7 +170,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ , ((modm .|. shiftMask , xK_space ), spawn $ myTerminal ++ " -e tmux") -- , ((modm , xK_v ), spawn "rofi -modi lpass:$HOME/.scripts/rofi/lpass//rofi-lpass -show lpass") - , ((modm .|. shiftMask, xK_d ), viewDropboxStatus) + -- , ((modm .|. shiftMask, xK_d ), viewDropboxStatus) ] termIsOpen :: X Bool diff --git a/home/services/polybar.nix b/home/services/polybar.nix index 4fa7ae7..e0544c6 100644 --- a/home/services/polybar.nix +++ b/home/services/polybar.nix @@ -1,4 +1,4 @@ -{ pkgs, config, machineVars, ... }: let +{ pkgs, lib, config, machineVars, ... }: let colors = config.colors.defaultColorSet; in { services.polybar = { @@ -11,13 +11,23 @@ in { package = pkgs.polybar.override { githubSupport = true; mpdSupport = true; + pulseSupport = true; }; settings = { + "module/tray" = { + type = "internal/tray"; + + # padding = 4; + tray-spacing = "8px"; + tray-maxsize = "25px"; + # tray-background = colors.background; + }; + "bar/top" = { bottom = false; # monitor = - tray.position = "right"; + # tray.position = "right"; background = colors.background; foreground = colors.foreground; @@ -41,19 +51,20 @@ in { left = "xmonad"; center = "date"; right = builtins.concatStringsSep " " [ - "filesystem " - (if machineVars.wlanInterface != null then "wlan " else "") - (if machineVars.battery != null then "batt " else "") - "vol" + "filesystem" + (lib.optionalString (machineVars.wlanInterface != null) "wlan") + (lib.optionalString (machineVars.battery != null) "batt") + "pulseaudio" "mpd" + "tray" ]; }; - tray = { - padding = 4; - maxsize = 25; - background = colors.background; - }; + # tray = { + # padding = 4; + # maxsize = 25; + # background = colors.background; + # }; }; "module/xmonad" = { @@ -155,15 +166,15 @@ in { }; }; - "module/vol" = { - type = "internal/alsa"; + "module/pulseaudio" = { + type = "internal/pulseaudio"; # format-volume = "}" # format-volume = "%{A1:bash -c '~/.scripts/get-volume' &:}%{A}" # format-volume = # format-volume-padding = 1 # format-muted-padding = 1 - format-volume = "%{T3}%{T-} "; + format-volume = " "; # label-volume =  label-volume-foreground = colors.magenta; # format-muted-foreground = "${colors.foreground-alt}"; @@ -273,9 +284,11 @@ in { # Default: false fixed-values = true; - # Spacing (number of spaces, pixels, points) between entries - # Default: 2 - spacing = 4; + # Margin (number of spaces, pixels, or points) to add before/after each module + # Individual side values can be defined using: + # module-margin-{left,right} + module-margin = "16px"; + # spacing = "16px"; # Default: 90 # New in version 3.6.0