Compare commits
No commits in common. "a57cebca9798de57b222adf070fa78389f6d4e2f" and "231feb4c1107f5ec80068955e57bf557299ad6d3" have entirely different histories.
a57cebca97
...
231feb4c11
8 changed files with 30 additions and 43 deletions
|
@ -217,7 +217,7 @@ URxvt.keysym.C-equal: resize-font:reset
|
|||
URxvt.keysym.C-question: resize-font:show
|
||||
URxvt.keysym.M-s: searchable-scrollback:start
|
||||
URxvt.resize-font.step: 2
|
||||
URxvt.refreshRate: 60
|
||||
URxvt.refreshRate: 240
|
||||
|
||||
! Base16 Eighties
|
||||
! Scheme: Chris Kempson (http://chriskempson.com)
|
||||
|
|
|
@ -371,10 +371,10 @@ exec --no-startup-id urxvtc -name newsboat -e newsboat
|
|||
exec --no-startup-id redshift-gtk
|
||||
exec --no-startup-id nm-applet
|
||||
exec --no-startup-id system-config-printer-applet
|
||||
exec --no-startup-id steam-native -silent -noverifyfiles -language french
|
||||
exec --no-startup-id sleep 1m && steam-native -silent -noverifyfiles -language french
|
||||
#exec --no-startup-id SVPManager
|
||||
#exec --no-startup-id hp-systray -x
|
||||
exec --no-startup-id sleep 20 && pamixer --set-volume 40 && play "$HOME/Musique/WELCOME BACK.wav"
|
||||
exec --no-startup-id sleep 1m && play "$HOME/Musique/WELCOME BACK.wav"
|
||||
exec --no-startup-id variety
|
||||
#exec --no-startup-id sleep 5m && qbittorrent
|
||||
|
||||
|
|
|
@ -201,10 +201,6 @@ interval=60
|
|||
|
||||
[bepo]
|
||||
interval=60
|
||||
separator=false
|
||||
|
||||
[screen_freq]
|
||||
interval=once
|
||||
|
||||
[beep]
|
||||
interval=once
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# Vidéo
|
||||
profile=gpu-hq
|
||||
gpu-context=x11vk
|
||||
scale=ewa_lanczossharp
|
||||
cscale=ewa_lanczossharp
|
||||
#video-sync=display-resample
|
||||
|
|
|
@ -13,8 +13,8 @@ runtime="${XDG_RUNTIME_DIR}/i3blocks"
|
|||
case $button in
|
||||
1) setxkbmap fr bepo_afnor; echo "bépo" > "$runtime/keyboard";;
|
||||
#1) xmodmap ~/.Xmodmap; echo "bépo" > "$runtime/keyboard";;
|
||||
2) setxkbmap fr us; echo "qwer" > "$runtime/keyboard";;
|
||||
3) setxkbmap fr oss; echo "oss " > "$runtime/keyboard";;
|
||||
2) setxkbmap fr oss; echo "oss " > "$runtime/keyboard";;
|
||||
3) setxkbmap fr us; echo "qwer" > "$runtime/keyboard";;
|
||||
esac
|
||||
} &>/dev/null
|
||||
cat "$runtime/keyboard"
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
{
|
||||
runtime="${XDG_RUNTIME_DIR}/i3blocks"
|
||||
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
|
||||
|
||||
[[ ! -f "$runtime/screen_freq" ]] && [[ -z "$button" ]] && button=1
|
||||
|
||||
case $button in
|
||||
1) xrandr --rate 60; echo "60" > "$runtime/screen_freq";;
|
||||
3) xrandr --rate 240; echo "240" > "$runtime/screen_freq";;
|
||||
esac
|
||||
} &>/dev/null
|
||||
cat "$runtime/screen_freq"
|
|
@ -4,8 +4,7 @@ export MPD_HOST="$HOME/.mpd/socket"
|
|||
DUNST_ID=$(sum <<<"mpd" | cut -d' ' -f1)
|
||||
|
||||
# Déclaration des variables globales
|
||||
declare -- prevfile
|
||||
declare -a -- infos
|
||||
declare -- cursong prevsong
|
||||
|
||||
# Tant que le service MPD fonctionne
|
||||
while systemctl --user is-active mpd.service &>/dev/null
|
||||
|
@ -13,17 +12,24 @@ do
|
|||
# Toutes les 5 secondes, ou dès que le morceau se termine
|
||||
timeout 5 mpc -w current
|
||||
|
||||
prevfile="${infos[3]}"
|
||||
mapfile -t infos < <(mpc -f '[%artist%|%name%]\n%title%\n%album%\n%file%\n%time%' current)
|
||||
prevsong="$cursong"
|
||||
cursong="$(mpc -f '[[%artist%\n|%name%\n]%title%[\n%album%]]|[%file%]' current)"
|
||||
|
||||
# Si le morceau a changé depuis la dernière vérification
|
||||
if [[ "${infos[3]}" != "$prevfile" && "$title" != "<i>Arrêt</i>" ]]
|
||||
if [[ "$cursong" != "$prevsong" && "$prevsong" != "<i>Arrêt</i>" ]]
|
||||
then
|
||||
|
||||
artist="${infos[0]}"
|
||||
title="${infos[1]:-${infos[3]}}"
|
||||
album="${infos[2]}"
|
||||
length="$(( ${infos[4]%%:*} * 60 + ${infos[4]##*:} ))"
|
||||
# Extractions des informations depuis la chaîne récupérée plus
|
||||
# tôt, vers un format plus lisible.
|
||||
artist="$(sed -n 1p <<<"$cursong")"
|
||||
title="$(sed -n 2p <<<"$cursong")"
|
||||
album="$(sed -n 3p <<<"$cursong")"
|
||||
|
||||
# Petit trick : si le titre s’est retrouvé sur la première
|
||||
# ligne parce qu’il n’y a pas d’artiste renseigné, on corrige
|
||||
# le contenu des variables (pas forcément fiable, mais
|
||||
# chez moi ça marche™).
|
||||
[[ -z "$title" ]] && title="$artist" && artist=""
|
||||
|
||||
# Si on obtiens un chemin absolu, on n’affiche que le nom, pas
|
||||
# le chemin.
|
||||
|
@ -31,22 +37,21 @@ do
|
|||
|
||||
# Si aucune information n’est retournée, c’est que la lecture
|
||||
# s’est arrêtée.
|
||||
if [[ "${#infos[@]}" -eq 0 ]]
|
||||
if [[ -z "$cursong" ]]
|
||||
then
|
||||
title="<i>Arrêt</i>"
|
||||
unset artist title album length
|
||||
cursong="<i>Arrêt</i>"
|
||||
unset artist title album
|
||||
fi
|
||||
|
||||
# Notification du morceau
|
||||
dunstify -r "$DUNST_ID" "MPD" "${artist:+${artist}$'\n'}${title}"$'\n'"${album}"
|
||||
dunstify -r "$DUNST_ID" "MPD" "$cursong"
|
||||
|
||||
# Ajout au scrobbler Pleroma
|
||||
curl -s -X POST -u "breizh:$(pass show Web/pleroma.breizh.pm)" \
|
||||
--data-urlencode "title=${title}" \
|
||||
--data-urlencode "artist=${artist}" \
|
||||
--data-urlencode "album=${album}" \
|
||||
--data-urlencode "length=${length}" \
|
||||
https://pleroma.breizh.pm/api/v1/pleroma/scrobble &>/dev/null
|
||||
# curl -s -X POST -u "breizh:$(pass show Web/pleroma.breizh.pm)" \
|
||||
# --data-urlencode "title=${title}" \
|
||||
# --data-urlencode "artist=${artist}" \
|
||||
# --data-urlencode "album=${album}" \
|
||||
# https://pleroma.breizh.pm/api/v1/pleroma/scrobble &>/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
2
.xinitrc
2
.xinitrc
|
@ -35,6 +35,6 @@ fi
|
|||
urxvtd -q -f -o
|
||||
|
||||
[ -f $HOME/.fehbg ] && $HOME/.fehbg
|
||||
#[ -f $HOME/.screenlayout/home.sh ] && $HOME/.screenlayout/home.sh
|
||||
[ -f $HOME/.screenlayout/home.sh ] && $HOME/.screenlayout/home.sh
|
||||
|
||||
exec i3 #--shmlog-size=26214400
|
||||
|
|
Loading…
Reference in a new issue