diff --git a/OneDriveSync b/OneDriveSync index 2cd8c70..3d6d025 100644 --- a/OneDriveSync +++ b/OneDriveSync @@ -1,5 +1,8 @@ #!/bin/sh +# For syncing some files with OneDrive +# Assumes that the sync target is set up as OneDrive:Syncs in rclone + if [ $(id -u) -eq 0 ]; then exec sudo -H -u $0 "$@" fi diff --git a/bluetooth-toggle b/bluetooth-toggle index f341e05..cc8dcf3 100644 --- a/bluetooth-toggle +++ b/bluetooth-toggle @@ -1,8 +1,8 @@ +#!/bin/sh + # Toggles bluetooth on a Linux system. Make sure that you have bluetoothctl installed. # I use it with a shortcut. -#!/bin/sh - if [ $(bluetoothctl show | grep Powered | grep -c yes) -eq 1 ]; then bluetoothctl power off else diff --git a/latex-cleanup b/latex-cleanup index 896b078..59a53ec 100644 --- a/latex-cleanup +++ b/latex-cleanup @@ -1,7 +1,7 @@ -# I use it to clean up latex build files from a directory after I'm done with the project. - #!/bin/sh +# I use it to clean up latex build files from a directory after I'm done with the project. + # Depends on trash-cli for f in *.tex; do diff --git a/makebk b/makebk index 7fdd350..1ad822c 100644 --- a/makebk +++ b/makebk @@ -1,7 +1,7 @@ -# This simply makes a backup of a file as filename.bak - #!/bin/sh +# This simply makes a backup of a file as filename.bak + if [[ -n "$1" ]]; then cp "$1"{,.bak} diff --git a/start-font-fix.sh b/start-font-fix.sh index 965cf5c..fe7602a 100644 --- a/start-font-fix.sh +++ b/start-font-fix.sh @@ -1,7 +1,7 @@ +#! /bin/sh + # This was to fix an issue I was having where my terminal fonts were all over the place and tlp was autosuspending usb ports at startup. # Anyone else probably won't need it. -#! /bin/sh - source ~/.profile sudo ~/.local/bin/personal/usb-autosuspend-fix diff --git a/totrash b/totrash index dcdfc8e..36fbc79 100644 --- a/totrash +++ b/totrash @@ -1,6 +1,7 @@ -# It simply moves files to trash:/ in KDE - #!/bin/sh +# It simply moves files to trash:/ in KDE +# I mostly use trash-cli now, but hey, it works! + # Move files to trash:/ kioclient5 move "$@" trash:/ diff --git a/touch2 b/touch2 index 02d8202..fb57485 100644 --- a/touch2 +++ b/touch2 @@ -1,5 +1,6 @@ +#!/bin/sh + # It makes the parent folders (if needed) while touch-ing. -#!/bin/sh mkdir -p "$(dirname "$1")" && touch "$1" diff --git a/turbo-boost b/turbo-boost index ed53a33..7d8c1c6 100644 --- a/turbo-boost +++ b/turbo-boost @@ -1,7 +1,7 @@ -# This is to toggle intel turbo boost. - #!/bin/sh +# This is to toggle intel turbo boost. + if [[ -z $(which rdmsr) ]]; then echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2 exit 1 diff --git a/turbo-boost-startup b/turbo-boost-startup index 93295f2..986e921 100644 --- a/turbo-boost-startup +++ b/turbo-boost-startup @@ -1,6 +1,6 @@ +#!/bin/sh + # This simply triggers the turbo-boost script at startup. # I use it as a startup script. -#!/bin/sh - ~/.local/bin/turbo-boost disable diff --git a/usb-autosuspend-fix b/usb-autosuspend-fix index 5501fa2..7d28b95 100644 --- a/usb-autosuspend-fix +++ b/usb-autosuspend-fix @@ -1,7 +1,7 @@ -# This was to fix an issue where tlp was autosuspending usb ports at startup. - #!/bin/sh +# This was to fix an issue where tlp was autosuspending usb ports at startup. + echo 'on' > '/sys/bus/usb/devices/1-1/power/control' echo 'on' > '/sys/bus/usb/devices/1-2/power/control' echo 'on' > '/sys/bus/usb/devices/1-3/power/control' diff --git a/wifi-toggle b/wifi-toggle index c888ec3..fb79d5b 100644 --- a/wifi-toggle +++ b/wifi-toggle @@ -1,8 +1,8 @@ +#!/bin/sh + # Toggles WiFi on a Linux system. Make sure that you have nmcli installed. # I use it with a shortcut. -#!/bin/sh - if [ $(nmcli r wifi | grep -c enabled) -eq 1 ]; then nmcli r wifi off else