Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
configuring custom DWM with LightDM
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
SilkeSiy
n00b
n00b


Joined: 20 Nov 2021
Posts: 42

PostPosted: Sat Nov 20, 2021 9:38 am    Post subject: configuring custom DWM with LightDM Reply with quote

Hello everyone,

I'm new to gentoo and to linux in general so i'm not sure if im missing something silly.

let me state my goal first: i want to build dwm locally and then make lightdwm use it in a nice way (not a hacky way that might cause problem down the road).

here is what i have done:

I have gentoo with systemd, lightdm, and dwm all installed with the traditional way following the handbook and gentoo manuals.

But with DWM i have to patch things manually since not all patches are comparability with each other.

So i created a local folder called src in ~/.local/src so my setup will be that the stuff that i build in ~/.local/src will be exported to ~/.local/bin and the same for the man pages etc.

with this setup i dont have to miss around with the system files in /usr/local stuff.
~/.local/bin is added to the path using ~/.profile and i have added "source ~/.profile" in my ~/.bashrc just incase, and my /bin/sh points to bash and when i do make install for DWM i can see that it uses ~/.local/bin/dwm with the which command.

now when i go to /etc/lightdm/lightdm.conf and i change my user-session to dwm it complains that it cannot find dwm.
but when i install dwm via emerge everything works.

i tried to invisitage the issue and found out that there is dwm.desktop file in /usr/share/xessions/dwm.desktop so i replicated that in my ~/.local/share/applications/dwm.desktop and edited the dwm.desktop in my local file to point to the absolute path to ~/.local/bin/dwm and deselected dwm and depcleaned it and updated the desktop stuff with update-desktop-database

but still lightdm says it cannot find dwm when i run lightdm with --test-mode --debug.

So i came back and installed dwm with emerge to reverse engineer the thing to see where it actualyl start etc, and i found a folder in /etc/X11/Sessions with some scripts that start alternative desktop environment and it contained awesome (AwesomeWM), dwm, Xsession. and dwm file has the line exec /usr/bin/dwm.

now i know that if i replaced that line with my path dwm path in ~/.local everything might work.
but there are many stuff and idk why there are two entry points with /usr/share/xessions/dwm.desktop and /etc/X11/etc/Session/dwm


now my methodology that i prerfer is installing my dwm in ~/.local and then make lightdm uses that.
but im not sure what is the proper way of doing this. i tried using Xsession and put stuff in my .xprofile to start dwm but it didnt work and it closes immeditly.
and im not using OpenRC so .xinitrc is not an option (or at least that is what i think since the file name ends with rc).

so my question is, what is the proper way of installing custom window manager in gentoo that respect the system file hierarchy so if i wanted to change lightdm with something else the login manager can detect my dwm.

Sorry if my post is long im just confused and tired of researching this issue.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Nov 20, 2021 6:32 pm    Post subject: Re: configuring custom DWM with LightDM Reply with quote

SilkeSiy wrote:
I'm new to gentoo and to linux in general so i'm not sure if im missing something silly.
Welcome to the forums.
SilkeSiy wrote:
let me state my goal first: i want to build dwm locally
Building locally is standard on Gentoo.
SilkeSiy wrote:
But with DWM i have to patch things manually since not all patches are comparability with each other.
This is a good use case for /etc/portage/patches.
SilkeSiy wrote:
So i created a local folder called src in ~/.local/src so my setup will be that the stuff that i build in ~/.local/src will be exported to ~/.local/bin and the same for the man pages etc.

with this setup i dont have to miss around with the system files in /usr/local stuff.
This seems like the wrong approach to me. I think you would be better off having Portage manage the installation of the files, and apply the patches via /etc/portage/patches.
SilkeSiy wrote:
i have added "source ~/.profile" in my ~/.bashrc just incase
I think this is backwards. Generally, you should source your rc file from your profile, not the other way around.
SilkeSiy wrote:
now when i go to /etc/lightdm/lightdm.conf and i change my user-session to dwm it complains that it cannot find dwm.
but when i install dwm via emerge everything works.
This makes sense. It is probably only searching in standard locations.
SilkeSiy wrote:
now my methodology that i prerfer is installing my dwm in ~/.local and then make lightdm uses that.
Are you doing this because you did not know that Portage can apply patches, or because there is a reason you need this to be private to your user?
SilkeSiy wrote:
and im not using OpenRC so .xinitrc is not an option (or at least that is what i think since the file name ends with rc).
These are not related. As a systemd user, you would still use xinitrc if you used startx. As a user with a greeter, you may not be using startx.
Back to top
View user's profile Send private message
SilkeSiy
n00b
n00b


Joined: 20 Nov 2021
Posts: 42

PostPosted: Sat Nov 20, 2021 6:49 pm    Post subject: Reply with quote

Hello Hu,

Thank you for your detailed response!

I forgot to mention why im i jumping through this route in the first place so forgive me for that.

with DWM, not all of its patches are compatible since there might be some collusion where a patch cannot be applied. I'm now using /etc/portage/patches but i had to edit the patch to adapt to the previous patch in sequence which is just slower than patching the source code manually.

and thank you for explaining the .xinitrc file and its relation to startx ! i should read more about it.

my logic behind the ~/.local setup is that i can backup my dot files easily which contains my custom builds as well.

im not sure about the gentoo way since im just like 1 week old in the distro, but is it just better to patch DWM manually then create a patch with the difference between my current code and the installed version from emerge and put that in the /etc/portage/patches ?
if that is the case then creating custom patches would be easier.

what do you think?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Nov 20, 2021 7:16 pm    Post subject: Reply with quote

SilkeSiy wrote:
with DWM, not all of its patches are compatible since there might be some collusion where a patch cannot be applied.
This seems like a poor way to run a project. In my opinion, all core patches ought to be applied unconditionally, and then have their effects selectively enabled by preprocessor flags. Also, beware collusion with foreign actors.
SilkeSiy wrote:
I'm now using /etc/portage/patches but i had to edit the patch to adapt to the previous patch in sequence which is just slower than patching the source code manually.
Slower now, but automatic going forward.
SilkeSiy wrote:
my logic behind the ~/.local setup is that i can backup my dot files easily which contains my custom builds as well.
You probably should be archiving /etc too. Archiving the compiled dwm is probably not useful.
SilkeSiy wrote:
im not sure about the gentoo way since im just like 1 week old in the distro,
If you are so new, why are you trying to use a window manager that is so hard to manage? Most window managers do not require recompilation just to change their customizations.
SilkeSiy wrote:
but is it just better to patch DWM manually then create a patch with the difference between my current code and the installed version from emerge and put that in the /etc/portage/patches ?
if that is the case then creating custom patches would be easier.
That should work.
SilkeSiy wrote:
what do you think?
I think the suckless project takes a user-hostile approach to customizations, and I've never understood why. I think trying to get dwm to do what you want is more trouble than it ought to be, and you would have a better experience if you used a window manager that didn't require you to maintain custom patches like this.
Back to top
View user's profile Send private message
SilkeSiy
n00b
n00b


Joined: 20 Nov 2021
Posts: 42

PostPosted: Sat Nov 20, 2021 8:30 pm    Post subject: Reply with quote

Yeah i just thought if im going to use gentoo then dwm might bring the maximum gentoo experience (learning stuff through out the processes) but yeah i agree with you dwm makes it a hassle to add new stuff.
I will try to make a custom patch and add it in the /etc/portage/patches then i will look for more configurable window manager and try them out one by one.

Thank you for explaining gentoo more to me and discuss this issue with me.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Nov 20, 2021 8:43 pm    Post subject: Reply with quote

Happy to help. Please come back if you have more questions, about dwm or any of the other packages you try.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Sun Nov 21, 2021 3:57 am    Post subject: Reply with quote

Consider OpenBox. http://openbox.org/wiki/Main_Page
It's a delight to use with a plethora of choices for additions to create a beautiful, easy to maintain, and productive user desktop. Although the "Main_Page" is a bit sparse, an Internet search will reveal a nearly bottomless well of suggestions.

I use it personally with PCManFM to manage the desktop and LXPanel which provides a traditional panel with a menu, tools, ans system area. There is a forum post that explains my setup which might be an easy place to start: https://forums.gentoo.org/viewtopic-t-1119739-highlight-lxde+openbox.html

Also, there are many OpenBox users right here in the forums.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sun Nov 21, 2021 5:16 am    Post subject: Reply with quote

Hu wrote:
SilkeSiy wrote:
what do you think?
I think the suckless project takes a user-hostile approach to customizations, and I've never understood why. I think trying to get dwm to do what you want is more trouble than it ought to be, and you would have a better experience if you used a window manager that didn't require you to maintain custom patches like this.
Security and, well ... a focused approach toward solutions?

Quote:
dwm is customized through editing its source code, which makes it extremely fast and secure - it does not process any input data which isn't known at compile time, except window titles and status text read from the root window's name. You don't have to learn Lua/sh/ruby or some weird configuration file format (like X resource files), beside C, to customize it for your needs: you only have to learn C (at least in order to edit the header file).
https://dwm.suckless.org/
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sun Nov 21, 2021 5:03 pm    Post subject: Reply with quote

I think having a configuration file to let the user manage their keybindings without a recompile would not significantly reduce its security. Between that and the inability even to enable well-known patches without use of source code patching, and that some of the well-known patches are mutually incompatible, this feels to me more like the author(s) identified some functionality they didn't want to write, then retrofitted an explanation ("application security") to justify the missing features. For most projects, well-known patches like this would have been merged and gated behind a configuration flag, so that users can turn the feature on/off with just a preprocessor directive. That would also make it easier to review the true impact of a change, since all the affected code would be in the same checkout, rather than needing to worry about which patches a given change will break.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1528
Location: South America

PostPosted: Sun Nov 21, 2021 6:35 pm    Post subject: Reply with quote

Hu wrote:
I think having a configuration file to let the user manage their keybindings without a recompile would not significantly reduce its security. Between that and the inability even to enable well-known patches without use of source code patching, and that some of the well-known patches are mutually incompatible, this feels to me more like the author(s) identified some functionality they didn't want to write, [...]

I also find DWM's case strange. It is true that configuration files add complexity, because the software package then needs a configuration file parser, rich configuration file formats require complex parsers, and complex parsers are sources of bugs. The author of s6 even jokingly says that "parsing is bad - most people can't write parsers, and bugs love them (both the parsers and these people)" :D

However, I've seen plenty of forum threads where users want help for combining several patches that conflict with each other, and if many users of DWM want to apply so many patches, I interpret that as meaning that they are actually finding unmodified upstream DWM unusable, despite being "much smaller, faster and simpler" than other window managers...
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sun Nov 21, 2021 9:54 pm    Post subject: Reply with quote

Hu wrote:
I think having a configuration file to let the user manage their keybindings without a recompile would not significantly reduce its security. Between that and the inability even to enable well-known patches without use of source code patching, and that some of the well-known patches are mutually incompatible, this feels to me more like the author(s) identified some functionality they didn't want to write, then retrofitted an explanation ("application security") to justify the missing features. For most projects, well-known patches like this would have been merged and gated behind a configuration flag, so that users can turn the feature on/off with just a preprocessor directive. That would also make it easier to review the true impact of a change, since all the affected code would be in the same checkout, rather than needing to worry about which patches a given change will break.
I didn't want to speculate :).

Without further explanation, the stated security reason seems awkward. Something additional such as "not wanting to be responsible for writing code which insufficiently filters user input" might do it. Or even better, lose the security issue and sate that it is left as a learning exercise for the user. In the end, it seems that if someone isn't willing to learn how to edit the config and recompile the code, then maybe "it isn't the right WM for them."


GDH-gentoo wrote:
However, I've seen plenty of forum threads where users want help for combining several patches that conflict with each other, and if many users of DWM want to apply so many patches, I interpret that as meaning that they are actually finding unmodified upstream DWM unusable, despite being "much smaller, faster and simpler" than other window managers...
One of the reasons I want to use it is to write some stuff that it doesn't have. Because it and other WMs are generally the "least worst" option.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum