Light DM issues

VastOne

Quote from: PackRat on September 28, 2014, 06:02:47 PM
thanks
Got the ncurses list of wm's going; just need to figure out automounting for removable media.

devmon?

devmon is a configuration-less bash daemon script which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and manually mount and unmount devices (From IgnorantGuru's Blog)
VSIDO      VSIDO Change Blog    

    I dev VSIDO

superwow

How about that, you got some buds over at Semplice. Their distro looks pretty good too. I'll have to follow him on Twitter.

PackRat

#122
I've never used devmon; heard of it though.

Figured it out, though, cleaning up the scripts and putting it through it's paces. Get a nice ncurses based list of wm's as well as tmux, shutdown, and reboot. Nice piece of work by the BBQ grillers. I just made a couple changes to get automounting to work. Their Cream edition had all the scripts I needed, but was setup to manually mount removable drives - makes sense since the BBQ crowd is a security conscious bunch of power users.

It's not vital, but I do want to figure out how to drop out of the wm list into the console, or add that to the list.

Kudos to the BBQ grillers for a really slick way to login graphically without a dm. Saves about 25M in memory.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

jedi

Made sure to tweet them back thanking them for the fix!  Nice when Linux communities can collaborate...
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

ozitraveller

'udevil' is currently unsupported, isn't it? Is there an alternative?

Just curious.

airtime

Just wanted to say thank you to Vastone and PackRat .. Great job everyone. This really help me. I am not sure why I didnt think about using xinit since that is the setup I use on my test Fedora system.  :-[

VastOne

Welcome to VSIDO airtime.. We are glad to have you!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

VastOne

Quote from: ozitraveller on September 29, 2014, 06:04:54 AM
'udevil' is currently unsupported, isn't it? Is there an alternative?

Just curious.

hehe .. just curious my a**

That is a very good question Ozi... I think of udevil as more of a static or config type application and see it as less of an issue as spacefm... of course I could be dead wrong.  And yes there are alternatives already installed that have been in place long before udevil .. udisks2 and gvfs
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

#128
Edit - You will need to purge lightdm from your system before setting this up. I used systemctl to disable the lightdm service, but the next lightdm upgrade re-enabled it.

For those of us who use more than one window manger, I have my system configured now to log in from an ncurses based display manager - courtesy of the linuxBBQ cream edition. On my system, for now, there are three files that require configuration. The login procedure takes advantage of startx being able to call any file. By default,

startx

calls the $HOME/.xinitrc file, but you can also use:

startx <path/init file> <window manager>

to call some other init file with the .xinitrc syntax - note that the full path to the init file is required.

The following files are configured for my system, but should be self-explanatory.

.xinitrc    <-- I have a separate .xinitrc as a failsafe, this one will start fluxbox with support for automounting removable media.

#!/bin/sh

########################################################################
##  Merge in defaults and keymaps                                     ##
########################################################################

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

if [ -f $sysresources ]; then
    /usr/bin/xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    /usr/bin/xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    /usr/bin/xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    /usr/bin/xmodmap $usermodmap
fi

########################################################################
##  Start fluxbox Desktop Environment                                 ##
########################################################################

#if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
#  exec ck-launch-session dbus-launch --exit-with-session /usr/local/bin/startfluxbox
#else
#  exec dbus-launch --exit-with-session /usr/local/bin/startfluxbox
#fi

exec dbus-launch --exit-with-session /usr/local/bin/startfluxbox



.wminitrc       <-- just a .xinitrc for multiple window managers. $HOME/defaultWM is the same as my .xinitrc (as I recall, a symlink didn't work). Files like dwm-session are startup scripts similar to /usr/bin/startfluxbox. This is the file to be used by the display manager, I have it $HOME:

#!/bin/sh

DEFAULT_SESSION="$HOME/.defaultWM"

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

if [ -f $sysresources ]; then
    /usr/bin/xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    /usr/bin/xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    /usr/bin/xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    /usr/bin/xmodmap $usermodmap
fi


case $1 in

fluxbox)

exec dbus-launch --exit-with-session /usr/local/bin/startfluxbox

;;


i3)

exec dbus-launch --exit-with-session /usr/bin/i3

;;


openbox)

exec dbus-launch --exit-with-session /usr/bin/openbox-session

;;


fvwm)

exec dbus-launch --exit-with-session /usr/local/bin/fvwm-session

;;

dwm)

exec dbus-launch --exit-with-session /usr/local/bin/dwm-session

;;

spectrwm)

exec dbus-launch --exit-with-session /usr/local/bin/spectrwm-session

;;

# --- do not edit below this line --

*)
exec  $DEFAULT_SESSION
;;

esac


.wmselectrc  <-- this is the script to start the ncurses based display manager; run when you log in. I have it $HOME because I'm the only user that needs it. It can reside in /usr/bin or some other location on the PATH for system-wide use. There are two main areas to edit - the "alist=( window managers list )" line where any installed window managers you want selectable are listed, and the "case $wm in" section where the window manager list is matched up with the appropriate startx command. Note how the names used for the window mangers need to match up between the alist and the .wminitrc

#!/bin/bash

# taken and modified from linuxBBQ cream edition pick-wm file
# kudos to the grillers at linuxbbq.org

VERSION="cream-0.1"     # updated for cream

# WMLIST='/usr/bin/wmlist'      # name of the wm list file; last entry should be 'POWEROFF'
# README="$HOME/README" # name of the readme file

RELEASE="VSIDO"

# the list of window managers can be read from a file, one line at a time
# alist=($(cat $WMLIST))

# or set here inside the script. either way the last entry should always be POWEROFF

alist=( Fluxbox i3 Fvwm Dwm Spectrwm Openbox Tmux Reboot Poweroff )

let num=${#alist[*]}-1     # number of items in the array (minus one to account for zero index)
tmpfile=$(mktemp)          # make a temp file for dialog return value

# make a list in menu format, with a number first, then the name
for i in $(seq 0 $num); do
    blist[i]=$(echo $i ${alist[i]})
done

while true; do
    # display the list in a dialog, save the return value (the index number) in the tmpfile
    dialog --backtitle "$RELEASE" --no-tags --menu 'please choose a window manager' 20 50 50 ${blist[*]} 2>$tmpfile
    [[ $? = 1 ]] && exit # user chose "cancel"

    chosen=$(<$tmpfile)    # get the index from the tmpfile

    # index into the WM array to get the name of the WM
    wm=${alist[$chosen]}
    case $wm in
        Fluxbox )
            startx "$HOME/.wminitrc" fluxbox
            ;;
        i3 )
            startx "$HOME/.wminitrc" i3
            ;;
        Fvwm )
            startx "$HOME/.wminitrc" fvwm
            ;;
        Dwm )
            startx "$HOME/.wminitrc" dwm
            ;;
        Spectrwm )
            startx "$HOME/.wminitrc" spectrwm
            ;;
        Openbox )
            startx "$HOME/.wminitrc" openbox
            ;;
        Tmux )
            tmux
            ;;
        Reboot )
            sudo reboot
            ;;
        Poweroff )
            sudo poweroff
            ;;
        * )
            xinit $wm
        ;;
    esac
done


I'm using startx instead of xinit (the default for linuxBBQ Cream) because that is the only way I could get automounting of removable drives working (I have yet to find the reason for this). If you don't want to automount removable drives,  you can go back to the origianl xinit $wm used in linuxBBQ. The original files from the linuxBBQ Cream iso are bbqlogin, pick-wm, and the xinitrc.

To start the display manger when logging in edit your $HOME/.bash_profile

# Created by V-Ger for use in the VSIDO env
# ~/.bash_profile: executed by bash(1) for login shells.

# the default umask is set in /etc/login.defs
#umask 022

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# Add $HOME/ items to PATH #
PATH=$PATH:$HOME/bin:$HOME/conky:./

#HISTORY
HISTSIZE=250
HISTFILESIZE=50

export EDITOR=/usr/bin/'nano -w'

#start X at login
##if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
##  exec startx

##fi

# ncurses list of wm's

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec "$HOME/.wmselectrc"

fi



Get a window like this  -



I'm sure there is a much more elegant and efficient way to code this, so suggestions are welcome.

Edit #2 - Bit of an issue with having this script and startx in the $HOME/.bash_profile (on my system anyway). If I want to drop out of the X session into a tty console, the script (or startx) will run again when logging in. Also Ctl-Alt-F1 doesn't work (apparently tty1 is in use with these methods). I can log into as a user that doesn't have the X session started by the $HOME/.bash_profile. Finally, exit or Ctl-Alt-F7  do not quit the tty and return to the original X session; Ctrl-Alt-Backspace does not kill X.

Edit #3 - fixed syntax error in .bash_profile. Can now drop into tty with Ctrl+Alt+F2, but cannot exit back to X-session.
Edit #4 - Ctrl+Alt+F1 will return to the X-session but not kill tty2. Curious, I have never known Ctl+Alt+F7 not to handle that, or "exit"
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

statmonkey

Quote from: VastOne on September 29, 2014, 03:03:15 PM
Quote from: ozitraveller on September 29, 2014, 06:04:54 AM
'udevil' is currently unsupported, isn't it? Is there an alternative?

Just curious.

hehe .. just curious my a**

That is a very good question Ozi... I think of udevil as more of a static or config type application and see it as less of an issue as spacefm... of course I could be dead wrong.  And yes there are alternatives already installed that have been in place long before udevil .. udisks2 and gvfs

Already mentioned this elsewhere but I really would advise against udevil.  I think what ozi meant was are there not efficient/elegant alternatives to udevil ... that would preclude udisks2 and gvfs :)  The answer would be (to the best of my knowledge NO).

VastOne

Quote from: statmonkey on September 29, 2014, 04:30:59 PM
Quote from: VastOne on September 29, 2014, 03:03:15 PM
Quote from: ozitraveller on September 29, 2014, 06:04:54 AM
'udevil' is currently unsupported, isn't it? Is there an alternative?

Just curious.

hehe .. just curious my a**

That is a very good question Ozi... I think of udevil as more of a static or config type application and see it as less of an issue as spacefm... of course I could be dead wrong.  And yes there are alternatives already installed that have been in place long before udevil .. udisks2 and gvfs

Already mentioned this elsewhere but I really would advise against udevil.  I think what ozi meant was are there not efficient/elegant alternatives to udevil ... that would preclude udisks2 and gvfs :)  The answer would be (to the best of my knowledge NO).

Where exactly does that leave it then?  PolKit to allow for click and mount in apps like Thunar require those as a minimum. Stick with something that is unsupported or go back to something that is not well received... tough choices
VSIDO      VSIDO Change Blog    

    I dev VSIDO

statmonkey

Yes, I believed I mentioned a snail moving across the edge of a razor blade before.  It is a bit Gordian, in the knot sense.  I think you go with what is not well received and rely on the community to do it's magic.  I know of several people who are looking at the udevil stuff as well as some other alternatives and think once things settle something will "turn" up.  PolKit  :'( what a disaster imho.  I think polkit is going to mature but for now it's not what it should be.

VastOne

@statman,

Well said.. Time will tell...
VSIDO      VSIDO Change Blog    

    I dev VSIDO

ozitraveller

Quote from: VastOne on September 29, 2014, 04:56:50 PM
Quote from: statmonkey on September 29, 2014, 04:30:59 PM
Quote from: VastOne on September 29, 2014, 03:03:15 PM
Quote from: ozitraveller on September 29, 2014, 06:04:54 AM
'udevil' is currently unsupported, isn't it? Is there an alternative?

Just curious.


hehe .. just curious my a**

That is a very good question Ozi... I think of udevil as more of a static or config type application and see it as less of an issue as spacefm... of course I could be dead wrong.  And yes there are alternatives already installed that have been in place long before udevil .. udisks2 and gvfs

Already mentioned this elsewhere but I really would advise against udevil.  I think what ozi meant was are there not efficient/elegant alternatives to udevil ... that would preclude udisks2 and gvfs :)  The answer would be (to the best of my knowledge NO).

Where exactly does that leave it then?  PolKit to allow for click and mount in apps like Thunar require those as a minimum. Stick with something that is unsupported or go back to something that is not well received... tough choices


;D You just never know what will fall out until you shake all the trees.

VastOne

So true Ozi and thanks for posting that!  :D
VSIDO      VSIDO Change Blog    

    I dev VSIDO