sx icon indicating copy to clipboard operation
sx copied to clipboard

Cannot set environment variables in sxrc

Open sweenu opened this issue 5 years ago • 2 comments

Here is my ~/.config/sx/sxrc:

#!/bin/sh
[ -f ~/.xprofile ] && . ~/.xprofile
xinput set-prop "Elan Touchpad" "libinput Tapping Enabled" 1
xinput set-prop "Elan Touchpad" "libinput Natural Scrolling Enabled" 1
setxkbmap -layout custom-us-keychron -option caps:escape
xset r rate 200 30
exec i3

I also tried with the export statements directly in the sxrc but they are still not set in the i3 process. Could you help me see what I'm doing wrong?

Very nice simple program, thanks for making it :)

sweenu avatar Nov 13 '20 14:11 sweenu

Unfortunately I can't replicate this with a simple test case:

#!/bin/sh --
export FOO=bar # Or . ./envs where envs is a file containing export FOO=bar
exec xterm

In that xterm window printenv FOO printed bar as expected.

sx itself does nothing to exclude or include environments by itself so perhaps the environments are being changed elsewhere?

Earnestly avatar Nov 13 '20 14:11 Earnestly

So the problem seems to be specific to i3 because I tried your example with both xterm and dwm and it works fine. Only i3 poses problem. Thanks for helping out, you can close this issue, it's clearly not related to sx. I'm going to try to find what's the pb with i3.

sweenu avatar Nov 13 '20 16:11 sweenu