diff --git a/i3blocks/Arch/bat.sh b/i3blocks/Arch/bat.sh new file mode 100755 index 0000000..ad1ee1c --- /dev/null +++ b/i3blocks/Arch/bat.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +Bat=$(acpi | cut -d " " -f4 | tr -d "%,") +Adapt=$(acpi -a | cut -d " " -f3) + +if [ "$Adapt" = "on-line" ];then + icon0="" + icon1="" + icon2="" + icon3="" + icon4="" +else + icon0="" + icon1="" + icon2="" + icon3="" + icon4="" +fi + +if [ -z "$Bat" ];then + bat="$icon4 $Adapt" +elif [ "$Bat" -gt "100" ];then + bat="$icon4 Full" +elif [ "$Bat" -gt "90" ];then + bat="$icon3 $Bat %" +elif [ "$Bat" -gt "60" ];then + bat="$icon2 $Bat %" +elif [ "$Bat" -gt "30" ];then + bat="$icon1 $Bat %" +elif [ "$Bat" -lt "30" ];then + bat="$icon0 $Bat %" +fi + +echo -e "$bat" diff --git a/i3blocks/Arch/cpu.sh b/i3blocks/Arch/cpu.sh new file mode 100755 index 0000000..afedc17 --- /dev/null +++ b/i3blocks/Arch/cpu.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +Cpu=$(mpstat -u | grep "all" | awk '{print $4"%"}') + +echo -e " $Cpu" diff --git a/i3blocks/Arch/date.sh b/i3blocks/Arch/date.sh new file mode 100755 index 0000000..0d0b5db --- /dev/null +++ b/i3blocks/Arch/date.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo -e " $(date +%D)  $(date +%T)" diff --git a/i3blocks/Arch/disk.sh b/i3blocks/Arch/disk.sh new file mode 100755 index 0000000..d0aa1ca --- /dev/null +++ b/i3blocks/Arch/disk.sh @@ -0,0 +1,10 @@ +#!/bin/bash +Disk=$(df -h "$1" | grep -v "^[A-Z]" | awk '{print $3-G"/"$2}') + +if [ -z "$1" ];then + echo -e "Enter Your Mounted Point Name Ex : \"/\" " +else + echo -e " $Disk " +fi + +unset Disk diff --git a/i3blocks/Arch/focus.sh b/i3blocks/Arch/focus.sh new file mode 100755 index 0000000..bc7f67b --- /dev/null +++ b/i3blocks/Arch/focus.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +focus=$(xdotool getactivewindow getwindowname) +focus_Number=$(xdotool getactivewindow getwindowname | wc -c) +Focus_N=$(xdotool getactivewindow getwindowname | head -c 40 ) + +if [ "$focus" = "" ];then + echo -e " : Void Linux " +else + if [ "$focus_Number" -gt "40" ];then + echo -e " : $Focus_N ..." + else + echo -e " : $focus" + fi +fi diff --git a/i3blocks/Arch/key_l.sh b/i3blocks/Arch/key_l.sh new file mode 100755 index 0000000..74408dd --- /dev/null +++ b/i3blocks/Arch/key_l.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +Key=$(setxkbmap -query | grep "^layout" | awk '{print $2}') + +echo -e " $Key" diff --git a/i3blocks/Arch/lang.sh b/i3blocks/Arch/lang.sh new file mode 100755 index 0000000..189ea50 --- /dev/null +++ b/i3blocks/Arch/lang.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo -e " $LANGUAGE" diff --git a/i3blocks/Arch/mem.sh b/i3blocks/Arch/mem.sh new file mode 100755 index 0000000..0d7d912 --- /dev/null +++ b/i3blocks/Arch/mem.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +Mem=$(free -h | grep "^Mem:" | awk '{print $3}') +Swap=$(free -h | grep "^Swap:" | awk '{print $3}') + +if [ -z "$1" ];then + echo -e " $0 : no Argument \n\t -m : Show Memory usage \n\t -s : Show Swap usage " +fi + +case "$1" in + "-m" ) + echo -e " $Mem" + ;; + "-s" ) + echo -e " $Swap" + ;; +esac + +unset Mem +unset Swap diff --git a/i3blocks/Arch/mocp.sh b/i3blocks/Arch/mocp.sh new file mode 100755 index 0000000..18508bb --- /dev/null +++ b/i3blocks/Arch/mocp.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +Title=$(mocp -i | grep "^Title:" | cut -d ":" -f2) +NUM_Title=$(echo -e "$Title" | wc -c ) +S_Title=$(echo -e "$Title" | head -c 30) +Status=$(mocp -i | grep "^State:" | cut -d ":" -f2) + +if [ "$Status" != " PLAY" ];then + echo -e " : Pause" +else + if [ "$NUM_Title" -lt 30 ];then + echo -e " : $Title " + else + echo -e " : $S_Title ... " + fi +fi diff --git a/i3blocks/Arch/mpd.sh b/i3blocks/Arch/mpd.sh new file mode 100755 index 0000000..f72833a --- /dev/null +++ b/i3blocks/Arch/mpd.sh @@ -0,0 +1,14 @@ +#!/bin/bash +NCMP=$(mpc | grep "^\[playing\]" | awk '{print $1}') +NUM_NCMP=$(mpc | head -1 | wc -c ) +S_NCMP=$(mpc | head -1 | head -c 30) + +if [ "$NCMP" = "[playing]" ];then + if [ "$NUM_NCMP" -lt 30 ];then + echo -e " :$(mpc current) " + else + echo -e " : $S_NCMP..." + fi +else + echo -e " :Pause " +fi diff --git a/i3blocks/Arch/net.sh b/i3blocks/Arch/net.sh new file mode 100755 index 0000000..f5c4efb --- /dev/null +++ b/i3blocks/Arch/net.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Show Wifi Stuff +W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':') +W_con=$(nmcli d | grep "$W_inter" | awk '{print $3}') +W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}') +W_ip=$(ifconfig $W_inter | grep 'netmask' | awk '{print $6}') + +# Show Ethernet stuff +E_inter=$(ip link | grep "^[1-9]: enp" | cut -d " " -f2 | tr -d :) +E_con=$(nmcli d | grep "$E_inter" | awk '{print $3}') +E_name=$(nmcli d | grep "$E_inter" | awk '{print $4}') +E_ip=$(ifconfig $E_inter | grep 'netmask' | awk '{print $6}') + + +Wifi () { +if [ "$W_con" = "connected" ];then + echo -w " $W_ip ($W_name)" +fi +} + +Ethernet () { +if [ "$E_con" = "connected" ];then + echo -e " $E_ip ($E_name)" +fi +} + +case "$1" in + "-w" ) + Wifi + ;; + "-e" ) + Ethernet + ;; + * ) + echo -e " $0 : no Argument \n\t -e : Show Ethernet \n\t -w : Show Wireless" + ;; +esac + diff --git a/i3blocks/Arch/temp.sh b/i3blocks/Arch/temp.sh new file mode 100755 index 0000000..06119bc --- /dev/null +++ b/i3blocks/Arch/temp.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +temp=$(sensors | grep "^CPU" | awk '{print $2}' | tr -d "+" ) + +echo -e " $temp" diff --git a/i3blocks/Arch/touchpad.sh b/i3blocks/Arch/touchpad.sh new file mode 100755 index 0000000..b5430ce --- /dev/null +++ b/i3blocks/Arch/touchpad.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +Status=$(synclient -l | grep Touchpad | awk '{print $3}') + +if [ "$Status" = "0" ];then + echo -e "  Enable " +else + echo -e "  Disable " +fi diff --git a/i3blocks/Arch/trash.sh b/i3blocks/Arch/trash.sh new file mode 100755 index 0000000..0f14f64 --- /dev/null +++ b/i3blocks/Arch/trash.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +trash=$(ls -A -1 ~/.local/share/Trash/files/ | wc -l) + +if [ "$trash" = "0" ];then + echo -e "" +else + echo -e " $trash " +fi diff --git a/i3blocks/Arch/update.sh b/i3blocks/Arch/update.sh new file mode 100755 index 0000000..e8fb45b --- /dev/null +++ b/i3blocks/Arch/update.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +update=$(checkupdates | cut -d " " -f1 | wc -l) + +if [ "$update" = "0" ];then + echo -e "" +else + echo -e " $Update" +fi diff --git a/i3blocks/Arch/uptime.sh b/i3blocks/Arch/uptime.sh new file mode 100755 index 0000000..674c6e5 --- /dev/null +++ b/i3blocks/Arch/uptime.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +UPTIME=$(uptime -p | sed "s/hour/H/" | sed "s/minutes/M/" | sed "s/up //") + +echo -e " $UPTIME " diff --git a/i3blocks/Arch/vol.sh b/i3blocks/Arch/vol.sh new file mode 100755 index 0000000..5c8cdb5 --- /dev/null +++ b/i3blocks/Arch/vol.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +Vol=$(amixer -c 0 get Master | grep "Mono:" | awk '{print $4}' | tr -d "[ %]") +Mute=$(amixer -c 0 get Master | grep "Mono:" | awk '{print $6}' | tr -d "[-]") + +if [ "$Mute" = "off" ];then + echo -e " Mute" +else + if [ "$Vol" -gt "80" ];then + echo -e " $Vol %" + elif [ "$Vol" -gt "60" ];then + echo -e " $Vol %" + elif [ "$Vol" -gt "40" ];then + echo -e " $Vol %" + elif [ "$Vol" -gt "20" ];then + echo -e " $Vol %" + elif [ "$Vol" -eq "0" ];then + echo -e " $Vol %" + fi +fi + +unset Vol +unset Mute diff --git a/i3blocks/README.md b/i3blocks/README.md new file mode 100644 index 0000000..430fc82 --- /dev/null +++ b/i3blocks/README.md @@ -0,0 +1,168 @@ +## Scripts sencillos pero funionales para utilizar con i3blocks. Siéntete libre de editarlos para adaptarlos a tus necesidades + +| i3blocks Script | Dependencias | +|-----------------|-------------------| +| bat.sh | ACPI | +| date.sh | ------ | +| focus.sh | Xdotool | +| mem.sh | ------ | +| mpd.sh | Mpd, Ncmpcpp, Mpc | +| mocp.sh | Moc | +| temp.sh | lm-sensors | +| trash.sh | ---- | +| vol.sh | alsa-utils | +| cpu.sh | sysstat | +| disk.sh | ------ | +| key_l.sh | ------ | +| net.sh | ------ | +| touchpad.sh | ------ | +| update.sh | checkupdates | +| long.sh | ------ | +| uptime.sh | ------ | + +--- + +### Instalación + +git clone https://github... + + + +### Configuración + +##### Batería +[Bat] +command=~/.config/i3blocks/Blocks/bat.sh +interval=30 +color=#CC0099 + + +##### Fecha y hora +[Time] +command=~/.config/i3blocks/Blocks/date.sh +interval=60 +color=#6699FF + + +##### Ventana enfocada + +[Focus] +command=~/.config/i3blocks/Blocks/focus.sh +interval=1 +color=#FF6666 + + +##### Memoria ram +[Ram] +command=~/.config/i3blocks/Blocks/mem.sh -m +interval=10 +color=#FF6600 + + +##### Área de intercambio +[Swap] +command=~/.config/i3blocks/Blocks/mem.sh -s +interval=10 +color=#6699FF + + +##### MPD +[MPD] +command=~/.config/i3blocks/Blocks/mpd.sh +interval=5 +color=#66CCFF + + +##### Temperatura del cpu +[Temp] +command=~/.config/i3blocks/Blocks/temp.sh +interval=60 +color=#6699FF + + +##### Papelera de reciclaje +[Trash] +command=~/.config/i3blocks/Blocks/trash.sh +interval=60 +color=#c68c53 + + +##### Volumen +[Vol] +command=~/.config/i3blocks/Blocks/Vol.sh +interval=3 +color=#9933FF + + +##### Uso del cpu +[Cpu] +command=~/.config/i3blocks/Blocks/cpu.sh +interval=5 +color=#FFFF66 + + +##### Uso del disco +[Disk] +command=~/.config/i3blocks/Blocks/disk.sh / +interval=60 +color=#CC6699 + + +##### Distribución del teclado +[Key] +command=~/.config/i3blocks/Blocks/key_l.sh +interval=once +color=#33ff33 + + +##### Mocp +[Mocp] +command=~/.config/i3blocks/Blocks/mocp.sh +interval=60 +color=#66CCFF + + +##### Conexión Ethernet +[Ether] +command=~/.config/i3blocks/Blocks/net.sh -e +interval=10 +color=#CC99FF + + +##### Conexión Wifi +[Ether] +command=~/.config/i3blocks/Blocks/net.sh -w +interval=10 +color=#CC99FF + + +##### Touchpad +[Touchpad] +command=~/.config/i3blocks/Blocks/touchpad.sh +interval=10 +color=#4d4dff + + +##### Actualizaciones +[Update] +command=~/.config/i3blocks/Blocks/update.sh +interval=600 +color=#FFCC99 + + +##### Tiempo de uso +[Uptime] +command=~/.config/i3blocks/Blocks/uptime.sh +interval=60 +color=#FFCC00 + + +##### Idioma del sistema +[Long] +command=~/.config/i3blocks/Blocks/long.sh +interval=600 +color=#FFFF99 + + +### [!] NOTA: +Necesitarás intalar el paquete fonts awesome diff --git a/i3blocks/screenshot/bat.png b/i3blocks/screenshot/bat.png new file mode 100644 index 0000000..7db945c Binary files /dev/null and b/i3blocks/screenshot/bat.png differ diff --git a/i3blocks/screenshot/cpu.png b/i3blocks/screenshot/cpu.png new file mode 100644 index 0000000..b3a15f6 Binary files /dev/null and b/i3blocks/screenshot/cpu.png differ diff --git a/i3blocks/screenshot/date.png b/i3blocks/screenshot/date.png new file mode 100644 index 0000000..23d6a9e Binary files /dev/null and b/i3blocks/screenshot/date.png differ diff --git a/i3blocks/screenshot/disk.png b/i3blocks/screenshot/disk.png new file mode 100644 index 0000000..7a122a8 Binary files /dev/null and b/i3blocks/screenshot/disk.png differ diff --git a/i3blocks/screenshot/focus.png b/i3blocks/screenshot/focus.png new file mode 100644 index 0000000..b7901fc Binary files /dev/null and b/i3blocks/screenshot/focus.png differ diff --git a/i3blocks/screenshot/key_layout.png b/i3blocks/screenshot/key_layout.png new file mode 100644 index 0000000..3fd0b02 Binary files /dev/null and b/i3blocks/screenshot/key_layout.png differ diff --git a/i3blocks/screenshot/long.png b/i3blocks/screenshot/long.png new file mode 100644 index 0000000..34a240a Binary files /dev/null and b/i3blocks/screenshot/long.png differ diff --git a/i3blocks/screenshot/mem.png b/i3blocks/screenshot/mem.png new file mode 100644 index 0000000..779d4bc Binary files /dev/null and b/i3blocks/screenshot/mem.png differ diff --git a/i3blocks/screenshot/mocp.png b/i3blocks/screenshot/mocp.png new file mode 100644 index 0000000..0359827 Binary files /dev/null and b/i3blocks/screenshot/mocp.png differ diff --git a/i3blocks/screenshot/mpd.png b/i3blocks/screenshot/mpd.png new file mode 100644 index 0000000..676e8b0 Binary files /dev/null and b/i3blocks/screenshot/mpd.png differ diff --git a/i3blocks/screenshot/net.png b/i3blocks/screenshot/net.png new file mode 100644 index 0000000..2518a29 Binary files /dev/null and b/i3blocks/screenshot/net.png differ diff --git a/i3blocks/screenshot/temp.png b/i3blocks/screenshot/temp.png new file mode 100644 index 0000000..41e8b2e Binary files /dev/null and b/i3blocks/screenshot/temp.png differ diff --git a/i3blocks/screenshot/touchpad.png b/i3blocks/screenshot/touchpad.png new file mode 100644 index 0000000..a5eb461 Binary files /dev/null and b/i3blocks/screenshot/touchpad.png differ diff --git a/i3blocks/screenshot/trash.png b/i3blocks/screenshot/trash.png new file mode 100644 index 0000000..2cf88da Binary files /dev/null and b/i3blocks/screenshot/trash.png differ diff --git a/i3blocks/screenshot/update.png b/i3blocks/screenshot/update.png new file mode 100644 index 0000000..414f2d8 Binary files /dev/null and b/i3blocks/screenshot/update.png differ diff --git a/i3blocks/screenshot/uptime.png b/i3blocks/screenshot/uptime.png new file mode 100644 index 0000000..96b384e Binary files /dev/null and b/i3blocks/screenshot/uptime.png differ diff --git a/i3blocks/screenshot/vol.png b/i3blocks/screenshot/vol.png new file mode 100644 index 0000000..912c7a8 Binary files /dev/null and b/i3blocks/screenshot/vol.png differ diff --git a/varios/bateria b/varios/bateria new file mode 100755 index 0000000..53461e0 --- /dev/null +++ b/varios/bateria @@ -0,0 +1,30 @@ +#!/bin/sh + +## Script de notificación para la bateria + +restante=$(acpi | awk '{print $5}') +estado=$(acpi | awk '{print $3}' | cut -d"," -f1) +porcentaje=$(cat /sys/class/power_supply/BAT1/capacity) + +# Si el porcentaje de bateria es menor o igual a 30 y mayor a 25, mostrar el mensaje +if [ "$porcentaje" -le 30 ] && [ "$porcentaje" -gt 25 ]; then + notify-send --urgency=normal -i $HOME/.icons/status/battery_low.png "Conectar el cargador" "Tiempo de bateria disponible $restante" +fi + +# Si el porcentaje de bateria es igual o menor a 25, mostrar el siguiente mensaje y... +# 1. Si se conecta el cargador no suspender el equipo +# 2. Si no se conecta el cargador suspender el equipo +if [ "$porcentaje" -le 25 ]; then + notify-send --urgency=critical -i $HOME/.icons/status/battery_critical.png "Batería crítica" "Activando modo de ahorro de \nenergia en 30 segundos..." + sleep 30 && + if [ "$estado" == 'Charging' ]; then + notify-send --urgency=normal "Cargando bateria" + else + doas zzz + fi +fi + +# Si el porcentaje de la bateria es igual al 100% mostrar el siguiente mensaje +#if [ "$porcentaje" -eq "100" ]; then +# notify-send --urgency=normal -i $HOME/.icons/status/battery_charged.png "Bateria cargada" "Puede desconectar el cargador" +#fi diff --git a/varios/clima b/varios/clima new file mode 100755 index 0000000..f2e5bd5 --- /dev/null +++ b/varios/clima @@ -0,0 +1,4 @@ +#!/bin/sh +CIUDAD=Orizaba +CLIMA=$(curl -s wttr.in/$LOCATION?format=1 | grep -o "[0-9].*") +echo " $CLIMA" > /tmp/weather diff --git a/varios/dropbox b/varios/dropbox new file mode 100755 index 0000000..8e97545 --- /dev/null +++ b/varios/dropbox @@ -0,0 +1,7 @@ +#!/bin/sh + +if $(pgrep dropbox); then + echo "" +else + echo "" +fi diff --git a/varios/dunst_sound b/varios/dunst_sound new file mode 100755 index 0000000..a1b294c --- /dev/null +++ b/varios/dunst_sound @@ -0,0 +1,2 @@ +#!/bin/sh +aplay $HOME/Datos/Git_Hub/Void_Linux/dots/config/dunst/beep.wav diff --git a/varios/feed-void b/varios/feed-void new file mode 100755 index 0000000..4436a0f --- /dev/null +++ b/varios/feed-void @@ -0,0 +1,30 @@ +#!/bin/sh + +if [ -f /usr/bin/rsstail ];then + + feed="https://github.com/void-linux/void-packages/commits/master.atom" + updatedpkgs="$(rsstail -1 -u ${feed} | grep -e "Update" -e "update" | wc -l)" + newpkgs="$(rsstail -1 -u ${feed} | grep -e "New" -e "new" | wc -l)" + sysupdates="$(xbps-install -nuM | wc -l)" + #sysupdates="$(xbps-install -Snu | wc -l)" + + notify-send --urgency=critical """CAMBIOS EN EL REPOSITORIO: + Paquetes actualizados: ${updatedpkgs} + Nuevos paquetes: ${newpkgs} + +ACTUALIZACIONES DE SISTEMA: + Disponible actualmente: ${sysupdates}""" + + echo """CAMBIOS EN EL REPOSITORIO: + Paquetes actualizados: ${updatedpkgs} + Nuevos paquetes: ${newpkgs} + + ACTUALIZACIONES DE SISTEMA: + Disponible actualmente: ${sysupdates}""" +elif [ ! -f /usr/bin/rsstail ];then + echo "[ERROR] Este script requiere del paquete: 'rsstail'" + exit 0; +else + echo "Algo salió mal al verificar: /usr/bin/rsstail" + exit 0; +fi diff --git a/varios/hosts b/varios/hosts new file mode 100755 index 0000000..999da98 --- /dev/null +++ b/varios/hosts @@ -0,0 +1,20 @@ +#!/bin/bash + +# V0.3_3 +# Script para descargar una lista personalizada con direcciones para bloquearlas +# a través del fichero hosts + +# Para automatizar este proceso se recomienda crear una tarea (crontab) y ajustarla a las necesidades del usuario (diario, semanal +# mensual, etc) + +# Realizar copia de seguridad del fichero hosts previo +echo -e "\e[1;32mCreando copia de seguridad del fichero hosts...\e[0m"; cp /etc/hosts /etc/hosts.bak && sleep 1s; echo -e "\e[33mOK\e[0m" + +# Descargar lista mas reciente del repositorio y copiarlo al fichero hosts +echo -e "\e[1;32mDescargando y copiando lista actualizada para fichero hosts...\e[0m"; wget -O /etc/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts && sleep 1s; echo -e "\e[33mOK\e[0m" + +# Agregando lista personalizada de páginas al fichero hosts +echo -e "\e[1;32mAgregando parche de lista personalizada al fichero hosts...\e[0m"; cat /home/skynet/Datos/Git_Hub/Void_Linux/otros/parche >> /etc/hosts; sleep 2; doas sv restart dhcpcd && + +# Notificacion de actualizacion del fichero +echo -e "\e[1;36mTarea finalizada. Fichero host actualizado\e[0m"; notify-send -t 5000 -i /home/skynet/.icons/status/hosts_update.png "Tarea finalizada" 'Fichero hosts actulizado' diff --git a/varios/lock b/varios/lock new file mode 100755 index 0000000..e7d87f5 --- /dev/null +++ b/varios/lock @@ -0,0 +1,26 @@ +#!/bin/sh + +## V0.2 + +# Para poder utilizar la siguiente configuración se necesita de los siguiente: +# 1. i3lock +# 2. scrot +# 3. imagemagick +# 4. xautolock (opcional) + +## Realizar captura de pantalla +#scrot /tmp/screenshot.png; + +## Aplicar efecto difuso a imagen con ayuda de imagemagick +#convert /tmp/screenshot.png -blur 0x4 /tmp/screenshotblur.png; + +## Utilizar imagen previa con i3lock +#i3lock -i /tmp/screenshotblur.png + +## Para configurar el bloqueo automático de la pantalla se utiliza xautolock +xautolock -time 10 locker lock + +#------------------------------------------------------------------------------------------------------------------------- + +## Esta configuración funciona con i3lock-color +sleep 1; i3lock -k -B --blur --veriftext=Revisando --wrongtext=Incorrecto --keylayout 1 --insidevercolor=00ff38ff --insidewrongcolor=c10000ff --insidecolor=ffffff40 --ringvercolor=0020ffff --ringwrongcolor=e8df02ff --ringcolor=404090ff --linecolor=ffffffff --keyhlcolor=30ccccff --bshlcolor=ff8000ff --timecolor=000000ff diff --git a/varios/lock.bak b/varios/lock.bak new file mode 100755 index 0000000..ee485dd --- /dev/null +++ b/varios/lock.bak @@ -0,0 +1,26 @@ +#!/bin/sh + +## V0.2 + +# Para poder utilizar la siguiente configuración se necesita de los siguiente: +# 1. i3lock +# 2. scrot +# 3. imagemagick +# 4. xautolock (opcional) + +## Realizar captura de pantalla +#scrot /tmp/screenshot.png; + +## Aplicar efecto difuso a imagen con ayuda de imagemagick +#convert /tmp/screenshot.png -blur 0x4 /tmp/screenshotblur.png; + +## Utilizar imagen previa con i3lock +#i3lock -i /tmp/screenshotblur.png + +## Para configurar el bloqueo automático de la pantalla se utiliza xautolock +#xautolock -time 10 locker lock + +#------------------------------------------------------------------------------------------------------------------------- + +## Esta configuración funciona con i3lock-color +sleep 1; i3lock -k -B --blur=sigma --veriftext=Revisando --wrongtext=Incorrecto --keylayout 1 --insidevercolor=00ff38ff --insidewrongcolor=c10000ff --insidecolor=ffffff40 --ringvercolor=0020ffff --ringwrongcolor=e8df02ff --ringcolor=404090ff --linecolor=ffffffff --keyhlcolor=30ccccff --bshlcolor=ff8000ff --timecolor=000000ff diff --git a/varios/menu-apagar b/varios/menu-apagar new file mode 100755 index 0000000..baea419 --- /dev/null +++ b/varios/menu-apagar @@ -0,0 +1,24 @@ +#!/bin/sh + +RET=$(echo "" Apagar"\n" Reiniciar"\n" Bloquear"\n" Suspender"\n" Hibernar"\n" logout"\ncancel" | dmenu -l 7 -p " Logout") +case $RET in + " Apagar") + doas shutdown -h now + ;; + " Reiniciar") + doas shutdown -r now + ;; + " Bloquear") + slock + ;; + " Suspender") + slock && doas zzz + ;; + " Hibernar") + slock && doas ZZZ + ;; + " logout") + xdotool key "super+shift+q" + ;; + *) ;; +esac diff --git a/varios/popup-calendar b/varios/popup-calendar new file mode 100755 index 0000000..c9c01b8 --- /dev/null +++ b/varios/popup-calendar @@ -0,0 +1,41 @@ +#!/bin/sh + +BAR_HEIGHT=22 # polybar height +BORDER_SIZE=1 # border size from your wm settings +YAD_WIDTH=222 # 222 is minimum possible value +YAD_HEIGHT=193 # 193 is minimum possible value +DATE="$(date +"%a %d/%b/%Y - %R")" + +case "$1" in +--popup) + if [ "$(xdotool getwindowfocus getwindowname)" = "yad-calendar" ]; then + exit 0 + fi + + eval "$(xdotool getmouselocation --shell)" + eval "$(xdotool getdisplaygeometry --shell)" + + # X + if [ "$((X + YAD_WIDTH / 2 + BORDER_SIZE))" -gt "$WIDTH" ]; then #Right side + : $((pos_x = WIDTH - YAD_WIDTH - BORDER_SIZE)) + elif [ "$((X - YAD_WIDTH / 2 - BORDER_SIZE))" -lt 0 ]; then #Left side + : $((pos_x = BORDER_SIZE)) + else #Center + : $((pos_x = X - YAD_WIDTH / 2)) + fi + + # Y + if [ "$Y" -gt "$((HEIGHT / 2))" ]; then #Bottom + : $((pos_y = HEIGHT - YAD_HEIGHT - BAR_HEIGHT - BORDER_SIZE)) + else #Top + : $((pos_y = BAR_HEIGHT + BORDER_SIZE)) + fi + + yad --calendar --undecorated --fixed --close-on-unfocus --no-buttons \ + --width=$YAD_WIDTH --height=$YAD_HEIGHT --posx=$pos_x --posy=$pos_y \ + --title="yad-calendar" --borders=0 >/dev/null & + ;; +*) + echo "$DATE" + ;; +esac diff --git a/varios/screenshot b/varios/screenshot new file mode 100755 index 0000000..581e7ce --- /dev/null +++ b/varios/screenshot @@ -0,0 +1,12 @@ +#!/bin/sh + +Seleccionar=$(echo "Portapapeles\nGuardar\ncancel" | dmenu -l 3 -p "Screenshot") +case $Seleccionar in + "Portapapeles") + scrot -s /tmp/'select-%F_%T.png' -e 'xclip -selection c -t image/png < $f' + ;; + "Guardar") + scrot -s -d 2 -q 100 'Select_%F_%H%M%S_$wx$h.png' -e 'mv $f /home/skynet/Datos/Capturas/select'; sleep 1; exec notify-send -t 5000 --icon=/home/skynet/.icons/workspace.png 'Área seleccionda' 'guardada en: ~/Datos/Capturas/select' + ;; + *) ;; +esac diff --git a/varios/statusbar b/varios/statusbar new file mode 100755 index 0000000..c043a88 --- /dev/null +++ b/varios/statusbar @@ -0,0 +1,13 @@ +#!/bin/sh + +while true; do + DATE=$(date +" %a %d %b  %R") + MEM=$(free -h | awk '/^Mem:/ {print $3}') + CPU=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}') + BATTERY=$(acpi -b | awk '{print $3, $4}' | tr -d ',') + CLIMA=$(curl -s wttr.in/$LOCATION?format=1 | grep -o "[0-9].*") + BRILLO=$(light) + PAPELERA=$(find ~/.local/share/Trash/files/ -maxdepth 1 | wc -l) + xsetroot -name " $CLIMA | $MEM | $CPU | ☀ $BRILLO |  $PAPELERA | $BATTERY | $DATE" + sleep 60 +done diff --git a/varios/trash b/varios/trash new file mode 100755 index 0000000..077c48e --- /dev/null +++ b/varios/trash @@ -0,0 +1,3 @@ +#!/bin/sh +## Buscar en el directorio actual de forma no recursiva +find ~/.local/share/Trash/files/ -maxdepth 1 | wc -l diff --git a/varios/updates-void b/varios/updates-void new file mode 100755 index 0000000..5eb3e60 --- /dev/null +++ b/varios/updates-void @@ -0,0 +1,26 @@ +#!/bin/sh + +lista=$(xbps-install -nuM | awk '{print $1}' ) +lista2=$(xbps-install -nuM | awk '{print $1}' | tail -n 10 ) +updates=$(xbps-install -nuM | wc -l) + +if [ "$updates" -eq 1 ]; then + notify-send -i "$HOME/.icons/status/package-upgrade.png" "Hay una actualización disponible:" "$lista" + echo "$updates" +elif [ "$updates" -le 5 ] && [ "$updates" -gt 1 ]; then + notify-send -i "$HOME/.icons/status/package-upgrade.png" "Hay $updates actualizaciones disponibles:" "$lista" + echo "$updates" +elif [ "$updates" -gt 5 ]; then + notify-send -i "$HOME/.icons/status/package-upgrade.png" "Hay $updates actualizaciones disponibles:" "$lista2 \n..." + echo "$updates" +else + echo "" +fi + +sleep 180; +if [ -n "$updates" ] && [ "$updates" -lt 1 ]; then + echo "" +else + echo "$updates" +fi + diff --git a/varios/wallpaper b/varios/wallpaper new file mode 100755 index 0000000..99188a6 --- /dev/null +++ b/varios/wallpaper @@ -0,0 +1,4 @@ +#!/bin/sh + +## Establecer un wallpaper aleatorio utilizando 'feh' +feh --bg-fill --randomize --no-fehbg $HOME/Wallpaper/* &