Add refresh-awesomewm-menubar

This commit is contained in:
nazrin 2025-06-15 16:06:30 +00:00
parent 62da89680a
commit 7c22185c95
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/bin/bash
uid="$(find /run/user/ -maxdepth 1 -mindepth 1 -type d | awk -F/ '{print $NF}')"
user="$(grep $uid /etc/passwd | sed 's/:.*//')"
display="$(DISPLAY=$(echo "$DISPLAY"))"
xdg_rd="$(XDG_RUNTIME_DIR=/run/user/$uid)"
xauth="$(XAUTHORITY=/home/$user/.Xauthority)"
dbus_sba="$(DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus)"
export XAUTHORITY=/home/$user/.Xauthority
export DISPLAY=$(echo "$DISPLAY")
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus"
su $user -c "$display $xauth $dbus_sba $xdg_rd awesome-client 'require(\"menubar\").refresh()'"

View file

@ -0,0 +1,11 @@
[Trigger]
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Refreshing awesomeWM menubar...
Exec = /etc/pacman.d/hooks.bin/refresh-awesomewm-menubar.sh
When = PostTransaction
Depends = awesome