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

View File

@@ -1,6 +1,7 @@
#!/bin/bash
interno=eDP
externo=HDMI-A-0
externo=DisplayPort-0
#externo=HDMI-A-0
#Todo mal pero tremendo palo cambiarlo:
# ejecutar un solo randr con variables
@@ -10,7 +11,7 @@ externo=HDMI-A-0
lidstate="$(cat /proc/acpi/button/lid/LID0/state | awk '{print $2}')"
if test $lidstate == "closed"; then
if test $lidstate == "closed"; then
xrandr --output "$interno" --auto --output "$externo" --auto --above "$interno" --output "$externo2" --off
xrandr --output "$externo" --mode 1920x1080 --rate 120 --output "$interno" --off
elif xrandr | grep "$externo connected"; then
@@ -25,18 +26,18 @@ if test $lidstate == "closed"; then
"Dual Side Low")
xrandr --output HDMI-A-0 --mode 1600x900 --pos 0x0 --rotate normal --output eDP --primary --mode 1920x1080 --rate 60 --pos 0x1080 --rotate normal
;;
Duplicar)
Duplicar)
xrandr --output "$interno" --auto --output "$externo" --same-as "$interno"
;;
Externa)
Externa)
xrandr --output "$interno" --auto --output "$externo" --auto --above "$interno" --output "$externo2" --off
xrandr --output "$externo" --mode 1920x1080 --rate 144 --output "$interno" --off
;;
Interna)
Interna)
xrandr --output "$externo" --off --output "$interno" --auto
;;
esac
else
else
xrandr --output "$externo" --off --output "$externo2" --off --output "$interno" --auto
fi
[[ "eleccion" = "" ]] && exit 1

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"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
dir="~/.config/polybar/floating/scripts/rofi"
dir="~/Scripts/rofi"
confirm_exit() {
rofi -dmenu\
@@ -10,9 +10,6 @@ confirm_exit() {
-theme $dir/confirm.rasi
}
msg() {
rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
}
if test $# == 0; then
echo "./confirm logout|suspend|poweroff|reboot "
@@ -40,6 +37,4 @@ ans=$(confirm_exit &)
esac
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi

View File

@@ -3,8 +3,8 @@
* {
al: #00000000;
bg: #101010BF;
bga: #09090ABA;
bg: #121212DF;
bga: #101010CA;
fg: #f5f5f5FF;
ac: #58809aFF;
se: #58809a5A;

View File

@@ -14,10 +14,10 @@ window {
border-radius: 0px;
border-color: @ac;
location: center;
y-offset: -2em;
y-offset: 0em;
}
entry {
expand: true;
text-color: @bg;
text-color: @fg;
}

View File

@@ -27,7 +27,7 @@ window {
border: 0px 0px 4px 0px;
border-color: @ac;
border-radius: 0px;
width: 500px;
width: 800px;
location: center;
x-offset: 0;
y-offset: 0;
@@ -67,7 +67,7 @@ inputbar {
listview {
background-color: @al;
padding: 0px;
columns: 3;
columns: 2;
lines: 5;
spacing: 5px;
cycle: true;