New folder structure

This commit is contained in:
2023-04-03 17:47:42 +02:00
commit a2bdf977d9
42 changed files with 2055 additions and 0 deletions

8
System/ShowHelp.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
groff -ms -D UTF-8 ~/Documents/Anotaciones/Ficheros\ Fuente/Documentación_Linux.ms -T pdf > ~/Documents/Anotaciones/Documentación_Linux.pdf
groff -ms -D UTF-8 ~/Documents/Anotaciones/Ficheros\ Fuente/Atajos.ms -T pdf > ~/Documents/Anotaciones/Atajos.pdf
if test $1 -eq 1; then
mupdf-x11 ~/Documents/Anotaciones/Documentación_Linux.pdf
else
mupdf-x11 ~/Documents/Anotaciones/Atajos.pdf
fi

12
System/ajustaBrillo.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
x=$(cat /sys/class/backlight/amdgpu_bl0/brightness)
if test $1 -eq 1; then
x=$(($x + $2))
echo $x > /sys/class/backlight/amdgpu_bl0/brightness
elif test $1 -eq 0; then
x=$(($x - $2))
echo $x > /sys/class/backlight/amdgpu_bl0/brightness
elif test $1 -eq 2; then
echo 20 > /sys/class/backlight/amdgpu_bl0/brightness
fi

9
System/ajustaBrilloTeclado.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
max=$(cat /sys/class/leds/asus::kbd_backlight/max_brightness)
actual=$(cat /sys/class/leds/asus::kbd_backlight/brightness)
if test $actual == $max; then
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
else
nueva=$(($actual + 1))
echo $nueva > /sys/class/leds/asus::kbd_backlight/brightness
fi

46
System/ajustaSonido.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
volumen="100|90|80|70|60|50|40|30|20|10|0"
elegirPorcentaje (){
eleccion=$(rofi -no-config -no-lazy-grab -hover-select -me-select-entry '' -me-accept-entry MousePrimary -sep "|" -dmenu -i -p ¿Volumen? -theme ~/Scripts/Temas/pulsemenu.rasi <<< "$volumen")
echo "$eleccion"
}
if [ $1 -eq 1 ]; then
eleccion="$(elegirPorcentaje)"
pamixer --set-volume $eleccion
else
opciones="Salida|Entrada|V.Salida|V.Entrada|Pavucontrol"
eleccion=$(rofi -no-config -no-lazy-grab -hover-select -me-select-entry '' -me-accept-entry MousePrimary -sep "|" -dmenu -i -p ¿Acción? -theme ~/Scripts/Temas/pulsemenu.rasi <<< "$opciones")
case $eleccion in
Salida)
dispositivo=$(pamixer --list-sinks | grep -v "Sinks:" | awk '{print $1}')
eleccion=$(rofi -no-config -no-lazy-grab -hover-select -me-select-entry '' -me-accept-entry MousePrimary -sep "\n" -dmenu -i -p ¿Dispositivo? -theme ~/Scripts/Temas/pulsemenu.rasi <<< "$dispositivo")
# No funciona, no encuentro herramienta que lo haga sencillo. pacmd parece que tocará.
pacmd list-sinks | grep "alsa.name"
pacmd set-default-sink $eleccion
;;
Entrada)
;;
V.Salida)
eleccion="$(elegirPorcentaje)"
pamixer --set-volume $eleccion
;;
V.Entrada)
eleccion="$(elegirPorcentaje)"
# Chapuza, solo cambia el volumen del micrófono del portátil, debería cambiar el que esté predeterminado.
dispositivo=$(pamixer --list-sources | grep "Digital Microphone" | awk '{print $1}')
pamixer --source $dispositivo --set-volume $eleccion
;;
Pavucontrol)
pavucontrol
;;
*)
exit 1
;;
esac
sinks=$(pamixer --list-sinks)
sources=$(pamixer --list-sources)
fi
#awk '/Raptors/,/Celtics/ { print $1 }'

15
System/ajustaTouchpad.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
id=$(xinput list | grep Touchpad | awk '{print $6}' | grep -o '[0-9]\+')
tap=$(xinput list-props $id | grep "Tapping Enabled (" | awk '{print $4}' | grep -o '[0-9]\+')
speed=$(xinput list-props $id | grep "Accel Speed (" | awk '{print $4}' | grep -o '[0-9]\+')
scroll=$(xinput list-props $id | grep "Natural Scrolling Enabled (" | awk '{print $5}' | grep -o '[0-9]\+')
echo $id $tap $speed
xinput set-prop $id $tap 1
xinput set-prop $id $speed 0.4
xinput set-prop $id $scroll 1
unset id
unset prop
unset val

8
System/confirmKilli3.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
confirm="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p '¿Cerrar ventana?' -width 12 -line-padding 3 -lines 3 -theme /home/danih/Scripts/Temas/confirm_kill.rasi <<< "No|Si")"
case "$confirm" in
Si)
echo "Si confirmado"
i3-msg kill
;;
esac

11
System/focusMode.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
state=$(cat ~/Scripts/.focusState)
if test $state -eq 0; then
polybar-msg cmd hide
i3-msg gaps inner all set 0
echo 1 > ~/Scripts/.focusState
else
polybar-msg cmd show
i3-msg gaps inner all set 30
echo 0 > ~/Scripts/.focusState
fi

2
System/montaServer.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/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

16
System/resetBluetooth.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
#
#bluez
#bluetoothctl
sudo modprobe -r btusb
sudo modprobe btusb
sudo rmmod btusb
sudo modprobe btusb
connmanctl disable bluetooth
connmanctl enable bluetooth
bluetoothctl power off
bluetoothctl power on

57
System/sincV8.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
# To-do: Add Eww widgets or other interface
theme="~/Scripts/Temas/"
server_routes=("Anotaciones" "Universidad/Segundo[[:space:]]Cuatrimestre/" "Universidad/TFG/")
local_full=("Documents/Anotaciones/" "Documents/Proyectos/" "Documents/Universidad/" "Images/Carteles[[:space:]]OZ/" "Images/Proyectos/")
dotfiles=(".bashrc" ".config/nvim/" ".config/polybar/" ".config/i3/" ".config/mpd/" ".config/ncmpcpp/" ".config/mpv/" ".config/nemo/" ".config/dunst/" ".config/glava/" ".config/ranger/" ".config/sxhkd/" ".config/picom.conf")
net="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'Network' -width 12 -line-padding 3 -lines 2 -theme /home/danih/Scripts/Temas/sinc.rasi <<< "LAN|WAN")"
case "$net" in
LAN)
operation="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p 'Action' -width 12 -line-padding 3 -lines 2 -theme /home/danih/Scripts/Temas/sinc.rasi <<< "PUSH|PULL")"
case "$operation" in
PUSH)
origin="/home/danih/"
dest="dqnid@192.168.0.109:/home/dqnid/"
;;
PULL)
dest="/home/danih/"
origin="dqnid@192.168.0.109:/home/dqnid/"
;;
esac
files_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/Temas/sinc.rasi <<< "Documents|Images|Videos|Music|Dotfiles|All")"
case "$files_to_sync" in
Documents | Images | Videos | Music)
for dir in "$origin$files_to_sync"/*
rsync -vrP -e "ssh -i ~/.ssh/id_rsa_dqnid" --delete-after $origin/$dir $dest/$dir
;;
Dotfiles)
for i in "${dotfiles[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_rsa_dqnid" --delete-after $origin/$i $dest/$i
if test $? -eq 0; then
notify-send "Éxito - $i" "$i sincronizadas correctamente"
else
notify-send "Error - $i" "Fallo en sincronización de $i"
fi
done
;;
esac
;;
WAN)
for i in "${server_routes[@]}"
do
rsync -vrP -e "ssh -i ~/.ssh/id_rsa_dqnid" --delete-after /home/danih/Documents/$i dqnid@dqnid.com:/home/dqnid/Documents
if test $? -eq 0; then
notify-send "Éxito - $i" "$i sincronizadas correctamente"
else
notify-send "Error - $i" "Fallo en sincronización de $i"
fi
done
;;
esac

17
System/soundApplets.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
SERVICE1="pa-applet"
SERVICE2="blueman-applet"
if pgrep -x "$SERVICE1" >/dev/null
then
killall "$SERVICE1"
else
~/Paquetes/pa-applet/src/pa-applet &
fi
bluetoothctl power on
if pgrep -x "$SERVICE2" >/dev/null
then
killall "$SERVICE2"
else
$SERVICE2 &
fi