Long time, no commit, big ol' changes though
This commit is contained in:
parent
3c9e2c3279
commit
501f1f4066
19 changed files with 271 additions and 352 deletions
55
config/i3/batteryNotify
Executable file
55
config/i3/batteryNotify
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
BATT="/sys/class/power_supply/BAT0"
|
||||
LOW=10
|
||||
CRIT=3
|
||||
LASTSTATE="$HOME/.cache/batteryState"
|
||||
|
||||
function setState() { # state [...notify-send arguments]
|
||||
state="$1"
|
||||
last="$(cat "$LASTSTATE" 2> /dev/null)"
|
||||
shift
|
||||
|
||||
echo "Battery state: $state"
|
||||
|
||||
if [ "$state" != "$last" ]
|
||||
then
|
||||
notify-send "$@"
|
||||
echo "$state" > "$LASTSTATE"
|
||||
fi
|
||||
}
|
||||
|
||||
function computeState() {
|
||||
acpiStatus="$(cat "$BATT/status")"
|
||||
acpiCapacity="$(cat "$BATT/capacity")"
|
||||
|
||||
if [ "$acpiStatus" == "Discharging" ]
|
||||
then
|
||||
if [ $acpiCapacity -le $CRIT ]
|
||||
then
|
||||
setState "CRIT" -u critical -i battery-caution "Battery level is critical" "$acpiCapacity %"
|
||||
elif [ $acpiCapacity -le $LOW ]
|
||||
then
|
||||
setState "LOW" -u critical -i battery-low "Battery level is low" "$acpiCapacity %"
|
||||
else
|
||||
setState "DISCHARGING" -i battery-good "Battery is discharging" "$acpiCapacity %"
|
||||
fi
|
||||
elif [ "$acpiStatus" == "Charging" ]
|
||||
then
|
||||
setState "CHARGING" -u normal -i battery-good-charging "Battery is charging" "$acpiCapacity %"
|
||||
elif [ "$acpiStatus" == "Full" ]
|
||||
then
|
||||
setState "FULL" -u low -i battery-full-charged "Battery is full" "$acpiCapacity %"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" == "-d" ]
|
||||
then
|
||||
while true
|
||||
do
|
||||
computeState
|
||||
sleep 10
|
||||
done
|
||||
else
|
||||
computeState
|
||||
fi
|
|
@ -22,8 +22,7 @@ hide_edge_borders both
|
|||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
|
||||
font pango:Source Code Pro 8
|
||||
font pango:DejaVu Sans Mono 8
|
||||
font pango:DejaVu Sans 8
|
||||
font pango:Sans 8
|
||||
|
||||
# Use Mouse+$mod to drag floating windows
|
||||
|
@ -361,18 +360,17 @@ bindsym $mod+F5 exec --no-startup-id xautolock -enable
|
|||
|
||||
|
||||
# Autostart applications
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering
|
||||
exec --no-startup-id gnome-keyring-daemon # Password remembering
|
||||
#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering
|
||||
#exec --no-startup-id gnome-keyring-daemon # Password remembering
|
||||
exec --no-startup-id numlockx on # Activate Num lock
|
||||
#exec --no-startup-id nm-applet # Network manager tray icon
|
||||
#exec --no-startup-id compton -b # Compositing manager
|
||||
exec --no-startup-id unclutter # Hide mouse cursor after some time
|
||||
exec --no-startup-id dunst # Notifications
|
||||
#exec --no-startup-id dunst # Notifications (handled by systemd)
|
||||
exec --no-startup-id keynav # Keyboard cursor controller
|
||||
#exec --no-startup-id $HOME/.config/i3/clipmenud # Clipboard manager
|
||||
exec --no-startup-id mpd # Music Player Daemon
|
||||
#exec --no-startup-id mpd # Music Player Daemon (handled by systemd)
|
||||
exec --no-startup-id ~/.config/i3/ashuffle # MPD Auto-refill
|
||||
exec --no-startup-id autorandr --change # Screen configuration and everything that depends on it
|
||||
exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification
|
||||
|
||||
set $ignore #ff00000
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue