@@ -0,0 +1,3 @@ | |||||
#!/bin/sh | |||||
st -e nnn |
@@ -0,0 +1,3 @@ | |||||
#!/bin/sh | |||||
@@ -0,0 +1,34 @@ | |||||
#!/bin/sh | |||||
speaker_muted=🔇 | |||||
speaker_low=🔈 | |||||
speaker_medium=🔉 | |||||
speaker_high=🔊 | |||||
brightness_symbol=🔅 | |||||
# Statusbar loop | |||||
while true; do | |||||
bat_state=$(acpi | awk 'NR==1{print $3}') | |||||
if [ $bat_state == 'Charging,' ]; then | |||||
bat_state='🠝' | |||||
else | |||||
bat_state='🠟' | |||||
fi | |||||
volume=$(amixer sget Master | awk -F"[][]" 'END{ print $2 }') | |||||
volume_amount=$(printf $volume | tr -d %) | |||||
if [ $volume_amount == 0 ]; then | |||||
volume_symbol=$speaker_muted | |||||
elif [ $volume_amount -lt 30 ]; then | |||||
volume_symbol=$speaker_low | |||||
elif [ $volume_amount -lt 70 ]; then | |||||
volume_symbol=$speaker_medium | |||||
else | |||||
volume_symbol=$speaker_high | |||||
fi | |||||
bat_percentage=$(acpi | awk 'NR==1{print $4}' | tr -d [,]) | |||||
brightness=$(xbacklight -get | grep -o '^..') | |||||
xsetroot -name "$brightness_symbol$brightness% | $volume_symbol$volume | 🔋$bat_state$bat_percentage | $(date +"%c")" | |||||
sleep 1m # Update time every minute | |||||
done |
@@ -0,0 +1,22 @@ | |||||
#!/bin/sh | |||||
setxkbmap -option caps:swapescape | |||||
picom -b | |||||
~/.fehbg | |||||
# relaunch DWM if the binary changes, otherwise bail | |||||
csum=$(sha1sum $(which dwm.winkey)) | |||||
new_csum="" | |||||
while true | |||||
do | |||||
if [ "$csum" != "$new_csum" ] | |||||
then | |||||
csum=$new_csum | |||||
dwm-statusbar & | |||||
xbindkeys -f "$XDG_CONFIG_HOME"/xbindkeys/config | |||||
dwm.winkey | |||||
else | |||||
exit 0 | |||||
fi | |||||
new_csum=$(sha1sum $(which dwm.winkey)) | |||||
sleep 0.5 | |||||
done |
@@ -5,6 +5,6 @@ if ! { [ "$TERM" = "tmux-256color" ] && [ -n "$TMUX" ]; } then | |||||
st -e vim "$*" | st -e vim "$*" | ||||
else | else | ||||
# tmux session running | # tmux session running | ||||
tmux split-window -h "vim \"$*\"" | |||||
tmux -u split-window "vim \"$*\"" | |||||
fi | fi | ||||
@@ -0,0 +1,24 @@ | |||||
REMOTE_USER="immanuel" | |||||
REMOTE_DIRECTORY="/home/immanuel/Dropoff/" | |||||
LOCAL_DIR=$HOME/Dropoff | |||||
pull () { | |||||
rsync -aP "$REMOTE_USER@$1:$REMOTE_DIRECTORY " "$LOCAL_DIR" | |||||
} | |||||
push () { | |||||
rsync -a "$LOCAL_DIR" "ssh://$REMOTE_USER@$1:$REMOTE_DIRECTORY" | |||||
} | |||||
while getopts a:u: option | |||||
do | |||||
case "${option}" in | |||||
a) destination=$OPTARG | |||||
echo $destination | |||||
pull $destination;; | |||||
u) destination=$OPTARG | |||||
push $destination;; | |||||
esac | |||||
done | |||||
@@ -1,78 +0,0 @@ | |||||
#!/bin/sh | |||||
gitcmd() { | |||||
#First arg should be the name of the subdirectory, second arg should be command | |||||
check_args $# 2 | |||||
if [ ! -d "$BACKUPS_PATH/$1" ]; then | |||||
invalid_path_msg "$1" | |||||
return 1; | |||||
fi | |||||
git -C $BACKUPS_PATH/$1 $2 | |||||
printf "The command succeded\n" | |||||
} | |||||
bdiff() { | |||||
check_args $# 2 | |||||
if [ ! -d "$BACKUPS_PATH/$1" ]; then | |||||
invalid_path_msg "$1" | |||||
return 1; | |||||
fi | |||||
case "$1" in | |||||
configs) vimdiff "$BACKUPS_PATH/$1/$2" "$XDG_CONFIG_HOME/$2";; | |||||
macros) vimdiff "$BACKUPS_PATH/$1/$2" "$HOME/Macros/$2";; | |||||
*) invalid_path_msg "$1"; return 1;; | |||||
esac | |||||
} | |||||
overwrite_local() { | |||||
if [ ! -e $BACKUPS_PATH/$1/$2 ]; then | |||||
printf "The backup path $BACKUPS_PATH/$1/$2 does not exist\n" | |||||
return 1; | |||||
fi | |||||
case "$1" in | |||||
configs) cp -r "$BACKUPS_PATH/$1/$2" "$XDG_CONFIG_HOME/";; | |||||
macros) cp -r "$BACKUPS_PATH/$1/$2" "$HOME/Macros/";; | |||||
*) invalid_path_msg "$1"; return 1;; | |||||
esac | |||||
printf "local overwrite successful\n" | |||||
} | |||||
overwrite_backup() { | |||||
if [ git diff --stat $BACKUPS_PATH/$1 ]; then | |||||
printf "There are uncommited changes in $1\n" | |||||
return 1 | |||||
fi | |||||
case "$1" in | |||||
configs) cp -r "$XDG_CONFIG_HOME/$2" "$BACKUPS_PATH/$1/$2";; | |||||
macros) cp -r "$HOME/Macros/$2" "$BACKUPS_PATH/$1/$2";; | |||||
*) invalid_path_msg "$1"; return 1;; | |||||
esac | |||||
printf "backup overwrite successful\n" | |||||
} | |||||
invalid_path_msg() { | |||||
printf "That path is invalid. $@\n" | |||||
} | |||||
check_args() { | |||||
if [ $1 -ne $2 ]; then | |||||
printf "Invalid number of arguments. Expected $2\n" | |||||
exit; | |||||
fi | |||||
return 0; | |||||
} | |||||
case "$1" in | |||||
pull-backup) | |||||
case "$2" in | |||||
configs) pull_backup configs;; | |||||
macros) pull_backup macros;; | |||||
esac | |||||
;; | |||||
overwrite-local) overwrite_local $2 $3;; | |||||
overwrite-backup) overwrite_backup $2 $3;; | |||||
gitcmd) gitcmd "$2" "$3";; | |||||
push-backup) overwrite_backup $2 $3;; | |||||
bdiff) bdiff $2 "$3";; | |||||
*) printf "No such option\n";; | |||||
esac |
@@ -0,0 +1,2 @@ | |||||
#!/bin/sh | |||||