barrier: move server config to XDG_CONFIG_HOME

This commit is contained in:
crater2150 2025-08-04 21:16:37 +02:00
parent 4f5174063d
commit 0daba7236c
3 changed files with 6 additions and 5 deletions

View file

@ -1,8 +1,10 @@
#!/bin/zsh #!/bin/zsh
if [[ ! -e ${0:A:h}/server ]] then export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
SERVER_FILE=${XDG_CONFIG_HOME}/barrier/server
if [[ ! -e $SERVER_FILE ]] then
<<-ERROR <<-ERROR
Service requires configuration! Service requires configuration!
Create \`${0:A:h}/server\` containing the target server name Create \`${SERVER_FILE}\` containing the target server name
ERROR ERROR
exit 1 exit 1
fi fi
@ -10,4 +12,4 @@ source ${0:A:h:h}/import-env.zsh
import-env awesome || exit 1 import-env awesome || exit 1
exec 2>&1 exec 2>&1
exec barrierc --no-daemon $(<${0:A:h}/server) exec barrierc --no-daemon $(<${SERVER_FILE})

View file

@ -1 +0,0 @@
gaminghorst

View file

@ -1,5 +1,5 @@
#!/bin/zsh #!/bin/zsh
source ${0:a:h:h}/import-env.zsh source ${0:A:h:h}/import-env.zsh
import-env awesome || exit 1 import-env awesome || exit 1
exec 2>&1 exec 2>&1