[THE 1st TIME] Changing window managers

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

[THE 1st TIME] Changing window managers

Unread post by machinebacon » Sun Feb 23, 2014 7:35 am

Every now and then I will write something like a beginners guide for those who have not yet got the experience in setting up a base system with a window manager.

If you have a Debian netinstall or LinuxBBQ noX (Spring 2014.1 for example), you can safely follow this guide.

1) Set up an X environment

This is needed to have a graphical interface for working.

Code: Select all

sudo apt-get install xorg xinit x11-utils x11-common xserver-xorg-video-all xserver-xorg-input-mouse xserver-xorg-input-evdev  xserver-xorg-input-kbd
You get more than you actually need, but this way we have definitely everything working.

2) Get your window manager

Now this depends largely on what you like. We take i3 here as example ;)

Code: Select all

sudo apt-get install i3 i3status i3lock
3) Edit the startup file

To actually get our xsession with i3 starting, we create an .xinitrc file:

Code: Select all

nano ~/.xinitrc
with the following content:

Code: Select all

#!/bin/bash
xset s off &
xset -dpms &
xrdb -merge ~/.Xresources &
xsetroot -cursor_name left_ptr &
setxkbmap us &
exec i3
The two xset commands disable screensaver and blanking, xrdb fetches the .Xresources file for a more beautiful terminal. xsetroot makes our mouse pointer look right ;) and setxkbmap sets our keyboard to US layout. The last line, starting with exec, actually executes our window manager. More about refinements in another episode ;)

Save and exit the editor (Ctrl-o , Enter, Ctrl-x) and now enter

Code: Select all

startx
If all is fine, you will be greeted in i3.
..gnutella..

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: [THE 1st TIME] Changing window managers

Unread post by machinebacon » Sun Feb 23, 2014 8:12 am

Addendum:

What if we can not make a decision on which WM to use? I surely know this problem, because I always switch between at least three of them, depending on mood.

1) Install some other WM

Well, an easy task. LinuxBBQ users can start

Code: Select all

roastyourown
and get to the menu where Window Managers can be chosen in a dialog. Of course we can install these easily, manually, from the repos:

Code: Select all

sudo apt-get install pekwm pekwm-themes
2) Start the right session

The easiest way is to edit .xinitrc again:

Code: Select all

nano ~/.xinitrc
and change the very last line to:

Code: Select all

exec pekwm
The clever guys comment the previous entry, so it looks like:

Code: Select all

#exec i3
exec pekwm
i3 gets skipped, pekwm gets started. Save and exit, then

Code: Select all

startx
and we are greeted by PekWM, a very openboxish window manager.
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: [THE 1st TIME] Changing window managers

Unread post by pidsley » Sun Feb 23, 2014 8:20 am

Thanks for posting these mb.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: [THE 1st TIME] Changing window managers

Unread post by GekkoP » Sun Feb 23, 2014 8:26 am

Oh yes, thanks a lot, I'll use this next time I'll go with netinstall/Spring.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: [THE 1st TIME] Changing window managers

Unread post by rhowaldt » Sun Feb 23, 2014 3:01 pm

awesome shit. thanks so much for writing these, all the 'Loosing your Virginity' posts are great :)
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
paolo
Head Banger
Posts: 275
Joined: Mon Nov 12, 2012 11:08 am
Location: Milano,Italy

Re: [THE 1st TIME] Changing window managers

Unread post by paolo » Sun Feb 23, 2014 9:06 pm

very good articles... I'm always a n00b, thanks !
Dell Latitude C640 - CPU P4 2GHz - RAM 1,5 GB - made in 2002 - I'm in the Manjaro-i3 land now :)

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: [THE 1st TIME] Changing window managers

Unread post by dkeg » Sun Feb 23, 2014 10:34 pm

Soon your .xinitrc will have a long list of commented out wm's. I wanted to share a solution I have been using for awhile now. I used to just comment/uncomment the various wm options. Now all I do is just a simple xinit wm. It's great when you have an array of wm's. Just copy paste into your .xinitrc and replace with the wm's you have installed. Of course, pids also has a random wm chooser around here also!

Code: Select all

# Start your window manager using xinit, xinit [wm]

DEFAULTSESSION=herbstluftwm

case "$1" in
        "cwm")
                exec cwm
                ;;
        "i3")
                exec i3 --shmlog-size 0
                ;;
        "monster")
                exec monsterwm
                ;;
        "spectrwm")
                exec spectrwm
                ;;
        "2bwm")
                exec 2bwm
                ;;
        *)
                exec $DEFAULTSESSION
                ;;
esac

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: [THE 1st TIME] Changing window managers

Unread post by GekkoP » Mon Feb 24, 2014 12:32 pm

^ pretty cool. I usually have custom .xinitrc for every wm I try, but your solution is better.

User avatar
MrPink
applies for custom title
Posts: 49
Joined: Tue Jan 22, 2013 10:38 pm

Re: [THE 1st TIME] Changing window managers

Unread post by MrPink » Tue Feb 25, 2014 3:39 pm

machinebacon wrote:You get more than you actually need, but this way we have definitely everything working.
The smxi script can identify and purge the xorg modules you don't need. It is required to have run X at least once (twice if you have switchable gfx cards, once with each card turned on).

edit: spelling, doh
Last edited by MrPink on Tue Mar 04, 2014 8:49 pm, edited 1 time in total.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: [THE 1st TIME] Changing window managers

Unread post by machinebacon » Tue Feb 25, 2014 4:39 pm

Thanks Mr Pink, there is a reason behind it: some people want to port their snapshot to other computers, that's why I did mention 'more than we actually need' :)

BTW, for those who haven't noticed, smxi is included in all BBQ spins.
..gnutella..

User avatar
elixir
Weight Watcher
Posts: 357
Joined: Fri Feb 21, 2014 8:25 am

Re: [THE 1st TIME] Changing window managers

Unread post by elixir » Tue Feb 25, 2014 6:30 pm

If only I read this sooner while I was struggling! :p

These tutorials are a good idea for new people! (like me)
Out of the corner of your eye you spot him... Shia LaBeouf.

https://www.youtube.com/watch?v=o0u4M6vppCI

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: [THE 1st TIME] Changing window managers

Unread post by wuxmedia » Tue Feb 25, 2014 10:58 pm

They are bloody good, for old people like me too!
"Seek, and Ye shall find"
"Github | Chooons | Site"

Post Reply