diff options
author | Andrew Cady <d@jerkface.net> | 2022-11-21 16:09:02 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2022-11-21 16:09:02 -0500 |
commit | 2418a213c1cc099e9b2b00fe73ece6d7f606d3e7 (patch) | |
tree | 5963a26b80cb97aa1066ad8f83d4dd48fded2086 | |
parent | b61532af6a86d81d1633a4de144fccbb64f9e604 (diff) |
add command firestartx; and cleanup Makefile
-rw-r--r-- | Makefile | 8 | ||||
-rwxr-xr-x | firestartx | 50 |
2 files changed, 55 insertions, 3 deletions
@@ -1,12 +1,14 @@ | |||
1 | BINDIR = /usr/local/bin | 1 | BINDIR = /usr/local/bin |
2 | BINARIES = sliceweasel sliceweasel.lib.sh sliceuser fireslay ioslay-firefox cgroup-show-each-new-process ioslay-mgr.sh firestart | 2 | BINARIES = sliceweasel.lib.sh ioslay-mgr.sh firestart firestartx ioslay-firefox |
3 | SUDO != [ "$$(id -u)" = 0 ] || echo sudo | 3 | SUDO != [ "$$(id -u)" = 0 ] || echo sudo |
4 | 4 | ||
5 | .PHONY: install install-bin | 5 | .PHONY: install install-bin |
6 | 6 | ||
7 | install: install-bin | 7 | install: install-bin |
8 | sh your-fired.sh install | 8 | # sh your-fired.sh install |
9 | make run-ioslay | 9 | |
10 | uninstall: | ||
11 | systemctl --user disable firefixer | ||
10 | 12 | ||
11 | run-ioslay: | 13 | run-ioslay: |
12 | if systemctl --user is-active ioslay; \ | 14 | if systemctl --user is-active ioslay; \ |
diff --git a/firestartx b/firestartx new file mode 100755 index 0000000..748b9dd --- /dev/null +++ b/firestartx | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | get_new_display() | ||
4 | { | ||
5 | for ((n=1; n<99; ++n)) | ||
6 | do | ||
7 | if [ ! -e /tmp/.X$n-lock ] | ||
8 | then | ||
9 | NEW_DISPLAY=:$n | ||
10 | return | ||
11 | fi | ||
12 | done | ||
13 | false | ||
14 | } | ||
15 | |||
16 | get_new_display || exit | ||
17 | |||
18 | if [ $# = 0 ] | ||
19 | then | ||
20 | set -- firestart | ||
21 | fi | ||
22 | |||
23 | # TITLE=$* # lol, startx doesn't support arguments with spaces | ||
24 | TITLE=$1 | ||
25 | |||
26 | if [ "$1" != firestart ] | ||
27 | then | ||
28 | USE_XINIT=y | ||
29 | fi | ||
30 | |||
31 | if [ "$USE_XINIT" ] | ||
32 | then | ||
33 | set -x | ||
34 | case "$1" in | ||
35 | /*) ;; | ||
36 | *) f1=$(which "$1") || exit | ||
37 | shift | ||
38 | set -- "$f1" "$@" | ||
39 | ;; | ||
40 | esac | ||
41 | xinit "$@" -- $(which Xephyr) "$NEW_DISPLAY" -resizeable -p 0 -terminate ${TITLE:+ -title "$TITLE"} | ||
42 | else | ||
43 | set -x | ||
44 | startx -- $(which Xephyr) "$NEW_DISPLAY" -resizeable -p 0 -terminate ${TITLE:+ -title "$TITLE"} & | ||
45 | if [ $# -gt 0 ] | ||
46 | then | ||
47 | DISPLAY=$NEW_DISPLAY "$@" & | ||
48 | fi | ||
49 | wait | ||
50 | fi | ||