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 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?

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%[%]}%
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

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

Comments

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

Stats

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

Seen: 769 times

Last updated: Nov 25 '12