From 758cb059d743536b61b3de62bb76a32815c4f390 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Fri, 25 Sep 2015 08:06:12 +0200 Subject: [PATCH] Add volume control shortcuts --- bin/handle-volume-change | 15 +++++++++++++++ dotfiles.yml | 5 +++-- i3.base | 8 +++++++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 bin/handle-volume-change diff --git a/bin/handle-volume-change b/bin/handle-volume-change new file mode 100644 index 0000000..1e80cf1 --- /dev/null +++ b/bin/handle-volume-change @@ -0,0 +1,15 @@ +#!/bin/bash + +SINK=`pactl list short sinks | grep RUNNING | cut -f1` + +case "$1" in +"up") + pactl set-sink-volume $SINK +10% && pactl set-sink-mute $SINK 0 + ;; +"down") + pactl set-sink-volume $SINK -10% && pactl set-sink-mute $SINK 0 + ;; +"mute") + pactl set-sink-mute $SINK toggle + ;; +esac \ No newline at end of file diff --git a/dotfiles.yml b/dotfiles.yml index b627c55..827aa27 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -52,7 +52,6 @@ apt: name={{ item }} state=present tags: windowmanager with_items: - - gnome-settings-daemon - suckless-tools - pcmanfm - dunst @@ -84,13 +83,15 @@ template: src=templates/gitconfig.j2 dest={{ansible_env.HOME}}/.gitconfig - name: ensure fasd is installed and configured get_url: url=https://raw.githubusercontent.com/clvv/fasd/master/fasd dest={{BIN_DIR}}/fasd mode=0755 + - name: ensure binaries are available in path + copy: src=bin/ dest={{BIN_DIR}}/ mode=0755 - name: ensure dotfiles are available copy: src=.zshrc dest={{ansible_env.HOME}}/.zshrc # TODO # i3 bugfixes: -# http://blog.hugochinchilla.net/2013/03/using-gnome-3-with-i3-window-manager/ - usr/share/xsessions/gnome-i3.desktop # ++ http://www.draconianoverlord.com/2014/05/26/from-xmonad-to-i3.html +# Fn keys (sound, brightness ...). Try https://wiki.archlinux.org/index.php/Fcitx ? # # https://github.com/sgentle/caniuse-cmd # diff --git a/i3.base b/i3.base index a2abd69..e0c30ea 100644 --- a/i3.base +++ b/i3.base @@ -145,12 +145,18 @@ mode "resize" { bindsym $mod+r mode "resize" +bindsym XF86AudioRaiseVolume exec --no-startup-id handle-volume-change up +bindsym XF86AudioLowerVolume exec --no-startup-id handle-volume-change down +bindsym XF86AudioMute exec --no-startup-id handle-volume-change mute + # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { status_command i3status } +exec --no-startup-id gnome-session +exec --no-startup-id unity-settings-daemon exec --no-startup-id setxkbmap -layout fr -variant oss # allow typing "ê" instead of "^e" exec --no-startup-id numlockx on # turn verr num on -exec --no-startup-id nm-applet \ No newline at end of file +exec --no-startup-id nm-applet