mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2024-12-22 15:19:37 +01:00
Compare commits
4 Commits
072fa544e7
...
3c91c43fdf
Author | SHA1 | Date | |
---|---|---|---|
3c91c43fdf | |||
e030b16b8f | |||
328b1eb452 | |||
c0861925f2 |
19
.config/crontab
Normal file
19
.config/crontab
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# DISPLAY=:0
|
||||||
|
XDG_RUNTIME_DIR=/run/user/1000
|
||||||
|
|
||||||
|
|
||||||
|
# Example of job definition:
|
||||||
|
# .---------------- minute (0 - 59)
|
||||||
|
# | .------------- hour (0 - 23)
|
||||||
|
# | | .---------- day of month (1 - 31)
|
||||||
|
# | | | .------- month (1 - 12) OR Jan-Dec
|
||||||
|
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR SUN-SAT
|
||||||
|
# | | | | |
|
||||||
|
# * * * * * user-name command to be executed
|
||||||
|
|
||||||
|
# * any value
|
||||||
|
# , value list separator
|
||||||
|
# - range of values
|
||||||
|
# / step values
|
||||||
|
|
||||||
|
* * * * * /home/sahin/scripts/check-battery.sh 10
|
@ -1 +1 @@
|
|||||||
Subproject commit 7f999024a5bbfaf0bdf7a4e493a3658db5b97ee2
|
Subproject commit 20dfe30e960d98db2c259a355ecef96f43ca6021
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -12,5 +12,5 @@
|
|||||||
branch = linux
|
branch = linux
|
||||||
[submodule ".config/zsh"]
|
[submodule ".config/zsh"]
|
||||||
path = .config/zsh
|
path = .config/zsh
|
||||||
url = https://github.com/sahinakkaya/zsh.git
|
url = https://github.com/sahinakkaya/zsh-config.git
|
||||||
branch = linux
|
branch = linux
|
||||||
|
4
.zshenv
4
.zshenv
@ -1,3 +1,3 @@
|
|||||||
export ZDOTDIR="$HOME/.config/zsh"
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}"
|
||||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
export ZDOTDIR="${ZDOTDIR:=$XDG_CONFIG_HOME/zsh}"
|
||||||
export PATH="$HOME/scripts/:$HOME/.local/bin/:$PATH"
|
export PATH="$HOME/scripts/:$HOME/.local/bin/:$PATH"
|
||||||
|
20
scripts/check-battery.sh
Executable file
20
scripts/check-battery.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Set limit to shell argument
|
||||||
|
batteryLimit=$1
|
||||||
|
fullAt=92
|
||||||
|
|
||||||
|
# Get the current battery level with acpi
|
||||||
|
batteryLevel=$(acpi | cut -d ' ' -f 4 | tr -d '%|,| ')
|
||||||
|
charging=$(acpi | cut -d ' ' -f 3 | tr -d ',| ')
|
||||||
|
|
||||||
|
echo $batteryLevel
|
||||||
|
|
||||||
|
if [[ "$batteryLevel" -le "$batteryLimit" ]] && [[ "$charging" == "Discharging" ]]; then
|
||||||
|
/usr/bin/notify-send -a "Battery Warning" --urgency critical "Battery level at ${batteryLevel}%" -i abrt -t 10000
|
||||||
|
/usr/bin/mpv /usr/share/sounds/Oxygen-Sys-Warning.ogg
|
||||||
|
# /usr/bin/aplay /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
|
||||||
|
#elif [[ "$batteryLevel" -gt "$fullAt" ]] && [[ ! "$charging" == "Discharging" ]]; then
|
||||||
|
# /usr/bin/notify-send -a "Battery Warning" "Battery is full: ${batteryLevel}" -i abrt -t 10000
|
||||||
|
# /usr/bin/paplay /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user