1

I can run bindsym button4 exec amixer -D pulse sset Master 5%+ and bindsym button5 exec amixer -D pulse sset Master 5%- to adjust the volume from a terminal session. However when I add the commands to my config for i3 like so:

 bar {
         #status_command i3status
         #status_command i3blocks -c ~/.i3/i3blocks.conf
         #status_command ~/.i3/Bar.sh
         status_command conky -c /etc/config/conky/conky.conf

         font pango:Monospace
         colors {
                 background $bg-color
                 separator #757575
                 #                  border             background         text
                 focused_workspace  $bg-color          #000000          $text-color
                 inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
                 urgent_workspace   $urgent-bg-color   $urgent-bg-color   $text-color
         }

         bindsym button4 exec amixer -D pulse sset Master 5%+
         bindsym button5 exec amixer -D pulse sset Master 5%-
 }

I have an error in my config:

ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'hidden_state', 'id', 'modifier', 'position', 'output', 'tray_output', 'font', 'binding_mode_indicator', 'workspace_buttons', 'verbose', 'colors', '}'
ERROR: CONFIG: (in file /home/kalenpw/.i3/config)
ERROR: CONFIG: Line 206:        }
ERROR: CONFIG: Line 207:        
ERROR: CONFIG: Line 208:        bindsym button4 exec amixer -D pulse sset Master 5%+
ERROR: CONFIG:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: CONFIG: Line 209:        bindsym button5 exec amixer -D pulse sset Master 5%-
ERROR: CONFIG: Line 210: }
ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'hidden_state', 'id', 'modifier', 'position', 'output', 'tray_output', 'font', 'binding_mode_indicator', 'workspace_buttons', 'verbose', 'colors', '}'
ERROR: CONFIG: (in file /home/kalenpw/.i3/config)
ERROR: CONFIG: Line 207:        
ERROR: CONFIG: Line 208:        bindsym button4 exec amixer -D pulse sset Master 5%+
ERROR: CONFIG: Line 209:        bindsym button5 exec amixer -D pulse sset Master 5%-
ERROR: CONFIG:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: CONFIG: Line 210: }
ERROR: CONFIG: Line 211: 
ERROR: FYI: You are using i3 version 4.7.2 (2014-01-23, branch "tags/4.7.2")

I'm mirroring the syntax found on the i3wm user guide:

bar {
    # disable clicking on workspace buttons
    bindsym button1 nop
    # execute custom script when scrolling downwards
    bindsym button5 exec ~/.i3/scripts/custom_wheel_down
}

It appears to me like the syntax is right and the issue is definitely with those 2 bindsym lines because it is fine without them. How can I fix this so I can control the volume when I scroll on the statusbar?

1

Your i3 version is very old, you need to update it to at least 4.11 (bindsym for i3bar is mentioned in its release notes).

You can find the user's guide for your version here.

  • I'm following the page here: i3wm.org/docs/repositories.html and after running the first command(sudo echo 'deb http://dl.bintray.com/i3/i3-autobuild-ubuntu wily main' > /etc/apt/sources.list.d/i3-autobuild.list) I get bash: /etc/apt/sources.list.d/i3-autobuild.list: Permission denied so I can't update. How can I fix that? – kalenpw May 23 '16 at 19:15
  • You can't just stick sudo in front of echo with a redirection (for reasons check here or here or here). You'll need to open a shell as root or use one of the workarounds in the questions I linked. – Wieland May 23 '16 at 19:20
  • Opened a terminal as root and it works great now. Thanks for the quick answer! – kalenpw May 23 '16 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.