1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 20:58:37 -06:00

Cleanup and commentary

This commit is contained in:
Sayantan Santra 2022-01-02 22:35:07 -06:00
parent 462f0522a4
commit 6a2a8a8e62
11 changed files with 24 additions and 19 deletions

View file

@ -1,5 +1,8 @@
#!/bin/sh #!/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 if [ $(id -u) -eq 0 ]; then
exec sudo -H -u <user> $0 "$@" exec sudo -H -u <user> $0 "$@"
fi fi

View file

@ -1,8 +1,8 @@
#!/bin/sh
# Toggles bluetooth on a Linux system. Make sure that you have bluetoothctl installed. # Toggles bluetooth on a Linux system. Make sure that you have bluetoothctl installed.
# I use it with a shortcut. # I use it with a shortcut.
#!/bin/sh
if [ $(bluetoothctl show | grep Powered | grep -c yes) -eq 1 ]; then if [ $(bluetoothctl show | grep Powered | grep -c yes) -eq 1 ]; then
bluetoothctl power off bluetoothctl power off
else else

View file

@ -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 #!/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 # Depends on trash-cli
for f in *.tex; do for f in *.tex; do

4
makebk
View file

@ -1,7 +1,7 @@
# This simply makes a backup of a file as filename.bak
#!/bin/sh #!/bin/sh
# This simply makes a backup of a file as filename.bak
if [[ -n "$1" ]]; if [[ -n "$1" ]];
then then
cp "$1"{,.bak} cp "$1"{,.bak}

View file

@ -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. # 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. # Anyone else probably won't need it.
#! /bin/sh
source ~/.profile source ~/.profile
sudo ~/.local/bin/personal/usb-autosuspend-fix sudo ~/.local/bin/personal/usb-autosuspend-fix

View file

@ -1,6 +1,7 @@
# It simply moves files to trash:/ in KDE
#!/bin/sh #!/bin/sh
# It simply moves files to trash:/ in KDE
# I mostly use trash-cli now, but hey, it works!
# Move files to trash:/ # Move files to trash:/
kioclient5 move "$@" trash:/ kioclient5 move "$@" trash:/

3
touch2
View file

@ -1,5 +1,6 @@
#!/bin/sh
# It makes the parent folders (if needed) while touch-ing. # It makes the parent folders (if needed) while touch-ing.
#!/bin/sh
mkdir -p "$(dirname "$1")" && mkdir -p "$(dirname "$1")" &&
touch "$1" touch "$1"

View file

@ -1,7 +1,7 @@
# This is to toggle intel turbo boost.
#!/bin/sh #!/bin/sh
# This is to toggle intel turbo boost.
if [[ -z $(which rdmsr) ]]; then if [[ -z $(which rdmsr) ]]; then
echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2 echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2
exit 1 exit 1

View file

@ -1,6 +1,6 @@
#!/bin/sh
# This simply triggers the turbo-boost script at startup. # This simply triggers the turbo-boost script at startup.
# I use it as a startup script. # I use it as a startup script.
#!/bin/sh
~/.local/bin/turbo-boost disable ~/.local/bin/turbo-boost disable

View file

@ -1,7 +1,7 @@
# This was to fix an issue where tlp was autosuspending usb ports at startup.
#!/bin/sh #!/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-1/power/control'
echo 'on' > '/sys/bus/usb/devices/1-2/power/control' echo 'on' > '/sys/bus/usb/devices/1-2/power/control'
echo 'on' > '/sys/bus/usb/devices/1-3/power/control' echo 'on' > '/sys/bus/usb/devices/1-3/power/control'

View file

@ -1,8 +1,8 @@
#!/bin/sh
# Toggles WiFi on a Linux system. Make sure that you have nmcli installed. # Toggles WiFi on a Linux system. Make sure that you have nmcli installed.
# I use it with a shortcut. # I use it with a shortcut.
#!/bin/sh
if [ $(nmcli r wifi | grep -c enabled) -eq 1 ]; then if [ $(nmcli r wifi | grep -c enabled) -eq 1 ]; then
nmcli r wifi off nmcli r wifi off
else else