Skip to content

Commit

Permalink
update image
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Sep 6, 2023
1 parent 42716e6 commit 7f1dc16
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-wor
- live
- template
- main
- modular-rewrite
paths-ignore: # don't rebuild if only documentation has changed
- "**.md"
pull_request:
Expand Down
29 changes: 29 additions & 0 deletions config/files/usr/bin/battery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Low battery notifier

# Kill already running processes
already_running="$(ps -fC 'grep' -N | grep 'battery.sh' | wc -l)"
if [[ $already_running -gt 1 ]]; then
pkill -f --older 1 'battery.sh'
fi

while [[ 0 -eq 0 ]]; do
battery_status="$(cat /sys/class/power_supply/BAT1/status)"
battery_charge="$(cat /sys/class/power_supply/BAT1/capacity)"

if [[ $battery_status == 'Discharging' ]]; then
if [[ $battery_charge -le 10 ]]; then
notify-send "Battery Critical!" "Battery is at ${battery_charge}%" --app-name "Power Alerts" --urgency "critical" --icon "battery-000"
pw-cat -p /usr/share/sounds/speech-dispatcher/prompt.wav
powerprofilesctl set power-saver
sleep 180
elif [[ $battery_charge -le 25 ]]; then
notify-send "Battery Low!" "Battery is at ${battery_charge}%" --app-name "Power Alerts" --urgency "critical" --icon "battery-010"
pw-cat -p /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
powerprofilesctl set power-saver
sleep 240
fi
else
sleep 600
fi
done
5 changes: 2 additions & 3 deletions config/files/usr/etc/sway/config.d/execs.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


exec /usr/bin/battery.sh
exec blueman-applet
exec nm-applet
exec wl-paste --watch cliphist store
Expand All @@ -12,6 +12,5 @@ exec /usr/bin/sway-autoname-workspaces.py
before-sleep '/usr/bin/lock.sh'

exec /usr/libexec/polkit-gnome-authentication-agent-1
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway XCURSOR_THEME=$XCURSOR_THEME XCURSOR_SIZE=$XCURSOR_SIZE
exec systemd-notify --ready

2 changes: 1 addition & 1 deletion config/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ modules:
- type: files
files:
- usr: /usr

# Copy static configurations and component files.
# Warning: If you want to place anything in "/etc" of the final image, you MUST
# place them in "./usr/etc" in your repo, so that they're written to "/usr/etc"
Expand All @@ -27,6 +26,7 @@ modules:
- from-file: packages.yml
- from-file: bling.yml
- from-file: yafti.yml
- from-file: systemd.yml

- type: script
scripts:
Expand Down
7 changes: 7 additions & 0 deletions config/systemd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: systemd
system:
enabled:
- power-profiles-daemon
- mullvad-daemon
disabled:
- rpm-ostree-countme.timer

0 comments on commit 7f1dc16

Please sign in to comment.