# Multiple wm .xinitrc



## sk8harddiefast (Nov 16, 2010)

I have dwm & fluxbox. How can I make .xinitrc to ask me witch one I want to choose?


----------



## klanger (Nov 16, 2010)

Slim, kdm, gdm, xdm?

Or 
	
	



```
ee
```
 & commenting out (#) alternative window manager before 
	
	



```
startx
```


----------



## rusty (Nov 16, 2010)

Could use something like this in your .xinitrc, it won't ask which but you can just type startx (or xinit) dwm/fluxbox.


```
case $1 in
fluxbox)
  # fluxbox specific stuff &
  exec ck-launch-session fluxbox
  ;;
dwm)
  # dwm specific stuff &
  exec ck-launch-session dwm
  ;;
*)
  # a default wm in here
  ;;
esac
```


----------



## EdGe (Nov 16, 2010)

If you want to start different WM from command line, why not define aliases in
your login shell's configuration file instead of complicating things with .xinitrc?


----------



## sk8harddiefast (Nov 16, 2010)

This did the job for me:

```
if [[ $1 == "fluxbox" ]]
then
  exec startfluxbox
elif [[ $1 == "dwm" ]]
then
  exec dwm
else
  echo "Choose a window manager"
fi

#fbsetroot -solid black
#exec conky &
#exec ipager &
#exec fluxbox

while true;
do
   xsetroot -name  ["$(date +"%a %b %d %r")"]
   sleep 1s
   fbsetbg -f /home/emberdaemon/Downloads/37826-black-rock-shooter-hatsune-miku-tagme-vocaloid.jpg
done &
#exec conky &
exec dwm
```
But I am commenting (#)


----------



## vermaden (Nov 16, 2010)

> ```
> if [[ $1 == "fluxbox" ]]
> then
> exec startfluxbox
> ...



Isn't that simpler?

```
case ${1} in
  (fluxbox) startfluxbox ;;
  (dwm)     dwm ;;
  (*)       echo "Choose a window manager" ;;
esac
```



> ```
> while true;
> do
> xsetroot -name  ["$(date +"%a %b %d %r")"]
> ...


Why You are setting the same wallpaper every 1 second?

Its definitely not needed ... it should be like that:

```
fbsetbg -f /home/emberdaemon/Downloads/37826-black-rock-shooter-hatsune-miku-tagme-vocaloid.jpg
```


```
exec dwm
```
... and at the end You are AGAIN starting dwm, no matter what the choice at the beginning was, this script is pure mess mate.

It should look like that:

```
#! /bin/sh

fbsetbg -f /home/emberdaemon/Downloads/37826-black-rock-shooter-hatsune-miku-tagme-vocaloid.jpg &
conky &

case ${1} in
  (fluxbox) startfluxbox ;;
  (dwm)     dwm ;;
  (*)       echo "Choose a window manager" ;;
esac
```


----------



## sk8harddiefast (Nov 16, 2010)

Because I want to rescan every 1 second to be changed the seconds on clock


----------



## Beastie (Nov 16, 2010)

Use conky instead of looping many operations, every second, indefinitely. Or use x11-clocks/xclock, which works in both analog and digital mode.


----------



## sk8harddiefast (Nov 16, 2010)

I would like to remove conky and do it like this: http://dwm.suckless.org/screenshots/dwm-20101101.png (bar on top) but I don't know how.


----------



## Beastie (Nov 16, 2010)

The *while* loop (that uses *xsetroot*) you have in the .xinitrc file above should work then.


----------



## nekoexmachina (Nov 19, 2010)

> I would like to remove conky and do it like this: http://dwm.suckless.org/screenshots/dwm-20101101.png  (bar on top) but I don't know how.


I do not know how to achive that with dwm's bar, but you can do that easily with dzen2.
http://sites.google.com/site/gotmor/dzen


> 37826-black-rock-shooter-hatsune-miku-tagme-vocaloid.jpg


Hey  One more hatsune's fan on the forums.
May be you will be interested: script to download all the wpprs from konachan with the tag $TAG
http://nopaste.info/cee56adf98.html
used, like, python ./script $TAG


----------



## sk8harddiefast (Nov 19, 2010)

I never understood how dzen2 work


----------



## Beastie (Nov 19, 2010)

nekoexmachina said:
			
		

> I do not know how to achive that with dwm's bar


Look at the post above yours. It's nothing more than a detached (*&*) *while* loop that displays whatever you want (*`date str?time blabla`*, etc.) on the root window through *xsetroot* or similar and sleep()s the delay you want until the next turn. Nothing simpler.


----------



## nekoexmachina (Nov 20, 2010)

> Look at the post above yours


I've meant the icons on the bar, not the text.



> I never understood how dzen2 work


Just like the post above, with some format options, e.g. while loop/conky/whatever with text & bitmap path & fonts & colors info formatted in dzen's format.


----------

