add eww config (fix broken package structure)

This commit is contained in:
Jonas H
2026-02-27 23:38:51 +01:00
parent deb0457d7c
commit 64a95d0cf4
19 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
## Get battery info
BATTERY="$(acpi | awk -F ' ' 'NR==1 {print $4; exit}' | tr -d \%,)"
CHARGE="$(acpi | awk -F ' ' 'END {print $3}' | tr -d \,)"
main() {
if [[ ($CHARGE = *"Charging"*) && ($BATTERY -lt "100") ]]; then
echo "󱐋"
elif [[ $CHARGE = *"Full"* ]]; then
echo ""
else
if [[ ($BATTERY -lt 100) && (($BATTERY -gt 65) || ($BATTERY -eq 65)) ]]; then
echo ""
elif [[ ($BATTERY -lt 65) && (($BATTERY -gt 35) || ($BATTERY -eq 35)) ]]; then
echo ""
elif [[ ($BATTERY -lt 35) && (($BATTERY -gt 10) || ($BATTERY -eq 10)) ]]; then
echo ""
elif [[ ($BATTERY -lt 10) && (($BATTERY -gt 0) || ($BATTERY -eq 0)) ]]; then
echo ""
fi
fi
}
if [[ $1 == '--icon' ]]; then
main
elif [[ $1 == '--perc' ]]; then
echo "${BATTERY}%"
fi

View File

@@ -0,0 +1,13 @@
#!/bin/bash
get_icon() {
bash ~/.config/eww/scripts/battery --icon
}
# Output initial state
get_icon
# Monitor battery events using upower
upower --monitor | while read -r line; do
get_icon
done

View File

@@ -0,0 +1,13 @@
#!/bin/bash
get_perc() {
bash ~/.config/eww/scripts/battery --perc
}
# Output initial state
get_perc
# Monitor battery events using upower
upower --monitor | while read -r line; do
get_perc
done

View File

@@ -0,0 +1,13 @@
#!/bin/bash
get_time() {
acpi -b | grep -oP '\d{2}:\d{2}:\d{2}' || echo "Calculating..."
}
# Output initial state
get_time
# Monitor battery events using upower
upower --monitor | while read -r line; do
get_time
done

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Get current brightness percentage
get_brightness() {
local current=$(brightnessctl get)
local max=$(brightnessctl max)
echo $((current * 100 / max))
}
# Output initial brightness
get_brightness
# Monitor brightness changes
inotifywait -m -e modify /sys/class/backlight/*/brightness 2>/dev/null | while read -r; do
get_brightness
done

View File

@@ -0,0 +1,8 @@
#!/bin/bash
current=$1
direction=$2
if [ "$direction" = "up" ]; then
swaymsg workspace number $((current + 1))
elif [ "$direction" = "down" ]; then
swaymsg workspace number $((current - 1))
fi

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Function to get focused workspace
get_focused() {
swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true) | .num'
}
# Output initial state
get_focused
# Subscribe to workspace events and output updates
swaymsg -t subscribe -m '["workspace"]' | while read -r event; do
get_focused
done

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Function to get and format workspaces
get_workspaces() {
swaymsg -t get_workspaces | jq -c '[.[] | {id: .num, output: .output, focused: .focused, visible: .visible, urgent: .urgent}]'
}
# Output initial state
get_workspaces
# Subscribe to workspace events and output updates
swaymsg -t subscribe -m '["workspace"]' | while read -r event; do
get_workspaces
done

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Toggle notification history display (mako version)
# Shows up to 10 previous notifications, or closes all if any are displayed
# Check if there are any notifications currently displayed
displayed=$(makoctl list 2>/dev/null | grep -c "^Notification" 2>/dev/null)
if [ "$displayed" -gt 0 ]; then
# If notifications are showing, dismiss them all
makoctl dismiss -a
else
# If no notifications are showing, restore up to 10 from history
for i in {1..10}; do
makoctl restore 2>/dev/null || break
done
fi

View File

@@ -0,0 +1,6 @@
#!/bin/sh
if [ "$1" = "wifi" ]; then
alacritty -e nmtui
fi

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Get current volume percentage
get_volume() {
pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+%' | head -1 | tr -d '%'
}
# Output initial volume
get_volume
# Subscribe to volume changes
pactl subscribe | grep --line-buffered "sink" | while read -r line; do
get_volume
done

View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Get current mute state and return appropriate icon
get_volume_icon() {
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -o 'yes\|no')
if [ "$muted" = "yes" ]; then
echo " "
else
echo ""
fi
}
# Output initial icon
get_volume_icon
# Subscribe to volume changes (including mute/unmute)
pactl subscribe | grep --line-buffered "sink" | while read -r line; do
get_volume_icon
done

View File

@@ -0,0 +1,13 @@
#!/bin/sh
symbol() {
[ $(cat /sys/class/net/w*/operstate) = down ] && echo 󰪎 && exit
echo 󰖟
}
name() {
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
}
[ "$1" = "icon" ] && symbol && exit
[ "$1" = "name" ] && name && exit

View File

@@ -0,0 +1,13 @@
#!/bin/bash
get_icon() {
[ $(cat /sys/class/net/w*/operstate 2>/dev/null) = down ] && echo "󰪎" || echo "󰖟"
}
# Output initial state
get_icon
# Monitor network changes
nmcli monitor | while read -r line; do
get_icon
done

View File

@@ -0,0 +1,13 @@
#!/bin/bash
get_name() {
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
}
# Output initial state
get_name
# Monitor network changes
nmcli monitor | while read -r line; do
get_name
done