Merge branch 'dev' into gentoo

cleanup mpd config
set custom lyrics path for ncmpcpp
add alias to upgrade pip
only notify low battery on BAT0
This commit is contained in:
David JULIEN 2021-09-23 23:32:58 +02:00
commit 121d454e19
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
4 changed files with 19 additions and 18 deletions

View File

@ -19,3 +19,4 @@ alias swytch@site='ssh swytch@davidjulien.xyz'
alias dotfiles='/usr/bin/git --git-dir=$DOTFILES --work-tree=$HOME' alias dotfiles='/usr/bin/git --git-dir=$DOTFILES --work-tree=$HOME'
alias abcde='abcde -c $XDG_CONFIG_HOME/abcde/config' alias abcde='abcde -c $XDG_CONFIG_HOME/abcde/config'
alias abook='abook --config $XDG_CONFIG_HOME/abook/abookrc --datafile "$XDG_DATA_HOME"/abook/addressbook' alias abook='abook --config $XDG_CONFIG_HOME/abook/abookrc --datafile "$XDG_DATA_HOME"/abook/addressbook'
alias pip-upgrade="pip freeze --user | cut -d'=' -f1 | xargs -n1 pip install -U"

View File

@ -1,29 +1,29 @@
# Recommended location for database # Recommended location for database
db_file "~/.config/mpd/database" db_file "~/.config/mpd/database"
# Logs to systemd journal # Logs to systemd journal
log_file "syslog" log_file "syslog"
# The music directory is by default the XDG directory, uncomment to amend and choose a different directory # The music directory is by default the XDG directory, uncomment to amend and choose a different directory
music_directory "~/music" music_directory "~/music"
# Uncomment to refresh the database whenever files in the music_directory are changed # Uncomment to refresh the database whenever files in the music_directory are changed
auto_update "yes" auto_update "yes"
# Uncomment to enable the functionalities # Uncomment to enable the functionalities
playlist_directory "~/.config/mpd/playlists" playlist_directory "~/.config/mpd/playlists"
pid_file "~/.config/mpd/pid" pid_file "~/.config/mpd/pid"
#state_file "~/.config/mpd/state" #state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql" sticker_file "~/.config/mpd/sticker.sql"
audio_output { audio_output {
type "pulse" type "pulse"
name "pulse audio" name "pulse audio"
} }
audio_output { audio_output {
type "fifo" type "fifo"
name "my_fifo" name "my_fifo"
path "/tmp/mpd.fifo" path "/tmp/mpd.fifo"
format "44100:16:2" format "44100:16:2"
} }

View File

@ -19,7 +19,7 @@
## MPD clients (eg. ncmpc) also use that location. ## MPD clients (eg. ncmpc) also use that location.
## ##
# #
#lyrics_directory = ~/.lyrics lyrics_directory = ~/music/.lyrics
# #
##### connection settings ##### ##### connection settings #####
# #

View File

@ -25,8 +25,8 @@ notify() { \
fi fi
[ 300 -gt $delta ] && return; [ 300 -gt $delta ] && return;
echo $now > $XDG_CONFIG_HOME/batteryupdate echo $now > $XDG_CONFIG_HOME/batteryupdate
case "$total" in case "$capacity" in
[2-3][0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;; 2[0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;;
*) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - <b>NOW!</b>" ;; *) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - <b>NOW!</b>" ;;
esac esac
} }
@ -52,7 +52,7 @@ do
[2-3][0-9]) status="" ;; [2-3][0-9]) status="" ;;
*) status="" ;; *) status="" ;;
esac esac
[ 40 -gt $total ] && notify; [ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
fi fi
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity"; printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
fi fi