The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

exec script only executing first part

asked Nov 25 '12

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?

Thanks.

i3config keybinding

bindsym XF86AudioLowerVolume exec  $HOME/scripts/amixer/vol_down

vol_down

#!/bin/bash
amixer -q set Master 5- unmute 
./update_conky_vol

update conky vol

#!/bin/bash
./.amixer 'Master' 'Left' > ~/.config/conky/volume

.amixer

#!/bin/bash

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%[%]}%

1 answer

Sort by » oldest newest most voted
0

answered Nov 25 '12

Michael gravatar image

updated Nov 25 '12

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.

Comments

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

himself gravatar imagehimself (Nov 25 '12)edit

Question Tools

1 follower

Stats

Asked: Nov 25 '12

Seen: 769 times

Last updated: Nov 25 '12