You are not logged in.
Pages: 1
it's probably my lack of knowledge, but I couldn't find a way so posting here. what's the problem with those?
I have a keyboard shortcut with command `xfce4-terminal -e /path/to/file` and that's the `file`
#!/usr/bin/env bash
cat $0
read -n1 c
case $c in
1) gnome-calculator ;;
# open terminal + working app. fair enought.
2) gnome-calculator & ;;
# no open terminal. good. but why don't work?
3) setsid gnome-calculator;;
# again open terminal + working app.
4) setsid gnome-calculator &;;
# and again & creating problems. why don't it let it run???
5) setsid gnome-calculator & sleep 1;;
# okay I got it. it needs some time but I don't wanna hardcode a delay.
# how can I make it run independently from the xfce4-terminal ?
esac
exit
I can't figure out a way to launch an independent command that's not gonna get terminated when its terminal window is closed (which is invoked as xfce4-terminal -e /path/to/file)
Offline
# how can I make it run independently from the xfce4-terminal ?
If you want your command to not be a child process of the terminal, use the nohup command.
nohup gnome-calculator &
EndeavourOS
Xfce+gtk3-classic (no CSD)+Picom
Offline
se the nohup command.
I know this. but my point is not just "doing something" I want to do it with xfce4-terminal -e flag. here's the code with your solution included, please just bind a keyboard shortcut it to
xfce4-terminal e- "/path/to/file"
and check if your solution works either.
#!/usr/bin/env bash
cat $0
read -n1 c
case $c in
# ...
6) nohup gnome-calculator & ;;
# doesn't work
7) nohup gnome-calculator & sleep 1
# works
esac
exit
Last edited by va9iff (2024-06-26 15:55:24)
Offline
You need to add
set -m
in your script.
Offline
Pages: 1
[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 523.39 KiB (Peak: 529.78 KiB) ]