The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

exec script only executing first part

asked 2012-11-25 20:11:10 +0000

himself gravatar image

I am trying to bind a key to exec a shell script. The problem is that it only executes part of the script, the first statement.

I can execute the script from a term and it works as intended.

Does anyone know what could be wrong?


i3config keybinding

bindsym XF86AudioLowerVolume exec  $HOME/scripts/amixer/vol_down


amixer -q set Master 5- unmute 

update conky vol

./.amixer 'Master' 'Left' > ~/.config/conky/volume



param=$(amixer get "$1",0 | grep "$2:" | egrep -m 1 -o '[0-9]{1,3}%' | egrep -m 1 -o '[0-9]{1,3}%') 
echo ${param%[%]}%
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2012-11-25 20:27:46 +0000

Michael gravatar image

updated 2012-11-25 20:28:23 +0000

I think the problem is that in vol_down, you are running ./update_conky_vol, but you are not ensuring that the script’s working directory is $HOME/scripts/amixer.

Try using $HOME/scripts/amixer/update_conky_vol instead.

edit flag offensive delete link more


Thanks so much for pointing that out, it now works as expected.

himself gravatar imagehimself ( 2012-11-25 20:37:26 +0000 )edit

Question Tools

1 follower


Asked: 2012-11-25 20:11:10 +0000

Seen: 769 times

Last updated: Nov 25 '12