Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kgx (GNOME Console) terminal #2578

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions etc/terminal-run
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ function error {
#reset the GTK theme so terminals follow the system GTK theme
export GTK_THEME=''

#add a line to the terminal's command-to-run that sets the title. This method allows it to be changed later, while specifying the title using a flag does not.
#add a line to the terminal's command-to-run that saves the terminal's PID to a known filename
temp_pid_file="$(mktemp -u)"
commands="echo "\$""\$" > $temp_pid_file
$commands"

#add a line to the terminal's command-to-run that sets the title. This method allows it to be changed later, while specifying the title using a flag does not.
commands="echo -ne '\e]0;${title}\a'
echo "\$""\$" > $temp_pid_file
$commands"

terminals='lxterminal
Expand All @@ -40,7 +38,8 @@ tilix
tilix.wrapper
qterminal
alacritty
kitty'
kitty
kgx'

#Try to honor the preference of update-alternatives x-terminal-emulator
terminal="$(basename "$(readlink -f "$(command -v x-terminal-emulator)")")"
Expand All @@ -66,10 +65,7 @@ else
fi

if [ -z "$choice" ];then
error 'Failed to locate any terminal emulators!!!'"

Please install one of the supported terminal emulators from this list:
$terminals"
error "Failed to locate any terminal emulators!!!"
elif [ "$choice" == lxterminal ];then
lxterminal -e bash -c "$commands" &

Expand Down Expand Up @@ -112,9 +108,14 @@ elif [ "$choice" == alacritty ];then
elif [ "$choice" == kitty ];then
kitty bash -c "$commands" &

elif [ "$choice" == kgx ];then
#kgs stays open after command execution, so add command to kill it - see https://gitlab.gnome.org/GNOME/console/-/issues/135
commands+=$'\n''kill $(ps -p $$ -o ppid=)'
#kgx windows communicate on dbus to share 1 pid, so disable dbus to get a unique pid to kill
DBUS_SESSION_BUS_ADDRESS='' kgx -- bash -c "$commands" &

else
error 'Failed to locate any terminal emulators!!!'"

error "Failed to locate any terminal emulators!!!
Please install one of the supported terminal emulators from this list:
$terminals"
fi
Expand Down
Loading