chore(default-flatpaks): No need to query DISPLAY variable for notify-send

Notifications work without it & custom images without XWayland don't have `DISPLAY` variable at all (eg. secureblue & custom images based on it)
This commit is contained in:
fiftydinar 2024-10-23 11:42:06 +02:00 committed by GitHub
parent 7d08c2e39f
commit 89ea220f5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,32 +157,28 @@ function notify-send-pre-install {
user_name=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .user')
uid=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .uid')
xdg_runtime_path="/run/user/$uid"
display_var=$(printenv DISPLAY)
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus DISPLAY="$display_var" notify-send "Flatpak Installer" "Started install of system flatpaks" --app-name="Flatpak Installer" -u NORMAL
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus notify-send "Flatpak Installer" "Started install of system flatpaks" --app-name="Flatpak Installer" -u NORMAL
}
function notify-send-install {
user_name=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .user')
uid=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .uid')
xdg_runtime_path="/run/user/$uid"
display_var=$(printenv DISPLAY)
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus DISPLAY="$display_var" notify-send "Flatpak Installer" "Finished install of system flatpaks:\n$INSTALL_LIST" --app-name="Flatpak Installer" -u NORMAL
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus notify-send "Flatpak Installer" "Finished install of system flatpaks:\n$INSTALL_LIST" --app-name="Flatpak Installer" -u NORMAL
}
function notify-send-pre-uninstall {
user_name=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .user')
uid=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .uid')
xdg_runtime_path="/run/user/$uid"
display_var=$(printenv DISPLAY)
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus DISPLAY="$display_var" notify-send "Flatpak Installer" "Started uninstall of some system flatpaks" --app-name="Flatpak Installer" -u NORMAL
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus notify-send "Flatpak Installer" "Started uninstall of some system flatpaks" --app-name="Flatpak Installer" -u NORMAL
}
function notify-send-uninstall {
user_name=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .user')
uid=$(loginctl list-users --output=json | jq -r '.[] | select(.state == "active") | .uid')
xdg_runtime_path="/run/user/$uid"
display_var=$(printenv DISPLAY)
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus DISPLAY="$display_var" notify-send "Flatpak Installer" "Finished uninstall of system flatpaks:\n$REMOVE_LIST" --app-name="Flatpak Installer" -u NORMAL
sudo -u "$user_name" DBUS_SESSION_BUS_ADDRESS=unix:path="$xdg_runtime_path"/bus notify-send "Flatpak Installer" "Finished uninstall of system flatpaks:\n$REMOVE_LIST" --app-name="Flatpak Installer" -u NORMAL
}
# Install flatpaks in list