moetunes / Nextwm

snapwm is an easy to configure, dynamic, tiling window manager. Built on dminiwm with a desktop switcher, info bar and reloadable rc file.
53 stars 5 forks source link

Startup File for Startup Commands #13

Closed xgeek-cub closed 10 years ago

xgeek-cub commented 10 years ago

Do we have a file in which we put start up commands. (like feh or xsetroot and ....)?

Sometimes and by that I mean most of the times we need some commands and scripts only for one specific WM so that doesn't make much sanse to source them in ~/.xinitrc or similar files.

moetunes commented 10 years ago

Again, being a lightweight wm, I haven't added the ability to run apps at startup to snapwm but it's something I'll take a look at. I get around that by having a .xinitrc, a .xinitrc1, a .xinitrc2 etc where startx uses .xinitrc and I run xinit ~/.xinitrc1 or xinit ~/.xinitrc2 etc to try different wm's. From an already running wm you can do xinit ~/.xinitrc2 -- :1 to run a wm on another DISPLAY to check it out and switch between the two with ctrl+alt+F7/8 depending on your setup.

xgeek-cub commented 10 years ago

Well you're the Master; (but if it not too much of a hassle adding this feature would be nice). I have a very messy way that worked on other lightweight wms. I created ~/startsnapwm, populated it this way and then source ~/startsnapwm in ~/.xinitrc.

#!/usr/local/bin/bash
ck-launch-session dbus-launch --sh-syntax --exit-with-session snapwm

#xsetroot -cursor_name left_ptr &
#xbindkeys &
compton -cCGfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88 &
feh --bg-scale ~/.bg/fruits.png &
#wmtime

but It didn't worked on snapwm. (startsnapwm is executable.)

moetunes commented 10 years ago

Looking at that, the first thing you run is snapwm and when you close snapwm then compton and feh are run. Your ck-launch line should be last.

xgeek-cub commented 10 years ago

oh you are right; or I should background it (&) . Thanks \0

moetunes commented 10 years ago

If you background snapwm then when you close the wm X will still run because you have feh or compton as the last run app in .xinitrc. You won't be able to open a terminal to close them so you will have to change to the tty you started X from and ctrl+c to kill it. You would be better off doing things the established way. e.g. feh & compton & ck-launch snapwm

HTH

xgeek-cub commented 10 years ago

Talking about the established way; Is it right to do this into ~/.xinitrc


[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
case $1 in
musca)
    exec /usr/home/avalon/muscastart &
    exec ck-launch-session dbus-launch --sh-syntax --exit-with-session musca
    ;;
snapwm)
    exec /usr/share/avalon/snapwmstart &
    exec ck-launch-session dbus-launch --sh-syntax --exit-with-session snapwm
    ;;

esac

and then put this into snapwmstart (executable bash script)

#!/usr/local/bin/bash

xsetroot -cursor_name left_ptr &
compton -cCGfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88 &
feh --bg-scale ~/.bg/fruits.png &
wmtime

I am asking this in account of the start up file is before instance of WM in ~/.xinitrc?

moetunes commented 10 years ago

No. You should only have one exec at the start of a line for each wm. so: /usr/home/avalon/muscastart & exec ck-launch-session dbus-launch --sh-syntax --exit-with-session musca

What does wmtime do? Why don't you background that? snapwm won't be started if wmtime keeps doing something, like being open or whatever it does... You don't need to put feh etc in another script and run that, just add the commands to the wm blocks in .xinitrc. You really should be using man pages or the freebsd forums to sort out your X startup, it's not really the wm's issue.

xgeek-cub commented 10 years ago

Yes you are right. Thank you (wmtime is a dockable clock) and my ~/.xinitrc is from https://bbs.archlinux.org/viewtopic.php?pid=1386474#p1386474

moetunes commented 10 years ago

Sorry for not having a look at that link to the arch forums earlier. That .xinitrc is full of fail and I didn't bother correcting chickenPie4tea on that since I have no interest in a .xinitrc that can start any one of a number of wm's. He has struggled a bit with different wm's and I wouldn't be suprised if that .xinitrc was the cuase for most of the issues. Cheers