Skip to content

Commit

Permalink
Hardcoding xsessions directory to /usr/share/xsessions as suggested in
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkeby committed Jan 6, 2023
1 parent 668e18f commit f0ad111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ endif
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
mkdir -p ${DESTDIR}${PREFIX}/share/xsession
cp -n dwm.desktop ${DESTDIR}${PREFIX}/share/xsession
chmod 644 ${DESTDIR}${PREFIX}/share/xsession/dwm.desktop
sudo mkdir -p /usr/share/xsessions
sudo cp -n dwm.desktop /usr/share/xsessions
sudo chmod 644 /usr/share/xsessions/dwm.desktop

This comment has been minimized.

Copy link
@monosans

monosans Jan 6, 2023

Contributor

Why sudo?

This comment has been minimized.

Copy link
@bakkeby

bakkeby Jan 6, 2023

Author Owner

Primarily because we know that the user can't operate on these directories / files without sudo.

The example in the issue outlines the approach of changing config.mk to use a local prefix:

PREFIX = ~/.local

That way the user can do make install (without sudo) to compile and install dwm, which does allow for separate dwm installations on a per user basis. More so you were to compile using sudo make install then that would add the installation under the root directory (which is not what one would want).

Granted end users wanting a setup like this could add the sudo calls above themselves, but I decided to add them anyway as the underlying idea of having config.mk separately from the Makefile is that the end user should not need to change the latter.

The explicit sudo calls should not cause any conflict when compiling dwm as normal using sudo make install, but I may end up removing them if they turns out to cause issues (how does it work if someone relies on doas instead for example).


uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
${DESTDIR}${MANPREFIX}/man1/dwm.1\
${DESTDIR}${PREFIX}/share/xsession/dwm.desktop
/usr/share/xsessions/dwm.desktop

.PHONY: all options clean dist install uninstall

0 comments on commit f0ad111

Please sign in to comment.