aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2023-09-10 11:59:43 +0200
committerdavidpkj <davidpenkow1@gmail.com>2023-09-10 11:59:43 +0200
commit5b9f5d92c4b6961049179598a235db60bed6ecbf (patch)
treecf177bf6aeb3e6341e40bfc2d96995c30abf8dd3
parentc4c1a599bdd9595560b129f40f9c4654da073b04 (diff)
Update scripts
-rwxr-xr-xscripts/.local/bin/personal/books2
-rwxr-xr-xscripts/.local/bin/personal/compile5
-rwxr-xr-xscripts/.local/bin/personal/external/helpdesk2
-rwxr-xr-xscripts/.local/bin/personal/hackpapier2
-rwxr-xr-xscripts/.local/bin/personal/powermenu3
-rwxr-xr-xscripts/.local/bin/personal/syshealth6
-rwxr-xr-xscripts/.local/bin/personal/wrapper/dmenu2
-rwxr-xr-xscripts/.local/bin/personal/wrapper/xbg2
8 files changed, 12 insertions, 12 deletions
diff --git a/scripts/.local/bin/personal/books b/scripts/.local/bin/personal/books
index d5a8290..54a437c 100755
--- a/scripts/.local/bin/personal/books
+++ b/scripts/.local/bin/personal/books
@@ -1,3 +1,3 @@
#!/bin/bash
-tabbed -c zathura /home/me/documents/books/kuriert/*.pdf -e
+tabbed -c zathura $HOME/documents/books/kuriert/*.pdf -e
diff --git a/scripts/.local/bin/personal/compile b/scripts/.local/bin/personal/compile
index 3f666c1..944891b 100755
--- a/scripts/.local/bin/personal/compile
+++ b/scripts/.local/bin/personal/compile
@@ -34,14 +34,15 @@ LP_TO_PDF() {
# Function to compile .md to .pdf files
MD_TO_PDF() {
TMP="/tmp/compilemd"
+ TEMPLATES="$HOME/documents/templates"
sed '/^!.*/d' "$1" > "$TMP" && # This enables comments with "!"
sed 's/^\\!/!/g' "$TMP" "$TMP" && # This enables escaping with "\!"
if [[ "${1#*"hackpapier"}" != "$1" ]]; then
- pandoc "$TMP" --toc --template "/home/me/documents/templates/hackpapier.latex" -o "$2.pdf"
+ pandoc "$TMP" --toc --template "$TEMPLATES/hackpapier.latex" -o "$2.pdf"
else
- pandoc "$TMP" --template "$HOME/documents/templates/abgaben.latex" -o "$2.pdf"
+ pandoc "$TMP" --template "$TEMPLATES/abgaben.latex" -o "$2.pdf"
fi
# printf "Successfully compiled %s to %s\n" "$1" "$2.pdf" ||
diff --git a/scripts/.local/bin/personal/external/helpdesk b/scripts/.local/bin/personal/external/helpdesk
index 8ab5aef..1a7f03c 100755
--- a/scripts/.local/bin/personal/external/helpdesk
+++ b/scripts/.local/bin/personal/external/helpdesk
@@ -32,7 +32,7 @@ def end():
rec.send_signal(signal.SIGINT)
cisco.send_signal(signal.SIGTERM)
subprocess.call("killall CiscoCollabHost", shell=True)
- subprocess.call("rm -rf /home/me/Downloads", shell=True)
+ subprocess.call(f"rm -rf /home/{os.getlogin()}/Downloads", shell=True)
def handler(sig, frame):
diff --git a/scripts/.local/bin/personal/hackpapier b/scripts/.local/bin/personal/hackpapier
index 1ac6e1e..ec7ceba 100755
--- a/scripts/.local/bin/personal/hackpapier
+++ b/scripts/.local/bin/personal/hackpapier
@@ -1,3 +1,3 @@
#!/bin/bash
-tabbed -c zathura /home/me/documents/zettel/hackpapier/semester2/*.pdf -e
+tabbed -c zathura $HOME/documents/zettel/hackpapier/semester2/*.pdf -e
diff --git a/scripts/.local/bin/personal/powermenu b/scripts/.local/bin/personal/powermenu
index 5d4f24a..6b56e3c 100755
--- a/scripts/.local/bin/personal/powermenu
+++ b/scripts/.local/bin/personal/powermenu
@@ -1,7 +1,6 @@
#!/bin/bash
UPTIME=$(uptime -p | sed -e 's/up //g')
-DWM_PID="$(pidof dwm)"
OPTION_CANCEL="Cancel"
OPTION_SHUTDOWN="Shutdown"
@@ -28,6 +27,6 @@ case $SELECTED in
slock
;;
$OPTION_LOGOUT)
- kill -TERM $DWM_PID
+ pkill -u $USER
;;
esac
diff --git a/scripts/.local/bin/personal/syshealth b/scripts/.local/bin/personal/syshealth
index 48dcfa4..5c7ebe5 100755
--- a/scripts/.local/bin/personal/syshealth
+++ b/scripts/.local/bin/personal/syshealth
@@ -18,12 +18,12 @@ temperature_message=("Warning:" "Core TEMPERATURE critical")
if ((${local_percent::-2} <= 15)); then
if [[ "${local_state::-1}" == "Discharging" ]]; then
- /usr/local/bin/herbe " ${battery_message[0]} ${battery_message[1]}" &
+ /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" &
# espeak "${battery_message[0]}${battery_message[1]}"
fi
elif ((${local_percent::-2} >= 90)); then
if [[ "${local_state::-1}" == "Charging" ]]; then
- /usr/local/bin/herbe " ${battery_message[0]} ${battery_message[1]}" &
+ /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" &
# espeak "${battery_message[0]}${battery_message[1]}"
fi
fi
@@ -33,7 +33,7 @@ local_temp="$(echo $sensors_report | awk '{print $4}' | sed 's/+//g')"
local_temp_high="$(echo $sensors_report | awk '{print $7}' | sed 's/+//g')"
if ((${local_temp::-4} >= 90)); then
- /usr/local/bin/herbe " ${temperature_message[0]} ${temperature_message[1]}" &
+ /usr/bin/notify-send -u critical " ${temperature_message[0]} ${temperature_message[1]}" &
# espeak "${temperature_message[0]}${temperature_message[1]}"
fi
diff --git a/scripts/.local/bin/personal/wrapper/dmenu b/scripts/.local/bin/personal/wrapper/dmenu
index 2994845..e73c2d5 100755
--- a/scripts/.local/bin/personal/wrapper/dmenu
+++ b/scripts/.local/bin/personal/wrapper/dmenu
@@ -3,7 +3,7 @@
# A wrapper for dmenu to always have it spawn with certain properties
# TODO: Get rid of this script
-source "/home/me/.cache/wal/colors.sh"
+source "$XDG_CACHE_HOME/wal/colors.sh"
/usr/local/bin/dmenu \
-fn "JetBrains Mono:size=19:pixelsize=24" \
diff --git a/scripts/.local/bin/personal/wrapper/xbg b/scripts/.local/bin/personal/wrapper/xbg
index 992980b..58b8619 100755
--- a/scripts/.local/bin/personal/wrapper/xbg
+++ b/scripts/.local/bin/personal/wrapper/xbg
@@ -1,6 +1,6 @@
#!/bin/dash
-file="$HOME/.config/wallpaper"
+file="$XDG_CONFIG_HOME/wallpaper"
cp "$1" "$file"
/usr/bin/feh --bg-scale --no-fehbg "$file"