Skip to content

Commit 4c05987

Browse files
committed
provide system-wide install script
1 parent 537b122 commit 4c05987

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

Makefile

Lines changed: 17 additions & 8 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,7 +35,7 @@ endif
3335
## Update compiled files
3436
all: $(RELEASE_FILES)
3537

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

64-
## Uninstall PaperWM from this system
66+
## Uninstall PaperWM for this user
6567
uninstall:
6668
@$(call rich_echo,"GNOME_EXT_DISABLE", "$(EXT_ID)")
6769
@$(GNOME_EXT_DISABLE) $(EXT_ID)
@@ -80,6 +82,13 @@ uninstall:
8082
[[ $$REPLY =~ ^[Yy]$ ]] && rm -rf $(TARGET) \
8183
fi
8284

85+
## Install in system-wide location
86+
install-system:
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 install-system uninstall release
97106

98107
include lib.mk

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ 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 install`] 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
3433
make install # install, load and enable paperwm

0 commit comments

Comments
 (0)