summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-11-21 16:09:02 -0500
committerAndrew Cady <d@jerkface.net>2022-11-21 16:09:02 -0500
commit2418a213c1cc099e9b2b00fe73ece6d7f606d3e7 (patch)
tree5963a26b80cb97aa1066ad8f83d4dd48fded2086
parentb61532af6a86d81d1633a4de144fccbb64f9e604 (diff)
add command firestartx; and cleanup Makefile
-rw-r--r--Makefile8
-rwxr-xr-xfirestartx50
2 files changed, 55 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7cb92ae..443b88a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
1BINDIR = /usr/local/bin 1BINDIR = /usr/local/bin
2BINARIES = sliceweasel sliceweasel.lib.sh sliceuser fireslay ioslay-firefox cgroup-show-each-new-process ioslay-mgr.sh firestart 2BINARIES = sliceweasel.lib.sh ioslay-mgr.sh firestart firestartx ioslay-firefox
3SUDO != [ "$$(id -u)" = 0 ] || echo sudo 3SUDO != [ "$$(id -u)" = 0 ] || echo sudo
4 4
5.PHONY: install install-bin 5.PHONY: install install-bin
6 6
7install: install-bin 7install: install-bin
8 sh your-fired.sh install 8 # sh your-fired.sh install
9 make run-ioslay 9
10uninstall:
11 systemctl --user disable firefixer
10 12
11run-ioslay: 13run-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
3get_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
16get_new_display || exit
17
18if [ $# = 0 ]
19then
20 set -- firestart
21fi
22
23# TITLE=$* # lol, startx doesn't support arguments with spaces
24TITLE=$1
25
26if [ "$1" != firestart ]
27then
28 USE_XINIT=y
29fi
30
31if [ "$USE_XINIT" ]
32then
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"}
42else
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
50fi