summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xidle.sh20
-rw-r--r--logs/auto-updater.log10
-rw-r--r--logs/wallpapertrans.log44
-rwxr-xr-xsysstat.sleep7
-rwxr-xr-xupdate.sh3
5 files changed, 76 insertions, 8 deletions
diff --git a/idle.sh b/idle.sh
index c2a5813..138764f 100755
--- a/idle.sh
+++ b/idle.sh
@@ -2,13 +2,15 @@
mutev=true # stop volume/sound(mute) - comment or un-comment
pmusic=true # stop/start music from playing - command or un-comment
+IDLETIME=1800000
+IDLEBACKTIME=100
while true; do
if [[ "$(systemctl is-system-running)" == "running" || "$(systemctl is-system-running)" == "degraded" ]]; then
- if [[ "$(xprintidle)" -gt 600000 && ! -f /var/lock/idle.lock ]]; then # Changed from 600000 (10 minutes) to 3600000 (1 hour)
- printf "User is afk in %s\n", "$(date)"
- sudo touch /var/lock/idle.lock
+ if [[ "$(xprintidle)" -gt $IDLETIME && ! -f /tmp/lock/idle.lock ]]; then # Changed from 600000 (10 minutes) to 3600000 (1 hour)
+ printf "User is idle(afk) in %s\n", "$(date)"
+ sudo /sbin/touch /tmp/lock/idle.lock
#if [ $mutev ]; then
# soundlevel=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))
# amixer set Master 0%
@@ -27,17 +29,21 @@ while true; do
if [ $pmusic ] && [ $m ]; then
NekoMC --pause &
fi
- # killall picom; bspcomp & # paused in freezeapp and unfreezeapp
+ #killall picom; bspcomp & # paused in freezeapp and unfreezeapp
+ # Disable mouse just in case accidental awake for high DPI rate mouse
+ xinput --disable 12
freezeapp &
continue
- elif [[ "$(xprintidle)" -le 100 && -f /var/lock/idle.lock ]]; then
- printf "User is back from afk in %s\n", "$(date)"
+ elif [[ "$(xprintidle)" -le $IDLEBACKTIME && -f /tmp/lock/idle.lock ]]; then
+ printf "User is back from idle(afk) in %s\n", "$(date)"
#if [ $mutev ] && [ $soundlevel ]; then
# amixer set Master $soundlevel
# unset $soundlevel
#elif [ $mutev ] && [ ! $soundlevel ]; then
# notify-send "ERROR: \$soundlevel is not set, unknown sound level..."
#fi
+ # Re-enable mouse
+ xinput --enable 12
if [ $mutev ] && [[ $(pactl get-sink-mute @DEFAULT_SINK@) == "Mute: yes" ]]; then
amixer set Master unmute
elif [ $mutev ] && [[ $(pactl get-sink-mute @DEFAULT_SINK@) == "Mute: no" ]]; then
@@ -51,7 +57,7 @@ while true; do
NekoMC --play &
unset m
fi
- sudo rm -f /var/lock/idle.lock
+ sudo /sbin/rm -f /tmp/lock/idle.lock
continue
else
sleep 1
diff --git a/logs/auto-updater.log b/logs/auto-updater.log
index e69de29..fabedea 100644
--- a/logs/auto-updater.log
+++ b/logs/auto-updater.log
@@ -0,0 +1,10 @@
+脚本启动于 2023-07-23 10:02:36+08:00 [COMMAND="/home/system/scripts/update.sh" <not executed on terminal>]
+/home/system/scripts/update.sh:行13: brew:未找到命令
+/home/system/scripts/update.sh: 第 13 行:wait: “”: 不是有效的进程号或者任务声明
+^@
+脚本完成于 2023-07-23 10:02:36+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 14:02:43+08:00 [COMMAND="/home/system/scripts/update.sh" <not executed on terminal>]
+/home/system/scripts/update.sh: 第 13 行:wait: “”: 不是有效的进程号或者任务声明
+/home/system/scripts/update.sh:行13: brew:未找到命令
+^@
+脚本完成于 2023-07-23 14:02:43+08:00 [COMMAND_EXIT_CODE="0"]
diff --git a/logs/wallpapertrans.log b/logs/wallpapertrans.log
index 4f6f172..27316de 100644
--- a/logs/wallpapertrans.log
+++ b/logs/wallpapertrans.log
@@ -10197,3 +10197,47 @@ rm: 无法删除 '/tmp/transition*': 没有那个文件或目录
0
脚本完成于 2023-07-23 09:14:03+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 09:44:03+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 09:44:05+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 10:34:08+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 10:34:11+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 10:34:51+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 10:34:55+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 11:04:55+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 11:04:59+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 11:34:59+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 11:35:02+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 12:05:02+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 12:05:06+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 12:11:00+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 12:11:09+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 12:12:52+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 12:12:57+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 12:42:58+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 12:43:01+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 12:46:48+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 12:46:52+08:00 [COMMAND_EXIT_CODE="0"]
+脚本启动于 2023-07-23 14:18:43+08:00 [COMMAND="/home/system/scripts/wallpapertrans.sh" <not executed on terminal>]
+0
+
+脚本完成于 2023-07-23 14:18:48+08:00 [COMMAND_EXIT_CODE="0"]
diff --git a/sysstat.sleep b/sysstat.sleep
new file mode 100755
index 0000000..e94c57f
--- /dev/null
+++ b/sysstat.sleep
@@ -0,0 +1,7 @@
+#!/bin/sh
+# sysstat suspend/resume hack
+# for systemd's /usr/lib/systemd/system-sleep directory
+# (C) 2020 Sebastien Godard (sysstat <at> orange.fr)
+
+# Insert a comment in current daily datafile
+/usr/lib/sa/sa1 --sleep $*
diff --git a/update.sh b/update.sh
index 51b0d5d..4ae241f 100755
--- a/update.sh
+++ b/update.sh
@@ -1,5 +1,6 @@
#!/usr/bin/bash
+# check if db.lck exist(other instant exist) and deal with it
if [ -f /var/lib/pacman/db.lck ]; then
notify-send "db.lck exist, waiting 1 min until rm -f"
sleep 60
@@ -9,5 +10,5 @@ if [ -f /var/lib/pacman/db.lck ]; then
fi
fi
-sudo npm update -g & nix-env -u & brew update & blck=$! & yay -Sl > /tmp/yaySl & yay -Ss > /tmp/yaySs & yay --noconfirm --disable-download-timeout & wait "$blck" && brew upgrade || sudo touch /var/lock/updatefail.lock # notify-send -u critical "Auto-Updater" "Update Faild!" # pipx upgrade-all
+sudo npm update -g & nix-env -u & brew update & blck=$! & yay -Sl > /tmp/yaySl & yay -Ss > /tmp/yaySs & yay --noconfirm --disable-download-timeout & wait "$blck" && brew upgrade || sudo /sbin/touch /tmp/lock/updatefail.lock # notify-send -u critical "Auto-Updater" "Update Faild!" # pipx upgrade-all
#notify-send "Auto-Updater" "Update in progress, please don't poweroff the computer" && sudo npm update -g & nix-env -u & brew update & brew upgrade & yay -Sl > /tmp/yaySl & yay -Ss > /tmp/yaySs & yay -Syu --noconfirm --disable-download-timeout && notify-send -u low "Auto-Updater" "Update Successfully!" || notify-send -u critical "Auto-Updater" "Update Faild!" # pipx upgrade-all