You are not logged in.

#1 2014-07-13 17:11:14

Joel
Member
From: Tijuana, BC, México
Registered: 2011-12-21
Posts: 129

[Solved] Setting my own desktop environment

Hi, I'm trying to setup my own desktop environment with the following packages:

* slim
* metacity
* compton
* wbar

This is my slim conf:

# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        /bin:/usr/bin:/usr/local/bin
default_xserver     /usr/bin/X
xserver_arguments -nolisten tcp vt07

# Commands for halt, login, etc.
halt_cmd            /sbin/shutdown -h now
reboot_cmd          /sbin/shutdown -r now
console_cmd         /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
#suspend_cmd        /usr/sbin/suspend

# Full path to the xauth binary
xauth_path         /usr/bin/xauth 

# Xauth file for server
authfile           /var/run/slim.auth


# Activate numlock when slim starts. Valid values: on|off
numlock             on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
# login_cmd           exec /bin/sh - ~/.xinitrc %session
login_cmd           exec /bin/bash -login ~/.xinitrc %session

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd	some command
# sessionstop_cmd	some command

# Start in daemon mode. Valid values: yes | no
# Note that this can be overriden by the command line
# options "-d" and "-nodaemon"
# daemon	yes

# Set directory that contains the xsessions.
# slim reads xsesion from this directory, and be able to select.
sessiondir            /usr/share/xsessions/

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Bienvenido a %host

# Session message. Prepended to the session name when pressing F1
# session_msg         Session: 

# shutdown / reboot messages
shutdown_msg       The system is halting...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone

# Focus the password field on start when default_user is set
# Set to "yes" to enable this feature
#focus_password      no

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme       archlinux-slim-theme-whitey

# Lock file
lockfile            /var/lock/slim.lock

# Log file
logfile             /var/log/slim.log

Now, my desktop entry for the sessions, which is located $HOME/.config/joelDE/joelDE.desktop:

[Desktop Entry]
Name=joelDE
Comment=Mi entorno de escritorio
Exec=/home/joel/.config/joelDE/joelDE
TryExec=/home/joel/.config/joelDE/joelDE
Icon=/home/joel/.config/joelDE/joelDE.png
Type=Application

I made the symlink: ln -s /home/joel/.config/joelDE/joelDE.desktop /usr/share/xsessions/joelDE.desktop and it DOES appears in slim sessions (F1), now jolDE script:

#!/bin/bash

# mi propio entorno

(sleep 1s && metacity --replace &)
bash $HOME/.fehbg &
xscreensaver -no-splash &
(sleep 1s && compton --config $HOME/.config/compton.conf -b) &
(sleep 1s && wbar) &

and finally my .xinitrc:

#!/bin/bash

# ~/.xinitrc

if [[ ! "$1" ]]; then
	WM_Name=startxfce4
else
	WM_Name=$1
fi

setxkbmap -layout latam

if [ -z "$GTK_PATH" ] ; then
        GTK_PATH="/usr/lib/gtk-2.0"
else
        GTK_PATH="$GTK_PATH:/usr/lib/gtk-2.0"
fi

export GTK_PATH

if [ -z "$GTK_MODULES" ] ; then
        GTK_MODULES="canberra-gtk-module"
else
        GTK_MODULES="$GTK_MODULES:canberra-gtk-module"
fi

export GTK_MODULES

export LANG=es_MX.UTF-8

echo ${WM_Name} >$HOME/DE_name.txt

if [ ${WM_Name} != "startxfce4" ]; then
	export DESKTOP_SESSION=${WM_Name}
	export GTK2_RC_FILES=$HOME/.gtkrc-2.0
	exec dbus-launch --sh-syntax --exit-with-session ${WM_Name} >$HOME/xinitrc-log.txt 2>&1
else
	exec ${WM_Name} >$HOME/xinitrc-log.txt 2>&1
fi

# :~ EOF

This is the thing: after choosing "joelDE" in slim sessions it shows a black screen and rerun slim...

1.- Doesn't SLim run x11?
2.- If not, how do I call it?

Thanks!

Last edited by Joel (2014-07-14 04:37:30)


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.

Offline

#2 2014-07-13 17:39:25

aoba
Guest

Re: [Solved] Setting my own desktop environment

Try moving the metacity line in joelDE to the end of the file and remove the last '&':

#!/bin/bash

# mi propio entorno

bash $HOME/.fehbg &
xscreensaver -no-splash &
(sleep 1s && compton --config $HOME/.config/compton.conf -b) &
(sleep 1s && wbar) &

sleep 1s && metacity --replace

With startx, and I think that this is true for SLiM as well, your X session will last as long as your ~/.xinitrc (or, I think more technically, the exec $whatever that may be at the end of the file).  So if everything in ~/.xinitrc forks (or in your case, your joelDE script), that script will complete immediately, and the X session will exit with it.

#3 2014-07-14 04:36:52

Joel
Member
From: Tijuana, BC, México
Registered: 2011-12-21
Posts: 129

Re: [Solved] Setting my own desktop environment

Thanks for the tip, that did the trick, kudos for you aoba smile


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.

Offline

Board footer

Powered by FluxBB