.i3/volume_ctrl

Fri, 13 Jun 2014 10:34:30 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 13 Jun 2014 10:34:30 -0400
branch
mhoward-lt
changeset 48
692d2b9c7958
parent 38
89149f81e6d7
permissions
-rwxr-xr-x

add private bin/ to path, run urxvtd and xcompmgr always if available

38
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/usr/bin/env ruby
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 cmd = ARGV.shift
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 if cmd == 'up'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 system 'amixer -q set Master 5%+ unmute'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 elsif cmd == 'down'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 system 'amixer -q set Master 5%- unmute'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 elsif cmd == 'mute'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 system 'amixer -q set Master toggle'
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 end
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 # nudge i3stats for an update
89149f81e6d7 sends amixer commands then bumps i3status
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 system 'killall -USR1 i3status'

mercurial