Skip to content

Commit 44438c3

Browse files
committed
provide system-wide install script
1 parent 537b122 commit 44438c3

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

Makefile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ SOURCE := $$PWD
88
99
EXT_DIR := $(XDG_DATA_HOME)/gnome-shell/extensions
1010
TARGET := $(EXT_DIR)/$(EXT_ID)
11+
SYSTARGET := $(DESTDIR)/usr/share/gnome-shell/extensions/$(EXT_ID)
1112

1213
CONFIG_FILES = config/user.js config/user.css
1314
GSCHEMA_FILES = schemas/org.gnome.shell.extensions.paperwm.gschema.xml
1415
JS_FILES = $(wildcard *.js)
1516
UI_FILES = $(wildcard *.ui)
1617
RESOURCE_FILES = $(wildcard resources/*)
1718

18-
RELEASE_FILES = $(JS_FILES) $(UI_FILES) $(RESOURCE_FILES) \
19-
$(CONFIG_FILES) $(GSCHEMA_FILES) \
20-
schemas/gschemas.compiled \
21-
metadata.json \
22-
stylesheet.css \
19+
EXT_FILES = $(JS_FILES) $(UI_FILES) $(RESOURCE_FILES) \
20+
$(CONFIG_FILES) \
21+
metadata.json \
22+
stylesheet.css
23+
RELEASE_FILES = $(EXT_FILES) \
24+
$(GSCHEMA_FILES) schemas/gschemas.compiled \
2325
LICENSE
2426

2527
ZIP := zip
@@ -33,8 +35,8 @@ endif
3335
## Update compiled files
3436
all: $(RELEASE_FILES)
3537

36-
## Install PaperWM on this system
37-
install: schemas/gschemas.compiled
38+
## Install PaperWM for this user
39+
userinstall: schemas/gschemas.compiled
3840
@if [[ ! -L "$(TARGET)" && -d "$(TARGET)" ]]; \
3941
then \
4042
echo; \
@@ -61,8 +63,8 @@ install: schemas/gschemas.compiled
6163
@echo "gnome-extensions enable $(EXT_ID)"
6264
@echo
6365

64-
## Uninstall PaperWM from this system
65-
uninstall:
66+
## Uninstall PaperWM for this user
67+
useruninstall:
6668
@$(call rich_echo,"GNOME_EXT_DISABLE", "$(EXT_ID)")
6769
@$(GNOME_EXT_DISABLE) $(EXT_ID)
6870
@if [[ `readlink -f $(TARGET)` != `readlink -f $$PWD` ]]; \
@@ -80,6 +82,13 @@ uninstall:
8082
[[ $$REPLY =~ ^[Yy]$ ]] && rm -rf $(TARGET) \
8183
fi
8284

85+
## Install in system-wide location
86+
install:
87+
for f in $(EXT_FILES); do \
88+
install -D -p -m 0644 $$f "$(SYSTARGET)/$$f"; \
89+
done
90+
install -d "$(DESTDIR)/usr/share/glib-2.0/schemas"
91+
install -p -m 0644 $(GSCHEMA_FILES) "$(DESTDIR)/usr/share/glib-2.0/schemas/"
8392

8493
## Generate a release zip for review on GNOME Extensions
8594
release: $(EXT_ID).zip
@@ -93,6 +102,6 @@ schemas/gschemas.compiled: $(GSCHEMA_FILES)
93102
@$(call rich_echo,"MAKE","$@")
94103
@$(MAKE) -C schemas gschemas.compiled
95104

96-
.PHONY: install uninstall release
105+
.PHONY: install userinstall useruninstall release
97106

98107
include lib.mk

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ Clone the repo and check out the branch for the GNOME Shell version you're runni
2727
- 40-41 ([EOL](https://release.gnome.org/calendar/#releases)): https://github.com/paperwm/PaperWM/tree/gnome-40
2828
- 3.28-3.38 ([EOL](https://release.gnome.org/calendar/#releases)): https://github.com/paperwm/PaperWM/tree/gnome-3.38
2929

30-
then run the [`make install`](https://github.com/paperwm/PaperWM/blob/release/install.sh)
31-
from the repository. The installer will create a link to the repo in
30+
then run [`make userinstall`] from the repository. The installer will create a link to the repo in
3231
`~/.local/share/gnome-shell/extensions`. It will then ask if you want to enable PaperWM.
3332
```bash
34-
make install # install, load and enable paperwm
33+
make userinstall # install, load and enable paperwm
3534
```
3635

3736
Running the extension will automatically install a user config file as described in [User configuration & development](#user-configuration--development).
@@ -47,7 +46,7 @@ Running the extension will automatically install a user config file as described
4746
4847
#### Uninstall PaperWM (if installed via source)
4948

50-
To uninstall simply run `make uninstall`.
49+
To uninstall simply run `make useruninstall`.
5150

5251
### Try without installing
5352

0 commit comments

Comments
 (0)