Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Could someone reccomend me a tiling WM

#26
Sorry. Tongue
Reply

#27
(10-20-2012, 06:10 PM)machine! Wrote: I bet both OS X and Win32 have tiling window-managers too though.

OS X can run some *NIX WMs with X11. I've seen guides for DWM.

Win32 has no third-party window manager that I know, but it does have AutoHotKey which has been used to implement a dwm-like system for managing your windows: bug.n
Reply

Reply

#29
What would be a good way to start using a WM coming from a DE, currently using XFCE on Arch (switched distros recently, loving it Cool )?
How long is a piece of string?
Reply

#30
Well, depends on what you looking for...

Why do you want to switch using another WM from the one included in XFCE?
Reply

#31
Yep, what machine said. Why do you want to move away, and do you expect to love the interface even more with just a WM?
Reply

#32
i'm looking into dwm actually, it looks like it meets some of my requirements, and i'm pretty handy with C\C++. just looking to cut down on desktop clutter and fewer reasons to touch my mouse.
How long is a piece of string?
Reply

#33
EDIT: As always, there's an arch wiki page for that: https://wiki.archlinux.org/index.php/Dwm


Well, on Arch the basics are pretty straightforward, you just change your .xinitrc if you're using startx or look for info on how to configure your desktop manager if you're using one.

As for actually compiling dwm, that's straightforward too. Just get its source, configure config.mk to install it somewhere in your home (I put it in ~/usr/bin/ and the manpage in ~/usr/share/man) configure config.h to your liking, make, make install. Then do the same with dmenu (or install it from the arch repos if you don't need to configure that).

Then you need to set up something that sets the status bar text if you want something down there. This is done using xsetroot -name "$message".

The way I do it (but it's very hackish) is to launch dwm from my .xinitrc by sourcing this script with DWM's path as argument.
Code:
#!/bin/bash

dwmmsg () {
    read msg
    xsetroot -name "$msg"
}

wmpath=$1
shift

msgfile=$HOME/var/run/dwm/message
statusline=$HOME/bin/dwmstatus
defmsg=''

while true; do
    if [[ -r "$msgfile" ]]; then
        dwmmsg < "$msgfile"
    elif [[ -r "$statusline" ]]; then
        { source "$statusline"; } | dwmmsg
    else
        echo "$defmsg" | dwmmsg
    fi

    sleep 1
done &

while true; do
    "$wmpath"
    [[ -e "$HOME/var/run/dwm/loop" ]] || break
done

exit

Note that this uses bash, which is not very portable...

It sources $HOME/bin/statusline to generate my status line every second. Whatever is in $HOME/var/run/dwm/message overrides the status line, and whatever is in $defmsg is the default if the two others somehow don't work. I don't really use that.

It also runs the WM in a loop if the $HOME/var/run/dwm/loop exists, which is handy when I recompile DWM and don't want to kill X when I quit it.

Here's a smaller (untested) version for you, you could simply copypaste that into your .xinitrc (if that's what you use) and configure the three variables at the top.
Code:
#!/bin/sh
dwm=$HOME/usr/bin/dwm
statusline=$HOME/bin/dwmstatus
loopfile=$HOME/var/run/dwm/loop

dwmmsg () {
    read msg
    xsetroot -name "$msg"
}

while true; do
    if [ -r "$statusline" ]; then
        { source "$statusline"; } | dwmmsg
    else
        echo "$statusline not found" | dwmmsg
    fi

    sleep 1
done &

while true; do
    "$dwm"
    [ -e "$loopfile" ] || break
done

exit
and the dwmstatus script I use:
Code:
echo -n \
'Volume: '\
    $(amixer sget Master | sed -nr "s/.*\[([-.0-9]*dB)\].*/\1/p" | { amixer sget Master | grep '\[off\]' > /dev/null && sed 's/.*/(&)/' || cat; })\
' | '\
$(date +"%a %b %d %T")


Note that there's something better to set the root window's name (i.e. the status bar contents) that's made in C, so that's less overhead. See: http://dwm.suckless.org/dwmstatus/
Reply

#34
Cool MrBougo! I hope you don't mind if I use that too, currently my dwm only shows time and date.
Reply

#35
Sure, the scripts in my previous post in this thread are licensed under WTFPL.

I'll try to explain the volume bit though:
$(amixer sget Master | sed -nr "s/.*\[([-.0-9]*dB)\].*/\1/p" | { amixer sget Master | grep '\[off\]' > /dev/null && sed 's/.*/(&)/' || cat; })

amixer sget Master gives me this:
Quote:Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 42 [66%] [-22.00dB] [on]

I filter that using sed, whose -n flag disable the default action of printing every line that goes through it, and the -r flag means to use extended regex.
Then I have it filter the bit that's made of dashes, commas and digits followed by "dB", so that's the last line in my case. Then I pipe it through something strange-looking: if grep finds '[off]' in amixer sget Master, then sed is run, takes the standard input from the pipe and adds parentheses around it, outputting that. Otherwise it's just cat, so the standard input is copied to the output. So if Master is off (i.e. sound is muted), the volume is put in parentheses.

I wrote this a while ago and now I think it's awful. I don't like how it's running amixer twice and I also don't like that it's taking a handful of characters out of the four lines of output. There's got to be a more efficient way.

EDIT: Also, I should use grep -Fq '[off]' instead of grep with an escaped regex and a redirect to /dev/null. In fact I'm changing this now:
Code:
$(amixer sget Master | sed -nr "s/.*\[([-.0-9]*dB)\].*/\1/p" | { amixer sget Master | grep -qF '[off]' && sed 's/.*/(&)/' || cat; })
Reply

#36
=o I admire your great use of of those UNIX commands. I have to learn sed and grep!
Reply

#37
I know my question is stupid, but what is "tiling WM"?
[Image: 0_e8735_c58a251e_orig]
Reply

#38
I'll do what Maddin did to me:

http://lmgtfy.com/?q=tiling+wm

Tongue
Reply

#39
rocknroll237, that's simply cruel!
[Image: 0_e8735_c58a251e_orig]
Reply

#40
@aa previous page has a tl;dr explanation from machine! and one more comprehensive from MrBougo if you're not up to the dry stuff on wikipedia
@MrBougo thanks for the kickstart with that script, it's close to what i am after. I won't lie though, while i'm comfortable with C, i can never seem to get the hang of bash scripting, guess this is one reason to. now to find that thread to showing off desktops ...
How long is a piece of string?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  I wish I could fix this. mjoooo 1 3,837 12-20-2017, 05:07 PM
Last Post: Halogene
  Looking for someone to create station ID's end user 0 3,645 07-08-2016, 12:28 AM
Last Post: end user
  Could someone teach me high poly modelling? Faraday 2 3,900 01-12-2013, 06:55 AM
Last Post: aa

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-