「Volnoti」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(ページの作成:「Category:X サーバー Category:サウンド en:Volnoti {{Related articles start}} {{Related|Advanced Linux Sound Architecture}} {{Related|デスクトップ...」)
 
(同期)
 
37行目: 37行目:
   
 
# Increase volume
 
# Increase volume
"amixer set Master 5%+ && amixer get Master | egrep -o "([0-9]+)%" | egrep -o "[0-9]+" | xargs -0 volnoti-show"
+
"amixer set Master 5%+ && volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)"
 
XF86AudioRaiseVolume
 
XF86AudioRaiseVolume
 
 
 
# Decrease volume
 
# Decrease volume
"amixer set Master 5%- && amixer get Master | egrep -o "([0-9]+)%" | egrep -o "[0-9]+" | xargs -0 volnoti-show"
+
"amixer set Master 5%- && volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)"
 
XF86AudioLowerVolume
 
XF86AudioLowerVolume
 
 
 
# Toggle volume
 
# Toggle volume
"amixer set Master toggle; if [[ -n $(amixer get Master | grep 'Mono:' | grep -o "\[off\]") ]] ; then volnoti-show -m -v; else amixer get Master | egrep -o "([0-9]+)%" | egrep -o "[0-9]+" | xargs -0 volnoti-show; fi"
+
"amixer set Master toggle; if amixer get Master | grep -Fq "[off]"; then volnoti-show -m; else volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1); fi"
 
XF86AudioMute
 
XF86AudioMute
   
51行目: 51行目:
   
 
{{ic|kill -1 $(pidof xbindkeys)}} で Xbindkeys を再起動 (あるいは、自動起動ファイルに Volnoti と Xbindkeys を記述してから PC を再起動) して設定をテストしてください。
 
{{ic|kill -1 $(pidof xbindkeys)}} で Xbindkeys を再起動 (あるいは、自動起動ファイルに Volnoti と Xbindkeys を記述してから PC を再起動) して設定をテストしてください。
  +
  +
=== i3 の設定 ===
  +
i3 の設定ファイルに以下の行を追加してください (デフォルトでは {{ic|~/.i3/config}} または {{ic|~/.config/i3/config}})
  +
  +
bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer set Master 2%+ && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
  +
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer set Master 2%- && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
  +
bindsym XF86AudioMute exec --no-startup-id "amixer set Master toggle && if amixer get Master | grep -Fq '[off]'; then volnoti-show -m; else volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1); fi"

2017年10月13日 (金) 00:11時点における最新版

関連記事

GitHub の Volnoti のページより:

"Volnoti は GNU/Linux などの POSIX オペレーティングシステム用の軽量なボリューム通知デーモンです。GTK+ と D-Bus を使用しており、あらゆるウィンドウマネージャで動作します。本来の目標は LXDEXmonad などの軽量なウィンドウマネージャ用のボリューム通知デーモンを作成することでしたが、現在では GNOME, KDE, Xfce, LXDE, Xmonad, i3 を含む様々な WM で動作します。"

Openbox などの通知デーモンが付属していない軽量なウィンドウマネージャを使っている場合に、Volnoti を利用してボリュームの変更を確認することができます。特にノートパソコンやキーボードの特殊なキーと組み合わせることで有用です。

インストール

AUR から volnotiAUR パッケージをインストールしてください。

使用方法と設定

Volnoti の起動

デーモンを起動するには、次のコマンドを実行:

$ volnoti

Volnoti はバックグラウンドで動作します。ウィンドウマネージャが起動したときに Volnoti も自動的に実行させたい場合、WM の自動起動ファイル (例えば Openbox を使用している場合なら ~/.config/openbox/autostart) にコマンドを追加してください。ターミナルで次のコマンドを実行することで、プログラムが起動していることを確認できます:

$ volnoti-show 20

画面の中央に、ボリュームが 25% だと書かれた半透明の四角が表示されるはずです。起動できたら、ボリュームが変更されるたびに通知を表示するように Volnoti を設定してください。

Xbindkeys の設定

以下の設定は Volnoti, ALSA, Xbindkeys を使ってホットキーが押されたときにボリュームの変更を表示します。この例では Xbindkeys が既にインストール・設定済みであるとします。

テキストエディタで ~./xbindkeysrc を開いて # End of xbindkeys configuration の前に以下の行を追加してください:

# Increase volume
"amixer set Master 5%+ && volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)"
   XF86AudioRaiseVolume

# Decrease volume
"amixer set Master 5%- && volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)"
   XF86AudioLowerVolume

# Toggle volume
"amixer set Master toggle; if amixer get Master | grep -Fq "[off]"; then volnoti-show -m; else volnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1); fi"
   XF86AudioMute

最初の2つのコマンドはキーが押されたときにボリュームを上げ下げして、新しいボリュームのレベルを読み込み、volnoti-show の引数として送信します。3番目のコマンドはボリュームのオンオフを切り替えて、(ボリュームがミュートになっているかどうかにあわせて) Volnoti の通知を表示します。

kill -1 $(pidof xbindkeys) で Xbindkeys を再起動 (あるいは、自動起動ファイルに Volnoti と Xbindkeys を記述してから PC を再起動) して設定をテストしてください。

i3 の設定

i3 の設定ファイルに以下の行を追加してください (デフォルトでは ~/.i3/config または ~/.config/i3/config)

bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer set Master 2%+ && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer set Master 2%- && volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1)"
bindsym XF86AudioMute exec --no-startup-id "amixer set Master toggle && if amixer get Master | grep -Fq '[off]'; then volnoti-show -m; else volnoti-show $(amixer get Master | grep -Po '[0-9]+(?=%)' | head -1); fi"