waybar: use idle_inhibitor instead of custom module

This commit is contained in:
2025-08-10 21:07:05 +02:00
parent f1d5c8aba6
commit a37c93245c
11 changed files with 28 additions and 223 deletions

View File

@@ -1,21 +1,23 @@
#!/bin/sh
if [ "$(id -u)" -eq 0 ]; then
exit 1
exit 0
fi
if [ -n "$SUDO_USER" ]; then
exit 1
exit 0
fi
if [ "$LOGNAME" != "$USER" ]; then
exit 1
exit 0
fi
ppid=$(ps -o ppid= -p $$ 2>/dev/null)
if [ -n "$ppid" ]; then
parent_comm=$(ps -o comm= -p "$ppid" 2>/dev/null)
if [ "$parent_comm" = "su" ]; then
exit 1
exit 0
fi
fi
exit 1

View File

@@ -2,7 +2,7 @@
path="$(dirname "$(realpath "$0")")"
"$path/issu.sh" || {
"$path/issu.sh" && {
echo "Do not run this script in sudo mode."
exit 1
}

View File

@@ -1,10 +1,4 @@
#!/bin/env bash
###
# @Author: Uyanide pywang0608@foxmail.com
# @Date: 2025-07-27 22:37:59
# @LastEditTime: 2025-08-03 00:34:03
# @Description: Toggle Waybar and close the lyrics widget if open
###
function close() {
killall -q waybar

View File

@@ -2,7 +2,7 @@
path="$(dirname "$(realpath "$0")")"
"$path/issu.sh" || {
"$path/issu.sh" && {
echo "Do not run this script in sudo mode."
exit 1
}
@@ -21,6 +21,12 @@ sudo chown "$username:$username" "$mount_point"
export LIBGUESTFS_BACKEND=direct
# replay log
# qemu-img check -r all "$VHDX_PATH" || {
# echo "Failed to check VHDX file."
# exit 1
# }
guestmount --add "$vhdx_path" --inspector --ro "$mount_point" || {
echo "Failed to mount VHDX file."
exit 1