update 030924

This commit is contained in:
2024-09-03 22:51:59 +02:00
parent 19b339a8ed
commit dd39998abc
12 changed files with 92 additions and 31 deletions

13
System/checkOzoneKeyboard.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
ozoneId=$(xinput list | grep "Ozone Tactical")
if [[ -n $ozoneId ]]; then
xmodmap -e "keycode 49 = Escape NoSymbol Escape"
xmodmap -e "keycode 9 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 66 = Escape NoSymbol Escape"
xmodmap -e "clear lock"
else
xmodmap -e "keycode 49 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 9 = Escape NoSymbol Escape"
fi

31
System/initialSinc.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
if [[ $# != 1 ]]; then
echo "push or pull"
exit 1
fi
localAccess=$(ping -c 1 192.168.1.144)
if [[ $? -eq 0 ]]; then
url="dqnid@192.168.1.144"
else
vpnAccess=$(ip addr show | grep tun0) # 1 for error, 0 for success
if [[ $? -eq 0 ]]; then
url="dqnid@10.8.0.10"
else
notify-send "Net error" "Connect to the VPN to access your data"
exit 1
fi
fi
if [[ $1 == "push" ]]; then
origin="/home/danih/"
dest="$url:/home/dqnid/"
else
dest="/home/danih/"
origin="$url:/home/dqnid/"
today=$(date "+%H%M%S%d%m%y")
tar -czf "/home/danih/Documents/Anotaciones/backups/anotaciones_$today.tar" "/home/danih/Documents/Anotaciones" # NOTE: wrong, full path instead of just Anotaciones
fi
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/Documents/Anotaciones/ $dest/Documents/Anotaciones/

View File

@@ -1,2 +0,0 @@
#!/bin/bash
sudo sshfs -o allow_other,default_permissions -o ssh_command="ssh -i ~/.ssh/id_local" dqnid@192.168.0.109:/home/dqnid /mnt/LocalServer

2
System/mountServer.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
sshfs -o default_permissions -o ssh_command="ssh -i ~/.ssh/id_new_server_dqnid" dqnid@192.168.1.147:/home/dqnid ~/Remote/LocalServer/

View File

@@ -14,7 +14,7 @@ ask_operation(){
}
ask_what_to_sync(){
rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'Files To Sync' -width 12 -line-padding 3 -lines 2 -theme /home/danih/Scripts/rofi/sinc.rasi <<< "Full|Documents|Images|Videos|Music"
rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'Files To Sync' -width 12 -line-padding 3 -lines 2 -theme /home/danih/Scripts/rofi/sinc.rasi <<< "Notes|Full|Documents|Images|Videos|Music"
}
localAccess=$(ping -c 1 192.168.1.144)
@@ -30,8 +30,6 @@ else
fi
fi
operation=$(ask_operation &)
files_to_sync=$(ask_what_to_sync &)
echo $url
@@ -45,42 +43,47 @@ case "$operation" in
origin="$url:/home/dqnid/"
;;
esac
# TODO:array=($(ls -d */))
case "$files_to_sync" in
Notes)
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/Documents/Anotaciones/ $dest/Documents/Anotaciones/
;;
Full)
for dir in "${docs[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
for dir in "${images[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
for dir in "${videos[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/Music/ $dest/Music/
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/Music/ $dest/Music/
;;
Documents)
for dir in "${docs[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
;;
Images)
for dir in "${images[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
;;
Videos)
for dir in "${videos[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/$dir $dest/$dir
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/$dir $dest/$dir
done
;;
Music)
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" --delete-after $origin/Music/ $dest/Music/
rsync -vrP -e "ssh -i ~/.ssh/id_new_server_dqnid" $origin/Music/ $dest/Music/
;;
esac

11
System/toggleEscSwap.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
if [[ $1 == "off" ]]; then
xmodmap -e "keycode 49 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 9 = Escape NoSymbol Escape"
else
xmodmap -e "keycode 49 = Escape NoSymbol Escape"
xmodmap -e "keycode 9 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 66 = Escape NoSymbol Escape"
xmodmap -e "clear lock"
fi

View File

@@ -10,11 +10,18 @@ floatingId=${floatingId:3}
if [[ $1 == "toggle" ]]; then
if [[ -n $floatingId ]]; then
xinput reattach $floatingId $masterId
xmodmap -e "keycode 49 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 9 = Escape NoSymbol Escape"
else
xinput float $internalId
xmodmap -e "keycode 49 = Escape NoSymbol Escape"
xmodmap -e "keycode 9 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 66 = Escape NoSymbol Escape"
fi
elif [[ $1 == "on" ]]; then
xinput reattach $floatingId $masterId
xmodmap -e "keycode 49 = dead_grave dead_tilde dead_grave dead_tilde grave asciitilde grave"
xmodmap -e "keycode 9 = Escape NoSymbol Escape"
else
if [[ -n $floatingId ]]; then
echo " off"