Skip to content

Commit

Permalink
add dbus session in the script instead of cron
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinkumar-me committed Sep 2, 2024
1 parent 5462ed1 commit 526a524
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/scripts/battery-warning.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus

battery_stat="$(acpi --battery)"
battery_greped_status="$(echo $battery_stat | grep -Pio 'remaining|charged')"
battery_percentage_v="$(echo $battery_stat | grep -Po '(\d+%)' | grep -Po '\d+')"
Expand Down

0 comments on commit 526a524

Please sign in to comment.