refactor: new system basics

This commit is contained in:
2025-05-29 18:18:25 +02:00
parent f4ea18dc1a
commit c0ca42d166
92 changed files with 190009 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
# Posible enmascarando targets de systemd, pero mejor con caffeine
# Ejecutar con caffeine
if [ -f "/tmp/sleepStopped" ]; then
touch /tmp/sleep
rm /tmp/sleepStopped
else
touch /tmp/sleepStopped
for (( ; ; )); do
if [ -f "/tmp/sleep" ]; then
rm /tmp/sleep
exit 123
fi
sleep 5
done
fi

View File

@@ -0,0 +1,11 @@
#!/bin/bash
pausa=$(dunstctl is-paused)
if [ $pausa == 'false' ]
then
dunstctl close-all
dunstctl set-paused true
else
dunstctl close-all
dunstctl set-paused false
notify-send "Notificaciones activadas"
fi

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
id=$(xinput list | grep Touchpad | awk '{print $6}' | grep -o '[0-9]\+')
prop=$(xinput list-props $id | grep "Device Enabled (" | awk '{print $3}' | grep -o '[0-9]\+')
val=$(xinput list-props $id | grep "Device Enabled (" | awk '{print $4}' | grep -o '[0-9]\+')
if [ $val = 1 ]; then
val=0
else
val=1
fi
xinput set-prop $id $prop $val
unset id
unset prop
unset val

17
polybar/scripts/bluetooth.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ]
then
echo "%{F#415a77}"
else
if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ]
then
echo ""
else
echo "%{F#40916c}"
fi
fi

BIN
polybar/scripts/calendario.jar Executable file
View File

Binary file not shown.

15
polybar/scripts/cyclexkbmap.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
layouts=("es" "us")
variants=("none" "intl")
currentLayout=$(xkb-switch)
currentLayoutCleaned=${currentLayout:0:2}
for i in "${!layouts[@]}"; do
if test ${layouts[i]} == $currentLayoutCleaned; then
nextLayout=${layouts[(i+1)%${#layouts}]}
nextVariant=${variants[(i+1)%${#variants}]}
setxkbmap -layout $nextLayout -variant $nextVariant
fi
done

11
polybar/scripts/dunst.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
if [ $(dunstctl is-paused) == 'false' ]
then
echo "%{F#FFFFFF}"
else
echo "%{F#ffbe0b} Pausadas"
fi

4
polybar/scripts/getMemory.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
memory=$(free -m -L | awk '{print $6'})
echo $memory MiB

9
polybar/scripts/listxkbmap.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
layout=$(xkb-switch)
caps_lock_status=$(xset -q | sed -n 's/^.*Caps Lock:\s*\(\S*\).*$/\1/p')
if [ $caps_lock_status == "on" ]; then
caps="- CAPS"
fi
echo ${layout:0:2} ${caps}

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
if [ -f "/tmp/sleepStopped" ]; then
echo "%{F#ef476f} stopped"
else
echo "%{F#ced4da} sleepy"
fi

View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
dia="$(date +"%a %d")"
mes="$(date +"%B")"
hora="$(date +"%R")"
echo "%{F#ffffff} %{F#c4c7c5}$dia de $mes %{F#ffffff} %{F#ffffff}$hora"

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
var=$(dunstctl history | sed -n /summary/,/}\,/p | grep data | awk '{$1=$2=""; print $0}' | sed 's/"//g')
echo $var
ver="$(rofi -no-config -no-lazy-grab -sep "\n" -dmenu -i -p 'Historial' -width 12 -line-padding 3 -lines 3 -theme ~/.config/polybar/floating/scripts/rofi/notificaciones.rasi <<< "$var")"

View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
grafica="$(sensors | grep 'Sensor 2' | awk '{print $3}')"
cpu="$(sensors | grep -A 10 'gigabyte' | grep 'temp3' | awk '{print $2}')"
echo "%{F#ffffff} %{F#c4c7c5}CPU: $cpu  %{F#c4c7c5}GPU: $grafica"

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
#tiempo="$(~/Packages/ansiweather/ansiweather -l "Béjar,ES" -u metric -s true -f 1 -d true | awk '{print $7$8 $9}' | sed $'s/\e\\[[0-9;:]*[a-zA-Z]//g')"
#tiempo=$(curl -s wttr.in/Béjar?format="%l:+%c+%t+%p\n")
#echo "%{F#66ffffff}Béjar: %{F#ffffff}$tiempo"
tiempo=$(curl -s wttr.in/Béjar?format="%l:+%C+%t+%p\n")
echo "$tiempo"

View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
curl wttr.in/Béjar
echo "Pulsa una tecla para salir"
read q
exit 1

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
id=$(xinput list | grep Touchpad | awk '{print $6}' | grep -o '[0-9]\+')
prop=$(xinput list-props $id | grep "Device Enabled (" | awk '{print $3}' | grep -o '[0-9]\+')
val=$(xinput list-props $id | grep "Device Enabled (" | awk '{print $4}' | grep -o '[0-9]\+')
if [ $val = 0 ]; then
echo "%{F#ce4257}"
else
echo "%{F#40916c}"
fi

81
polybar/scripts/powermenu.sh Executable file
View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
## Original Author : Aditya Shakya
## Mail : adi1090x@gmail.com
## Modified by : Daniel Heras
## Mail : dani.heras@hotmail.com
dir="~/.config/polybar/floating/scripts/rofi"
#uptime=$(uptime -p | sed -e 's/up //g')
uptime=$(uptime | awk '{print $3}' | sed 's/,//g')
rofi_command="rofi -theme $dir/powermenuRight.rasi"
shutdown="Shutdown "
reboot="Restart "
lock="Lock "
suspend="Sleep "
logout="Logout "
confirm_exit() {
rofi -dmenu\
-i\
-no-fixed-num-lines\
-p "Are You Sure? : "\
-theme $dir/confirm.rasi
}
msg() {
rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
}
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
chosen="$(echo -e "$options" | $rofi_command -p "$uptime" -dmenu -selected-row 0)"
case $chosen in
$shutdown)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl poweroff
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$reboot)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl reboot
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$lock)
mpc -q pause
pulseaudio-ctl mute yes
if [[ -f /usr/bin/i3lock ]]; then
i3lock
elif [[ -f /usr/bin/betterlockscreen ]]; then
betterlockscreen -l
elif [[ -f /usr/bin/light-locker-command ]]; then
light-locker-command -l
fi
;;
$suspend)
mpc -q pause
pulseaudio-ctl mute yes
systemctl suspend
;;
$logout)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
i3-msg exit
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
esac

View File

@@ -0,0 +1,10 @@
/* colors */
* {
al: #00000000;
bg: #090909FF;
bga: #000000FF;
fg: #f5f5f5FF;
ac: #415a77FF;
se: #415a775A;
}

View File

@@ -0,0 +1,24 @@
/* Confirm Dialog */
@import "colors.rasi"
* {
background-color: @bg;
text-color: @fg;
font: "Terminus 9";
}
window {
width: 225px;
padding: 25px;
border: 0px 0px 4px 0px;
border-radius: 0px;
border-color: @ac;
location: center;
y-offset: -2em;
}
entry {
expand: true;
text-color: @bg;
}

View File

@@ -0,0 +1,118 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Terminus 10";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px 0px 4px 0px;
border-color: @ac;
border-radius: 0px;
width: 350px;
location: center;
x-offset: -777;
y-offset: 20;
}
prompt {
enabled: true;
padding: 0px;
background-color: @al;
text-color: @ac;
font: "feather 8";
}
entry {
background-color: @al;
text-color: @fg;
placeholder-color: @fg;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 0px 0px 0px 8px;
blink: true;
}
inputbar {
children: [ prompt, entry ];
background-color: @bga;
text-color: @fg;
expand: false;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @ac;
margin: 0px;
padding: 12px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 22;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 0px;
padding: 0px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px;
}
element-icon {
size: 24px;
border: 0px;
background-color: @al;
}
element-text {
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
background-color: @al;
text-color: inherit;
}
element selected {
background-color: @se;
text-color: @fg;
border: 0px 0px 0px 2px;
border-radius: 0px;
border-color: @ac;
}

View File

@@ -0,0 +1,24 @@
/* Confirm Dialog */
@import "colors.rasi"
* {
background-color: @bga;
text-color: @fg;
font: "Terminus 9";
}
window {
width: 320px;
padding: 25px;
border: 0px 0px 4px 0px;
border-radius: 0px;
border-color: @ac;
location: center;
y-offset: -2em;
}
entry {
expand: true;
text-color: @ac;
}

View File

@@ -0,0 +1,127 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Terminus 12";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px;
border-color: @ac;
border-radius: 0px;
width: 200px;
location: center;
x-offset: 865;
y-offset: 383;
}
prompt {
enabled: true;
padding: 10px 10px 10px 0px;
background-color: @al;
text-color: @ac;
font: "Terminus 9";
}
textbox-prompt-colon {
padding: 8px 15px 10px 15px;
font: "Iosevka Nerd Font 8";
background-color: @al;
text-color: @ac;
expand: false;
str: "";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ textbox-prompt-colon, prompt ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 0px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 5;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 0px;
padding: 0px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px 8px 8px -20px;
}
element-icon {
size: 24px;
border: 0px;
background-color: @al;
}
element-text {
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
background-color: @al;
text-color: inherit;
}
element selected {
background-color: @al;
text-color: @fg;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @ac;
}

View File

@@ -0,0 +1,127 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Terminus 9";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px 0px 4px 0px;
border-color: @ac;
border-radius: 0px;
width: 170px;
location: center;
x-offset: 866;
y-offset: -365;
}
prompt {
enabled: true;
padding: 10px 10px 10px 0px;
background-color: @al;
text-color: @ac;
font: "Terminus 9";
}
textbox-prompt-colon {
padding: 8px 15px 10px 15px;
font: "Iosevka Nerd Font 8";
background-color: @al;
text-color: @ac;
expand: false;
str: "";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ textbox-prompt-colon, prompt ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 0px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 5;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 0px;
padding: 0px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px 8px 8px -20px;
}
element-icon {
size: 24px;
border: 0px;
background-color: @al;
}
element-text {
expand: true;
horizontal-align: 0.5;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
background-color: @al;
text-color: inherit;
}
element selected {
background-color: @se;
text-color: @fg;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @ac;
}

9
polybar/scripts/showdate.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
day="$(date +"%a %d")"
month="$(date +"%B")"
hour="$(date +"%R")"
echo " $hour at $day of $month "

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

@@ -0,0 +1,32 @@
#!/bin/bash
masterId=$(xinput list | grep "Virtual core keyboard" | awk '{print $5}')
internalId=$(xinput list | grep "AT Translated.*keyboard" | awk '{print $7}')
floatingId=$(xinput list | grep "AT Translated.*keyboard.*floating" | awk '{print $7}')
masterId=${masterId:3}
internalId=${internalId:3}
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"
xmodmap -e "clear lock"
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"
else
echo " on"
fi
fi

View File

@@ -0,0 +1,11 @@
#!/bin/sh
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ]
then
bluetoothctl power on
else
bluetoothctl power off
fi

17
polybar/scripts/wifi_status.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Author by : Daniel Heras
# Mail : dani.heras@hotmail.com
n=$(nmcli device status | grep -wc connected)
#id=$(nmcli device status | grep -w connected | awk '{print $4}')
id=$(nmcli -t -f active,ssid dev wifi | grep -E '^yes' | cut -d\' -f2)
final_id=$(echo "${id#*:}")
if test $n -gt 1; then
echo "%{F#ffffff} %{F#ced4da}$final_id"
elif test $n -eq 0; then
echo "%{F#a4133c} %{F#ced4da}Sin conexión"
else
echo "%{F#ffffff} %{F#ced4da}$final_id"
fi