LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-25-2017, 07:20 AM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
A versatile default X session chooser.


The attached script sets the default X session for the user who runs it in runlevel 3 (using startx) and 4: I have tested it with xdm (with some caveat, see the comment on top), gdm2, kdm, lxdm, lightdm. If it works also with gdm3 or sddm, please let me know.

It has accountsservice as dependency, because the script user-xsession.py used to set the session for lightdm needs it. A package that bundle this script with accountsservice is here: http://slackware.uk/slint/x86_64/slint-testing/slint/ and the source repo is there (thanks Eric for the SlackBuild): http://slackware.uk/slint/x86_64/sli...countsservice/

Alternatively if you don't intend to install lightdm (that needs PAM), jut edit the script accordingly.

You will also need to edit it to add window managers, that would need to have a .desktop stored in /usr/share/xsessions.

TIP: the lightweight window managers often don't ship with a .desktop, but there are a lot of them in /usr/share/apps/kdm/sessions/, that you can just copy to /usr/share/xsessions

Save the script in /usr/bin and make it executable or include it in a package.
Attached Files
File Type: txt session-chooser.txt (2.3 KB, 65 views)

Last edited by Didier Spaier; 11-25-2017 at 07:33 AM. Reason: Title modified
 
Old 11-25-2017, 07:51 AM   #2
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by Didier Spaier View Post
Alternatively if you don't intend to install lightdm (that needs PAM), jut edit the script accordingly.
That phrase made me to raise a eyebrow...

BLASPHEMY! SLINT CONTAINS PAM!

You should be excommunicated and to be sent out of village with no pants, because you insult The True Slackware Way and you pact with the unbelievers and PAM worshipers! BOB have mercy for you!

P.S. Now downloading the latest SLINT ISO, to see with my eyes your sins...

P.S.2 For those who wonder about "with no pants" part, it is for historical consistence, as in Medieval France the excommunicated ones was (forcefully) sent out from the city or village, well... with no pants.

I have no information if that rule was applied also to ladies.

Last edited by Darth Vader; 11-25-2017 at 08:35 AM.
 
1 members found this post helpful.
Old 11-25-2017, 08:22 AM   #3
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,500

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by Darth Vader View Post
I have no information if that rule was applied also to ladies.
Nope, the ladies was just declared witches and fried, to save their souls, as in any Catholic country while Medieval Age.

Last edited by LuckyCyborg; 11-25-2017 at 08:24 AM.
 
2 members found this post helpful.
Old 11-25-2017, 09:27 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Isn't this what xwmconfig is for?
 
Old 11-25-2017, 10:28 AM   #5
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
Quote:
Originally Posted by Darth Vader View Post
P.S.2 For those who wonder about "with no pants" part, it is for historical consistence, as in Medieval France the excommunicated ones was (forcefully) sent out from the city or village, well... with no pants.
If you happen to have a whole fortune file with such informative hilarious trivia facts, please do share.
 
Old 11-25-2017, 10:44 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Isn't this what xwmconfig is for?
It it is, but not as versatile. For instance, it can't set the default session for lightdm or gdm. You can choose a session in lightdm's greeter, but this setting is not accessible to blind users.

I have also modified xwmconfig to add these features, but that's another story, and some people may prefer a text UI to a ncurses dialog.

Last edited by Didier Spaier; 11-25-2017 at 10:47 AM.
 
1 members found this post helpful.
Old 11-25-2017, 10:55 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Ahh, ok. That makes sense.

I use XDM myself with a custom /etc/X11/xdm/Xsession file(I don't like the stock one). I've never seen the point of gdm, and now that I know it doesn't respect the users .xsession file, I'm even less inclined to go near it.

Last edited by GazL; 11-25-2017 at 10:57 AM.
 
Old 11-25-2017, 11:31 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
I use XDM myself with a custom /etc/X11/xdm/Xsession file.
Would you like to share it? I could steal ideas to enhance the Xsession files that I have also adapted, like for lxdm and lightdm.
 
Old 11-25-2017, 12:07 PM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Sure, but it's a fairly invasive rewrite of X11 related parts.

Firstly, the motivation behind the change was primarily that I didn't like how the stock Xsession file runs and re-runs the /etc/profile file: First it sources them and then there's another section which runs 'bash --login' in order to dynamically determine the PATH (which will run through it all again in the subshell). I really hated that, so I ripped it all out and just had it run /etc/xprofile instead.

I created a /etc/xprofile.d/ directory which contains symlinks to the files in /etc/profile.d minus any that aren't really appropriate for an X environment. So basically something like this:
Code:
test@ws1:~$ ls -l /etc/xprofile.d
total 0
lrwxrwxrwx 1 root root 26 Nov 15  2016 00-manpath.sh -> ../profile.d/00-manpath.sh
lrwxrwxrwx 1 root root 28 Nov 15  2016 00-pkgconfig.sh -> ../profile.d/00-pkgconfig.sh
lrwxrwxrwx 1 root root 24 Apr 27  2017 freetype.sh -> ../profile.d/freetype.sh
lrwxrwxrwx 1 root root 22 Nov 14  2016 glibc.csh -> ../profile.d/glibc.csh
lrwxrwxrwx 1 root root 21 Nov 14  2016 glibc.sh -> ../profile.d/glibc.sh
lrwxrwxrwx 1 root root 21 Nov 14  2016 gtk+.csh -> ../profile.d/gtk+.csh
lrwxrwxrwx 1 root root 20 Nov 14  2016 gtk+.sh -> ../profile.d/gtk+.sh
lrwxrwxrwx 1 root root 21 Nov 14  2016 lang.csh -> ../profile.d/lang.csh
lrwxrwxrwx 1 root root 20 Nov 14  2016 lang.sh -> ../profile.d/lang.sh
lrwxrwxrwx 1 root root 25 Nov 14  2016 libglib2.csh -> ../profile.d/libglib2.csh
lrwxrwxrwx 1 root root 24 Nov 14  2016 libglib2.sh -> ../profile.d/libglib2.sh
lrwxrwxrwx 1 root root 26 Nov 14  2016 pkgconfig.csh -> ../profile.d/pkgconfig.csh
lrwxrwxrwx 1 root root 25 Nov 14  2016 pkgconfig.sh -> ../profile.d/pkgconfig.sh
lrwxrwxrwx 1 root root 26 Mar 17  2017 pulseaudio.sh -> ../profile.d/pulseaudio.sh
lrwxrwxrwx 1 root root 20 Nov 14  2016 qt4.csh -> ../profile.d/qt4.csh
lrwxrwxrwx 1 root root 19 Nov 14  2016 qt4.sh -> ../profile.d/qt4.sh
lrwxrwxrwx 1 root root 21 Nov 14  2016 scim.csh -> ../profile.d/scim.csh
lrwxrwxrwx 1 root root 20 Nov 14  2016 scim.sh -> ../profile.d/scim.sh
lrwxrwxrwx 1 root root 22 Nov 14  2016 t1lib.csh -> ../profile.d/t1lib.csh
lrwxrwxrwx 1 root root 21 Nov 14  2016 t1lib.sh -> ../profile.d/t1lib.sh
lrwxrwxrwx 1 root root 22 Nov 14  2016 vdpau.csh -> ../profile.d/vdpau.csh
lrwxrwxrwx 1 root root 21 Nov 14  2016 vdpau.sh -> ../profile.d/vdpau.sh
lrwxrwxrwx 1 root root 39 Nov 14  2016 z-dot-in-non-root-path.csh -> ../profile.d/z-dot-in-non-root-path.csh
lrwxrwxrwx 1 root root 38 Nov 14  2016 z-dot-in-non-root-path.sh -> ../profile.d/z-dot-in-non-root-path.sh
(the z-dot-in ones are chmod -x in /etc/profile.d/ so they don't get run anyway)

Now, to allow the user to select different environments in xdm you alter the translations part of /etc/X11/xdm/Xresources like this.
Code:
xlogin*login.translations: #override \
        Ctrl<Key>R: abort-display()\n\
        <Key>F1: set-session-argument(failsafe) finish-field()\n\
        <Key>F2: set-session-argument(xfce) finish-field()\n\  
        <Key>Delete: delete-character()\n\
        <Key>Left: move-backward-character()\n\
        <Key>Right: move-forward-character()\n\
        <Key>Home: move-to-begining()\n\
        <Key>End: move-to-end()\n\
        Ctrl<Key>KP_Enter: set-session-argument(failsafe) finish-field()\n\
        <Key>KP_Enter: set-session-argument() finish-field()\n\
        Ctrl<Key>Return: set-session-argument(failsafe) finish-field()\n\
        <Key>Return: set-session-argument() finish-field()
if the user presses F1 instead of enter after typing their password they get the fail-safe, press F2 and they get xfce. Just hit enter and they get whatever their ~/.xsession does.


Anyway, I've been using this for a while now and it works for me, but it is a significant deviation to what stock Slackware provides.

files attached:

PS. I also included my rc.4.local as I do some interesting stuff in there to to help prevent SAK issues.

Last edited by GazL; 06-06-2018 at 01:02 PM.
 
4 members found this post helpful.
Old 11-25-2017, 12:27 PM   #10
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
That's interesting, thanks for sharing.
 
1 members found this post helpful.
Old 11-26-2017, 09:33 AM   #11
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally Posted by Didier Spaier View Post
Would you like to share it? I could steal ideas to enhance the Xsession files that I have also adapted, like for lxdm and lightdm.
Not sure if that's of interest for your case, and you probably already know https://slackbuilds.org/repository/1...are-xdm-theme/

Johannes
 
1 members found this post helpful.
Old 11-26-2017, 11:14 AM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
I will look at that, thanks Johannes.
 
Old 11-26-2017, 12:09 PM   #13
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
I installed it in Slint with "spi -i slackware-xdm-theme", selected it with "dm-chooser xdm" and rebooted.

It looks nice. I just need to modify it to display "Slint"

Last edited by Didier Spaier; 11-26-2017 at 12:15 PM.
 
Old 11-26-2017, 12:43 PM   #14
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

I recently wrote a slackware xdm theme (requires imagemagick, and optionally numlockx) which looks like this :

Click image for larger version

Name:	xdm-theme-sample-1.jpg
Views:	92
Size:	141.6 KB
ID:	26419
This theme can be customized at different levels using configuration files.

For instance, it is possible to :

* defines whether or not the clock is displayed.

* defines which buttons must be present in the buttons bar and their order.

* specify one or more extra image operations that are applied to the background image. Here is two example :

1. extra image ops: "-emboss 8"

Click image for larger version

Name:	xdm-theme-emboss-op.jpg
Views:	59
Size:	163.2 KB
ID:	26420
2. extra image ops: "-grayscale Rec709Luminance" "-emboss 8" "" "-flop"

Click image for larger version

Name:	xdm-theme-multi-op.jpg
Views:	59
Size:	254.1 KB
ID:	26421
Note: As extra image ops can be time consuming, an image cache is used to avoid to have to regenerate the (same) background image each time xdm (re)starts.

--
SeB
 
2 members found this post helpful.
Old 11-26-2017, 12:53 PM   #15
DarkVision
Member
 
Registered: Jul 2007
Posts: 199

Rep: Reputation: Disabled
Quote:
Originally Posted by phenixia2003 View Post
Hello,

I recently wrote a slackware xdm theme (requires imagemagick, and optionally numlockx) which looks like this :
--
SeB
Nice! How can i apply your theme?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change from default "Recently used" to some other directory in gtk file chooser Slackovado Slackware 4 12-30-2013 03:17 PM
[SOLVED] No xfce entry in KDM session chooser vdemuth Slackware 2 05-19-2012 10:16 AM
Default GUI Chooser? Zaskar Fedora 1 02-23-2004 08:58 PM
How do I AfterStep to my Session chooser in RH9 londonboi Linux - Distributions 0 08-11-2003 05:53 PM
session chooser in Slack 9.0 Culbert Slackware 12 05-13-2003 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration