polybar audio and power buttons

also switched from systemd because it breaks rofi
This commit is contained in:
Noah Masur 2023-04-02 16:53:01 -04:00
parent 8283480fd1
commit 985b8bf13b
2 changed files with 17 additions and 3 deletions

View File

@ -36,7 +36,7 @@
module-margin = 1;
modules-left = "i3";
modules-center = "xwindow";
modules-right = "pulseaudio date";
modules-right = "pulseaudio date power";
cursor-click = "pointer";
cursor-scroll = "ns-resize";
enable-ipc = true;
@ -115,6 +115,7 @@
ramp-volume-0 = "";
ramp-volume-1 = "";
ramp-volume-2 = "";
click-right = config.audioSwitchCommand;
};
# "module/xkeyboard" = {
# type = "internal/xkeyboard";
@ -166,6 +167,12 @@
label-foreground = config.theme.colors.base0A;
# format-background = colors.background;
};
"module/power" = {
type = "custom/text";
content = " ";
click-left = config.powerCommand;
content-foreground = config.theme.colors.base04;
};
"settings" = {
screenchange-reload = true;
pseudo-transparency = false;
@ -174,7 +181,7 @@
};
xsession.windowManager.i3.config.startup = [{
command = "systemctl --user restart polybar";
command = "pkill polybar; polybar -r main";
always = true;
notification = false;
}];

View File

@ -5,7 +5,14 @@
sink=$(
ponymix -t sink list |
awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' |
rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100 -theme-str 'inputbar { enabled: false; }' |
rofi \
-dmenu \
-p 'pulseaudio sink:' \
-width 100 \
-hover-select \
-me-select-entry '' \
-me-accept-entry MousePrimary \
-theme-str 'inputbar { enabled: false; }' |
grep -Po '[0-9]+(?=:)'
) &&
ponymix set-default -d "$sink" &&