Skip to content

Commit abd0a23

Browse files
committed
provide system-wide install script
1 parent 50bed17 commit abd0a23

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

Makefile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif
66

77
SOURCE := $$PWD
88
9-
EXT_DIR := $(XDG_DATA_HOME)/gnome-shell/extensions
9+
EXT_DIR := $(if $(DESTDIR),$(DESTDIR)/usr/share,$(XDG_DATA_HOME))/gnome-shell/extensions
1010
TARGET := $(EXT_DIR)/$(EXT_ID)
1111

1212
CONFIG_FILES = config/user.js config/user.css
@@ -15,11 +15,12 @@ JS_FILES = $(wildcard *.js)
1515
UI_FILES = $(wildcard *.ui)
1616
RESOURCE_FILES = $(wildcard resources/*)
1717

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

2526
ZIP := zip
@@ -33,7 +34,7 @@ endif
3334
## Update compiled files
3435
all: $(RELEASE_FILES)
3536

36-
## Install PaperWM on this system
37+
## Install PaperWM for this user
3738
install: schemas/gschemas.compiled
3839
@if [[ ! -L "$(TARGET)" && -d "$(TARGET)" ]]; \
3940
then \
@@ -61,7 +62,7 @@ install: schemas/gschemas.compiled
6162
@echo "gnome-extensions enable $(EXT_ID)"
6263
@echo
6364

64-
## Uninstall PaperWM from this system
65+
## Uninstall PaperWM for this user
6566
uninstall:
6667
@$(call rich_echo,"GNOME_EXT_DISABLE", "$(EXT_ID)")
6768
@$(GNOME_EXT_DISABLE) $(EXT_ID)
@@ -80,6 +81,13 @@ uninstall:
8081
[[ $$REPLY =~ ^[Yy]$ ]] && rm -rf $(TARGET) \
8182
fi
8283

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

8492
## Generate a release zip for review on GNOME Extensions
8593
release: $(EXT_ID).zip
@@ -93,6 +101,6 @@ schemas/gschemas.compiled: $(GSCHEMA_FILES)
93101
@$(call rich_echo,"MAKE","$@")
94102
@$(MAKE) -C schemas gschemas.compiled
95103

96-
.PHONY: install uninstall release
104+
.PHONY: install install-system uninstall release
97105

98106
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)