commit
e089bf7d6a
6 changed files with 96 additions and 0 deletions
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
function backup { |
||||
case "${1^^}" in |
||||
"WORK") |
||||
CONFIG_FILE="$HOME/.config/rsync/work.conf" |
||||
DEST="/run/media/carlos/Transposon/TempStoragei" |
||||
PROFILE="work" |
||||
;; |
||||
"HOME") |
||||
CONFIG_FILE="$HOME/.config/rsync/home.conf" |
||||
DEST="/run/media/carlos/Elements/Work/College" |
||||
PROFILE="home" |
||||
;; |
||||
*) |
||||
printf "%s\n" "The profile doesn't exist. Available profiles are: \`home', and \`work'." |
||||
;; |
||||
esac |
||||
|
||||
if [ -n $PROFILE ]; then |
||||
# RSYNC options |
||||
RSYNC_ARGS="--recursive --links --perms --executability --times --group --owner --human-readable --info=progress2" |
||||
|
||||
# Do backup. |
||||
printf "Initialising \e[1m\`${PROFILE}'\e[0m backup...\n\r" |
||||
|
||||
/usr/bin/rsync $RSYNC_ARGS $(cat $CONFIG_FILE) $DEST --delete-after |
||||
|
||||
printf "\nBackup complete.\n" |
||||
return 0 |
||||
fi |
||||
} |
||||
|
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
# man pages colour code |
||||
export LESS_TERMCAP_mb=$'\e[0;33m' |
||||
export LESS_TERMCAP_md=$'\e[0;35m' |
||||
export LESS_TERMCAP_me=$'\e[0m' |
||||
export LESS_TERMCAP_se=$'\e[0m' |
||||
export LESS_TERMCAP_so=$'\e[0;34;32m' |
||||
export LESS_TERMCAP_ue=$'\e[0m' |
||||
export LESS_TERMCAP_us=$'\e[0;36m' |
||||
|
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
function nvidia { |
||||
case "${1^^}" in |
||||
"OFF") |
||||
pkexec tee /proc/acpi/bbswitch <<< OFF |
||||
;; |
||||
"ON") |
||||
pkexec tee /proc/acpi/bbswitch <<< ON |
||||
;; |
||||
*) |
||||
printf "\nTo enable or disable your discrete GPU, use ON or OFF." |
||||
;; |
||||
esac |
||||
} |
||||
|
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
function hyperthreading { |
||||
case "${1^^}" in |
||||
"OFF") |
||||
pkexec tee /sys/devices/system/cpu/smt/control <<< off |
||||
# Update Julia settings |
||||
if [ -v $JULIA_NUM_THREADS ]; then |
||||
JULIA_NUM_THREADS=$(nproc) |
||||
else |
||||
exit 0; |
||||
fi |
||||
;; |
||||
"ON") |
||||
pkexec tee /sys/devices/system/cpu/smt/control <<< on |
||||
# Update Julia settings |
||||
if [ -v $JULIA_NUM_THREADS ]; then |
||||
JULIA_NUM_THREADS=$(nproc); |
||||
else |
||||
exit 0 |
||||
fi |
||||
;; |
||||
*) |
||||
printf "\nTo enable or disable hyperthreading dinamically, use ON or OFF." |
||||
;; |
||||
esac |
||||
} |
||||
|
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
function wifi { |
||||
case "${1^^}" in |
||||
"OFF") |
||||
printf "Disabling wireless interface...\n" |
||||
/usr/bin/rfkill block 0 |
||||
;; |
||||
"ON") |
||||
printf "Enabling wireless interface...\n" |
||||
/usr/bin/rfkill unblock 0 |
||||
;; |
||||
*) |
||||
printf "\nOption not recognised. Try using \`on' or \`off'.\n" |
||||
;; |
||||
esac |
||||
} |
||||
|
Loading…
Reference in new issue