Sample Header Ad - 728x90

How openbox knows .bash_aliases used in its autostart file

0 votes
0 answers
67 views
I'm using two commands in a file executed by my .config/openbox/autostart.sh which are also aliased in my .bash_alises and one of them changes from time to time. The thing is that I also use these commands aliases in my .bash_aliases and changing all files with every change in every same way is quite annoying. I'd like to have my aliases been known by the Openbox autostart file. ## My .config/openbox/autostart.sh (mainly)
. $GLOBALAUTOSTART
lxterminal -e "$(cat ~/.config/openbox/terminal.sh)" # command for a clean autostart file
## My .config/openbox/terminal.sh
a="b"

while [[ -n "$a" ]]; do
        read a
        if [[ "$a" =~ "o" ]] || [[ "$a" =~ "O" ]]; then
                sudo mount -t davfs example.com/webdav ~/exampleCom
                rsync -giloprtu --specials exampleCom/dir0/ dirs/directory_0
                rsync -giloprtu --specials exampleCom/dir1/ dirs/directory_1
                sudo umount exampleCom
        fi
[…]
done
## My .bash_aliases
alias RS='rsync -giloprtu --specials'
alias RSYNC='sudo mount -t davfs example.com/webdav ~/exampleCom
RS exampleCom/dir0/ dirs/directory_0
RS exampleCom/dir1/ dirs/directory_1
sudo umount exampleCom'
## Desired .config/openbox/terminal.sh
a="b"

while [[ -n "$a" ]]; do
        read a
        if [[ "$a" =~ "o" ]] || [[ "$a" =~ "O" ]]; then
                RSYNC # read from my ~/.bash_aliases
        fi
[…]
done
Asked by muggi (759 rep)
Mar 25, 2023, 03:47 PM
Last activity: Mar 25, 2023, 04:03 PM