Added a suspender script for people who want to use startx.
This commit is contained in:
parent
4a1aa1e388
commit
05e3b0b3f9
28
tools/startx.sh
Executable file
28
tools/startx.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
cleanup() {
|
||||
# Make sure Fenrir is restored on exit of this script
|
||||
echo -n "setting set screen#suspendingScreen=" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
|
||||
}
|
||||
|
||||
# Call the cleanup function on exit of this script
|
||||
trap cleanup EXIT
|
||||
|
||||
# Get the number of the current terminal
|
||||
term=$(tty)
|
||||
term="${term##*tty}"
|
||||
|
||||
# Make sure term is a number, otherwise we're in something like screen, and x will not start.
|
||||
if ! [[ "$term" =~ ^[1-9]+$ ]]; then
|
||||
echo "This does not appear to be a terminal from where X may be started. Please make sure you are not in a screen or tmux session."
|
||||
trap - EXIT
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Suspend the current terminal for Fenrir
|
||||
echo -n "setting set screen#suspendingScreen=$term" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
|
||||
|
||||
# Start the x session
|
||||
command startx
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user