-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (87 loc) · 3.15 KB
/
Makefile
File metadata and controls
106 lines (87 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
SCRIPT_NAME := mousetiler
PKGFILE := $(SCRIPT_NAME).kwinscript
SRC_DIR := src
SESSION_WIDTH := 1920
SESSION_HEIGHT := 1080
SESSION_OUTPUT_COUNT := 1
SESSION_VERBOSE := 0
SESSION_APPLICATIONS := # dolphin konsole kate
.NOTPARALLEL: all
.PHONY: all build install uninstall clean enable disable restart-kwin logs load unload reload remove-keybindings
all: install clean
build: $(PKGFILE)
$(PKGFILE): $(shell find $(SRC_DIR) -type f)
@echo "Packaging $(SRC_DIR) into $(PKGFILE)..."
@zip -rq $(PKGFILE) $(SRC_DIR)
install: build
@echo "Installing $(PKGFILE)..."
@kpackagetool6 --type=KWin/Script -i $(PKGFILE) || \
kpackagetool6 --type=KWin/Script -u $(PKGFILE)
uninstall:
@echo "Uninstalling $(SCRIPT_NAME)..."
@kpackagetool6 --type=KWin/Script -r $(SCRIPT_NAME)
clean:
@echo "Cleaning up $(PKGFILE)..."
@rm -f $(PKGFILE)
enable:
@echo "Enabling $(SCRIPT_NAME)..."
@kwriteconfig6 --file kwinrc --group Plugins --key $(SCRIPT_NAME)Enabled true
@qdbus org.kde.KWin /KWin reconfigure
disable:
@echo "Disabling $(SCRIPT_NAME)..."
@kwriteconfig6 --file kwinrc --group Plugins --key $(SCRIPT_NAME)Enabled false
@qdbus org.kde.KWin /KWin reconfigure
restart-kwin:
if [ "$$XDG_SESSION_TYPE" = "x11" ]; then \
kwin_x11 --replace & \
elif [ "$$XDG_SESSION_TYPE" = "wayland" ]; then \
kwin_wayland --replace & \
else \
echo "Unknown session type"; \
fi
logs:
@if [ "${XDG_SESSION_TYPE}" = "x11" ]; then \
journalctl -f -t kwin_x11; \
else \
journalctl --user -u plasma-kwin_wayland -f QT_CATEGORY=js QT_CATEGORY=qml QT_CATEGORY=kwin_scripting; \
fi
start-session-full:
@echo "Starting nested Wayland session..."
@sh -c '\
unset LD_PRELOAD; \
NESTED_DIR="$$XDG_RUNTIME_DIR/nested_plasma"; \
mkdir -p "$$NESTED_DIR"; \
WRAPPER="$$NESTED_DIR/kwin_wayland_wrapper"; \
printf "#!/bin/sh\n/usr/bin/kwin_wayland_wrapper --width $(SESSION_WIDTH) --height $(SESSION_HEIGHT) --no-lockscreen --output-count $(SESSION_OUTPUT_COUNT) $(SESSION_APPLICATIONS) \\\$$@\n" > "$$WRAPPER"; \
chmod a+x "$$WRAPPER"; \
export PATH="$$NESTED_DIR:$$PATH"; \
if [ "$(SESSION_VERBOSE)" = "1" ]; then \
dbus-run-session startplasma-wayland; \
else \
dbus-run-session startplasma-wayland 2>&1; \
fi; \
rm -f "$$WRAPPER"'
start-session:
@echo "Starting nested Wayland session..."
@sh -c '\
unset LD_PRELOAD; \
NESTED_DIR="$$XDG_RUNTIME_DIR/nested_plasma"; \
mkdir -p "$$NESTED_DIR"; \
WRAPPER="$$NESTED_DIR/kwin_wayland_wrapper"; \
printf "#!/bin/sh\n/usr/bin/kwin_wayland_wrapper --width $(SESSION_WIDTH) --height $(SESSION_HEIGHT) --no-lockscreen --output-count $(SESSION_OUTPUT_COUNT) $(SESSION_APPLICATIONS) \\\$$@\n" > "$$WRAPPER"; \
chmod a+x "$$WRAPPER"; \
export PATH="$$NESTED_DIR:$$PATH"; \
if [ "$(SESSION_VERBOSE)" = "1" ]; then \
dbus-run-session startplasma-wayland; \
else \
dbus-run-session startplasma-wayland 2>&1 | grep -E "qml"; \
fi; \
rm -f "$$WRAPPER"'
load:
bin/load.sh "$(SRC_DIR)" "$(SCRIPT_NAME)-test"
unload:
bin/unload.sh "$(SCRIPT_NAME)-test"
reload: unload load
remove-keybindings:
@echo "Removing all unused custom keybindings..."
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.cleanUp