Refracta Development, Scripts, etc.
Post a reply
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: change-username script needs to know display manager

Sun Nov 03, 2013 5:51 pm

(current release 3.5.13): Won't work because ps -C output is "kdm" whether it's trinity or kde4
The actual initscript is etc/init.d/kdm-trinity {start|stop|restart|reload|force-reload} (Irritatingly, no "status" option).. sysv-rc-conf --list is just a way to identify it properly and if it's active in any runlevel
EDIT: Another way:

Code:
  `if ls (/)etc/rc*.d|grep kdm-trinity|grep ^S ; then
  dm="kdm-trinity"
  else
  # is official kde (4x) KDM
  dm="kdm"
  fi`

(R14 testing versions): ps -C output is "tdm"
The actual initscript is etc/init.d/tdm-trinity {start|stop|restart|reload|force-reload}
raymerjacque

- raymerjacque
- Posts: 111
- Joined: Sun Nov 03, 2013 9:37 am

## Re: change-username script needs to know display manager

Sun Nov 03, 2013 7:36 pm

> fsmithred wrote:@raymerjacque: Could you post the ouput of this command for me, please? That way, I can see what processes are actually running when you're on the desktop.
> Code:
>   `ps ax |grep mdm`
> Thanks.
> @dzz: Thanks, that looks much better.

here you go :

> [email protected]
> :~$ ps ax |grep mdm
> 3176 ? Ss 0:00 /usr/sbin/mdm
> 3177 ? S 0:02 /usr/sbin/mdm
> 3200 tty7 Ss+ 341:15 /usr/bin/X :0 -audit 0 -auth /var/lib/mdm/:0.Xauth -nolisten tcp vt7
> 7570 pts/0 S+ 0:00 grep mdm

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: change-username script needs to know display manager

Mon Nov 04, 2013 2:06 pm

@raymerjacque: Thanks. I'll add mdm to the list. I assume the init script for it is (/)etc/init.d/mdm. Let me know if that's wrong.
@dzz: Just to be clear - there is no (/)etc/init.d/tdm? I like the 'sysv-rc-conf --list' but I'd rather avoid it so the script works in cases where that's not installed. The change-username script can be used at any time to change any user's name and home, not just for installation.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: change-username script needs to know display manager

Mon Nov 04, 2013 9:09 pm

> Just to be clear - there is no (/)etc/init.d/tdm? I like the 'sysv-rc-conf --list' but I'd rather avoid it so the script works in cases where that's not installed. The change-username script can be used at any time to change any user's name and home, not just for installation

Depending if "release" or "testing" version:
The actual initscript is named (/)etc/init.d/kdm-trinity or (/)etc/init.d/tdm-trinity
The actual executable is /opt/trinity/bin/kdm or /opt/trinity/bin/tdm
The process detected by ps is "kdm" or "tdm" so (if kdm) an extra check is needed to see if it's not kde4
True, sysv-rc-conf might not be installed so that's not the best way. Some alternatives:

Code:
  `ps ax|grep -v grep|grep /opt/trinity/bin/kdm
  ls (/)etc/rc*.d|grep kdm-trinity|grep ^S
  pgrep -lf "/opt/trinity/bin/kdm"`

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: change-username script needs to know display manager

Tue Nov 05, 2013 3:49 am

Here's another option I'm considering:

Code:
  `init 1`

Then it won't matter what dm is used. Kinda reminds me of Monty Python hunting mosquitoes with rocket launchers.
Something like this might work, too:

Code:
  `# This one gives error message for each missing file.
  dm_list=$(ls (/)etc/init.d/{gdm,kdm,lightdm,gdm3} 2>/dev/null)
  select display_manager in "$dm_list"; do
  #"$display_manager" restart
  echo "$display_manager"
  break
  done`

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: change-username script needs to know display manager

Tue Nov 05, 2013 4:27 am

Still missing:
cdm, lxdm, qingy, sddm, entrance, enter, orthos, and maybe others.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: change-username script needs to know display manager

Tue Nov 05, 2013 4:50 am

Even better, I think - remove that whole section. All it does is make it so you don't have to hit ctrl-alt-F7. (It's code that I borrowed from display-savior, where it really is needed.)
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.