This commit is contained in:
天クマ 2025-12-18 12:09:34 -03:00
commit c8734e660a
392 changed files with 21043 additions and 0 deletions

View file

@ -0,0 +1,45 @@
#!/bin/sh
PATH_AC="/sys/class/power_supply/AC"
PATH_BATTERY_0="/sys/class/power_supply/BAT0"
PATH_BATTERY_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$PATH_AC/online" ]; then
ac=$(cat "$PATH_AC/online")
fi
if [ -f "$PATH_BATTERY_0/energy_now" ]; then
battery_level_0=$(cat "$PATH_BATTERY_0/energy_now")
fi
if [ -f "$PATH_BATTERY_0/energy_full" ]; then
battery_max_0=$(cat "$PATH_BATTERY_0/energy_full")
fi
if [ -f "$PATH_BATTERY_1/energy_now" ]; then
battery_level_1=$(cat "$PATH_BATTERY_1/energy_now")
fi
if [ -f "$PATH_BATTERY_1/energy_full" ]; then
battery_max_1=$(cat "$PATH_BATTERY_1/energy_full")
fi
battery_level=$(("$battery_level_0 + $battery_level_1"))
battery_max=$(("$battery_max_0 + $battery_max_1"))
battery_level=$(("$battery_level_0"))
battery_max=$(("$battery_max_0"))
battery_percent=$(("$battery_level * 100"))
battery_percent=$(("$battery_percent / $battery_max"))
if ([ $battery_percent -eq 10 ] || [ $battery_percent -eq 6 ]) && [ "$ac" -eq 0 ]
then
notify-send -u normal -i battery-level-10-symbolic "Arch Linux" "$battery_percent battery left."
fi

View file

@ -0,0 +1,24 @@
#!/bin/bash
updates_yay=$(yay -Qu --aur 2> /dev/null | wc -l)
updates_pacman=$(checkupdates 2> /dev/null | wc -l)
updates=$((updates_pacman + updates_yay))
if [ "$updates" -gt 0 ]; then
if [ "$updates_yay" -eq 1 ]; then
echo "<big></big> $updates"
notify-send -u normal -i software-update-available-symbolic "$updates_yay update available from AUR" "$(yay -Qu --aur)"
fi
if [ "$updates_pacman" -eq 1 ]; then
echo "<big></big> $updates"
notify-send -u normal -i software-update-available-symbolic "$updates_pacman update available from pacman" "$(checkupdates)"
fi
if [ "$updates_yay" -gt 1 ]; then
echo "<big></big> $updates"
notify-send -u normal -i software-update-available-symbolic "$updates_yay updates available from AUR" "$(yay -Qu --aur)"
fi
if [ "$updates_pacman" -gt 1 ]; then
echo "<big></big> $updates"
notify-send -u normal -i software-update-available-symbolic "$updates_pacman updates available from pacman" "$(checkupdates)"
fi
fi

View file

@ -0,0 +1,15 @@
#!/bin/bash
# Server and mail adress are defined with credentials in ~/.netrc
SERVER="$(head -1 ~/.netrc | awk '{print $2}')"
INBOX=$(curl --netrc -X "STATUS INBOX (UNSEEN)" imaps://$SERVER/INBOX | tr -d -c "[:digit:]")
if [ $INBOX ] && [ $INBOX -gt 0 ] ; then
if [ $INBOX -eq 1 ] ; then
echo "<big></big> $INBOX"
notify-send -i mail-unread-symbolic "Thunderbird" "You have an unread e-mail."
else
echo "<big></big> $INBOX"
notify-send -i mail-unread-symbolic "Thunderbird" "You have $INBOX unread e-mail."
fi
fi

View file

@ -0,0 +1,27 @@
#!/bin/bash
player_status=$(playerctl status)
player_name=$(playerctl metadata --format "{{ playerName }}")
artist=$(playerctl metadata --format "{{ artist }}")
title=$(playerctl metadata --format "{{ title }}")
duration=$(playerctl metadata --format "{{ duration(position) }} / {{ duration(mpris:length) }}")
firefox_status=$(playerctl --player=firefox status)
spotify_status=$(playerctl --player=spotify status)
if [ "$player_name" == "spotify" ]; then
echo "<big></big> $artist - $title - [$duration]"
elif [ "$player_name" == "firefox" ]; then
if [ "$artist" == "" ]; then
echo "<big></big> $title"
else
echo "<big></big> $artist - $title"
fi
else
if [ "$player_status" == "Playing" ]; then
echo "<big></big> $artist - $title"
else
echo ""
fi
fi

View file

@ -0,0 +1,23 @@
#!/bin/bash
option0=" Lock"
option1="󰗽 Logout"
option2=" Suspend"
option3=" Reboot"
option4=" Shutdown"
options="$option0\n$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
chosen="$(echo -e "$options" | fuzzel --lines 5 --dmenu)"
case $chosen in
$option0)
swaylock;;
$option1)
swaymsg exit;;
$option2)
systemctl suspend;;
$option3)
systemctl reboot;;
$option4)
systemctl poweroff;;
esac

View file

@ -0,0 +1,6 @@
#!/bin/bash
system="$(uptime | awk '{print $3}' | tr -d \,)"
user=$(whoami)
echo "<big></big> ${user^}<big></big>$system"

View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
# Terminate already running instances
killall -q waybar
# Wait until the processes have been shut down
while pgrep -x waybar >/dev/null; do sleep 1; done
# Launch main
waybar

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
text=$(curl -s "https://wttr.in/$1?format=%c+%f+%m")
if [[ $? == 0 ]]
then
text=$(echo "$text" | sed -E "s/\s+/ /g")
tooltip=$(curl -s "https://wttr.in/$1?format=%l:+%C+%c+%t+%w+%m")
if [[ $? == 0 ]]
then
tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g")
echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}"
exit
fi
fi
echo "{\"text\":\"Service Unavailable\", \"tooltip\":\"Service Unavailable\"}"