Compare commits

...

7 Commits

Author SHA1 Message Date
b1a3e5d72e monero-client: remove mining option.
I don't really have a reason to use this anymore.
2024-12-31 11:09:58 +01:00
1a618bb0c1 Add double-quotes to avoid string splitting. 2024-12-31 11:09:36 +01:00
45375ccf9a monero-client: Fix formatting 2024-12-31 11:09:04 +01:00
81af13a1ae Add bash strict options. 2024-12-31 11:03:56 +01:00
46376f9242 setbg: simplify conditional statements. 2024-12-31 11:02:43 +01:00
58fdbe307f audio-control: add bash strict options. 2024-12-31 10:59:48 +01:00
094430c1f7 audio-control: remove commands to update status files.
These were only necessary when I held files for status updates in DWM.
2024-12-31 10:58:59 +01:00
10 changed files with 47 additions and 24 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
if [ "$#" -eq 0 ] if [ "$#" -eq 0 ]
then then
echo "Requires a command. Run with 'help' for a list of commands." echo "Requires a command. Run with 'help' for a list of commands."
@ -14,19 +16,15 @@ fi
case $1 in case $1 in
"mute") "mute")
pactl set-sink-mute 0 toggle pactl set-sink-mute 0 toggle
pactl list sinks | awk '/Mute/ { if ($2 == "no") print "VOL"; else print "MUT"; }'
;; ;;
"vol-up") "vol-up")
pactl set-sink-volume 0 +5% pactl set-sink-volume 0 +5%
pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
;; ;;
"vol-down") "vol-down")
pactl set-sink-volume 0 -5% pactl set-sink-volume 0 -5%
pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
;; ;;
"reset") "reset")
pactl set-sink-volume 0 50% pactl set-sink-volume 0 50%
pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
;; ;;
"help") "help")
echo "USAGE: audio-control <command> echo "USAGE: audio-control <command>
@ -37,7 +35,8 @@ Commands:
vol-down lower the volume vol-down lower the volume
reset reset volume (to round number) reset reset volume (to round number)
toggle-port toggle the output port toggle-port toggle the output port
help show this help information";; help show this help information"
;;
*) *)
echo "Invalid command. Run with 'help' for a list of commands." echo "Invalid command. Run with 'help' for a list of commands."
exit 1;; exit 1;;

3
backup
View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
rsync -aAXv --delete "$1" --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/media/music/*"} "$2" rsync -aAXv --delete "$1" --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/media/music/*"} "$2"

View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
sync && echo 1 > /proc/sys/vm/drop_caches sync && echo 1 > /proc/sys/vm/drop_caches

View File

@ -1,2 +1,5 @@
#!/bin/sh #!/bin/bash
install -m 755 $1 $HOME/.local/bin
set -euo pipefail
install -m 755 "$1" "$HOME/.local/bin"

View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
curl ipinfo.io/$1
set -euo pipefail
curl "ipinfo.io/$1"

View File

@ -1,22 +1,27 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
[ "$#" -eq 0 ] && [ "$#" -eq 0 ] &&
echo "Requires a command. Run with 'help' for a list of commands." && echo "Requires a command. Run with 'help' for a list of commands." &&
exit 1 exit 1
case $1 in case $1 in
"wallet") "wallet")
monero-wallet-cli --daemon-address node.monero.net:13666;; monero-wallet-cli --daemon-address node.monero.net:13666
;;
"address") "address")
echo "42espNaUqPdJK4vTir4NDfH4gT6brFR4F5KPRADrg5t98LkzHnQfFnUDZZEetp3Zw5K8V4v364tN3TMxfg4eXEN9RpnrNBG";; echo "42espNaUqPdJK4vTir4NDfH4gT6brFR4F5KPRADrg5t98LkzHnQfFnUDZZEetp3Zw5K8V4v364tN3TMxfg4eXEN9RpnrNBG"
"mine") ;;
xmr-stak-cpu $XDG_CONFIG_HOME/xmr-stak/cpu-config.txt;;
"help") "help")
echo "USAGE: monero-client [command] echo "USAGE: monero-client [command]
Commands: Commands:
address print out the monero public address address print out the monero public address
mine start the miner mine start the miner
wallet open the monero wallet wallet open the monero wallet
help show this help information";; help show this help information"
;;
*) *)
echo "Invalid command '$1'. Please run with the 'help' option.";; echo "Invalid command '$1'. Please run with the 'help' option."
;;
esac esac

12
setbg
View File

@ -1,12 +1,14 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
if [ $# -gt 1 ] if [ $# -gt 1 ]
then then
echo "Too many arguments" echo "Too many arguments"
exit 1 exit 1
elif [ $# -eq 1 ]
then
cp "$1" "$HOME/.local/share/wallpaper.jpg"
fi fi
[ $# -eq 1 ] && xwallpaper --zoom "$HOME/.local/share/wallpaper.jpg"
cp $1 $HOME/.local/share/wallpaper.jpg
xwallpaper --zoom $HOME/.local/share/wallpaper.jpg

View File

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
# TODO: # TODO:
# - Add options for port # - Add options for port
@ -6,4 +8,4 @@
PORT=12800 PORT=12800
ssh -N -D $PORT nortega@themusicinnoise.net ssh -N -D "$PORT" nortega@themusicinnoise.net

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -eu set -euo pipefail
CAMERA_DEVICE="" CAMERA_DEVICE=""
MOUNT_DIR="/tmp/camera-mount" MOUNT_DIR="/tmp/camera-mount"

View File

@ -1,2 +1,5 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
curl "http://wttr.in/$1?m" curl "http://wttr.in/$1?m"