J'utilise volnoti, un service de notification, ainsi que mon gestionnaire de fenêtres i3, dans mon fichier i3config j'ai essayé de mettre en œuvre les commandes pour volnoti comme ceci:commande Shell ne fonctionne pas
# Pulse Audio controls
# Increase sound volume
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% && pkill -RTMIN+1 i3blocks && volnoti-show $(amixer -c 1 -M -D pulse get Master | grep -o '[0-9]*%' -m 1 | grep -o '[0-9]*')
# Decrease sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% && pkill -RTMIN+1 i3blocks && volnoti-show $(amixer -c 1 -M -D pulse get Master | grep -o '[0-9]*%' -m 1 | grep -o '[0-9]*')
# Mute sound
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle && pkill -RTMIN+1 i3blocks && if [[ -n $(amixer -c 1 -M -D pulse get Master | grep '\[off\]' -m 1) ]]; then volnoti-show -m; else volnoti-show $(amixer -c 1 -M -D pulse get Master | grep -o '[0-9]*%' -m 1 | grep -o '[0-9]*'); fi
L'augmentation et la diminution est montré sans problème, mais si je mute les journaux sonores i3 cette erreur:
ERROR: Could not translate string to key symbol: "split+h"
[libi3] ERROR: Surface 0x555ee0dfd3b0 is not initialized, skipping drawing.
[libi3] ERROR: Surface 0x555ee0dfd3b0 is not initialized, skipping drawing.
[libi3] ERROR: Surface 0x555ee0dfd3b0 is not initialized, skipping drawing.
ERROR: Received ConfigureNotify for unknown window 0x00800000
ERROR: Received ExposeEvent for unknown window 0x00800000
ERROR: Received ConfigureNotify for unknown window 0x00800000
ERROR: Received ConfigureNotify for unknown window 0x00800003
ERROR: Received ConfigureNotify for unknown window 0x00800003
ERROR: Received ConfigureNotify for unknown window 0x00800006
ERROR: Received ConfigureNotify for unknown window 0x00800006
ERROR: Received ConfigureNotify for unknown window 0x00800009
ERROR: Received ConfigureNotify for unknown window 0x00800009
ERROR: Received ConfigureNotify for unknown window 0x0080000c
ERROR: Received ConfigureNotify for unknown window 0x0080000c
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'title_format', 'mode', 'bar'
ERROR: Your command: exec --no-startup-id pactl set-sink-mute 1 toggle && pkill -RTMIN+1 i3blocks && "if [[ -n $(amixer -c 1 -M -D pulse get Master | grep '\[off\]' -m 1) ]]; then volnoti-show -m; else volnoti-show $(amixer -c 1 -M -D pulse get Master | grep -o '[0-9]*%' -m 1 | grep -o '[0-9]*'); fi"
ERROR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Je dois admettre, ce n'est pas la solution la plus élégante. Mais ça marche, sauf pour la dernière ligne. Si j'exécute la dernière partie directement dans un terminal, il fonctionne très bien et muet est détectée correctement:
if [[ -n $(amixer -c 1 -M -D pulse get Master | grep '\[off\]' -m 1) ]]; then volnoti-show -m; else volnoti-show $(amixer -c 1 -M -D pulse get Master | grep -o '[0-9]*%' -m 1 | grep -o '[0-9]*'); fi
pouvez-vous s'il vous plaît expliquer le downvote? – Jonas