From 18e04de4c5e3bcbd125486a2d6be26483fb62de9 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Fri, 21 Oct 2022 21:41:44 +0200 Subject: [PATCH] Add on-click action for usbctl using polkit --- sway/.config/sway/config.d/10_autoexec | 1 + waybar/.config/waybar/config | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sway/.config/sway/config.d/10_autoexec b/sway/.config/sway/config.d/10_autoexec index 8c67dd5..2739bd6 100644 --- a/sway/.config/sway/config.d/10_autoexec +++ b/sway/.config/sway/config.d/10_autoexec @@ -5,6 +5,7 @@ exec mako exec pipewire exec pipewire-pulse exec wireplumber +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Make xdg-desktop-portal-wlr work properly exec dbus-update-activation-environment WAYLAND_DISPLAY diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index e22e083..f1946d6 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -7,7 +7,7 @@ "modules-center": ["clock"], "modules-right": ["network", "pulseaudio", "backlight", "cpu", "memory", "battery", "tray"], "sway/workspaces": { - "disable-scroll": true, + "disable-scroll": true }, "sway/window": { "max-length": 64 @@ -83,8 +83,9 @@ }, "custom/usb": { "format": "{} USB", - "exec": "$HOME/.config/waybar/usb-status.sh", + "exec": "${XDG_CONFIG_HOME:-$HOME/.config}/waybar/usb-status.sh", "return-type": "json", - "interval": 1 + "interval": 1, + "on-click": "pkexec --disable-internal-agent usbctl temporary" } }