注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Dwm"

From Funtoo
Jump to navigation Jump to search
(Created page with "{{Ebuild |Summary=<code>dwm</code> is extremely fast and lightweight window manager. It manages windows in tiled, floating and monocle layouts. |CatPkg=x11-wm/dwm |Maintainer=...")
 
m (more grammar fixes)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Ebuild
{{Ebuild
|Summary=<code>dwm</code> is extremely fast and lightweight window manager. It manages windows in tiled, floating and monocle layouts.
|Summary=<code>dwm</code> is an extremely fast and lightweight window manager. It manages windows in tiled, floating and monocle layouts.
|CatPkg=x11-wm/dwm
|CatPkg=x11-wm/dwm
|Maintainer=Ari Malinen
|Maintainer=Causes,
|Homepage=http://dwm.suckless.org/
|Homepage=http://dwm.suckless.org/
}}
}}
== Installation ==
== Installation ==


dmenu is needed to run programs from dwm.
A program launcher is needed to run programs from dwm. You can choose dmenu or rofi.
{{file|name=/etc/portage/make.conf|desc=Set dmenu USE-flag|body=
USE="$USE dmenu"
}}
<console>
<console>
###i## emerge -av dwm dmenu
###i## emerge -av dwm
</console>
</console>


== Configuration
== Configuration ==
 
dwm is configured by editing <code>/etc/portage/savedconfig/x11-wm/dwm-6.0</code> and rebuilding.


dwm is configured by editing <code>/etc/portage/savedconfig/x11-wm/dwm-6.0</code> and rebuilding dwm.


Enable savedconfig.
Enable savedconfig.
Line 48: Line 52:
|-
|-
|| <code>META+h / l</code> || Resize master area
|| <code>META+h / l</code> || Resize master area
|-
|| <code>META+t / f / m</code> || Switch to title / floating / monocle layout
|-
|| <code>shift+META+c</code> || Kill client
|-
|| <code>shift+META+3</code> || Move client to tag 3
|-
|| <code>shift+META+Enter</code> || Run terminal
|-
|| <code>shift+META+q</code> || Quit dwm
|}
|}
== Patching ==
Patches in <code>/etc/portage/patches/x11-wm/dwm</code> are applied when emerging dwm. Patches must have a .patch file extension.
<console>
###i## mkdir -p /etc/portage/patches/x11-wm/dwm
###i## cd /etc/portage/patches/x11-wm/dwm
###i## wget -O dwm-6.0-pertag.patch http://dwm.suckless.org/patches/dwm-6.0-pertag.diff
</console>
Rebuild dwm.
<console>
###i## emerge dwm
</console>
== Customize statusbar ==
Dwm has a statusbar that can be customized with <code>xsetroot</code>. You can run xsetroot from <code>~/.xinitrc</code>.
{{file|name=~/.xinitrc|lang=|desc=|body=
ifname="wlan0"
interval=5
rxs=0
txs=0
while true; do
        temp="$(cat /sys/class/thermal/thermal_zone1/temp {{!}} cut -b1,2)C"
        load="$(cat /proc/loadavg {{!}} cut -d " " -f 1)"
        bandwidth="${rxs}KiB/s ${txs}KiB/s"
        batusage="$(cat /sys/class/power_supply/BAT0/capacity)%"
        batstatus="$(cat /sys/class/power_supply/BAT0/status)"
        date="$(date +"%a %d.%m %H:%M")"
        xsetroot -name "$temp $load {{!}} $bandwidth {{!}} $batusage $batstatus {{!}} $date"
        rx1=$(cat /sys/class/net/$ifname/statistics/rx_bytes)
        tx1=$(cat /sys/class/net/$ifname/statistics/tx_bytes)
        sleep $interval
        rx2=$(cat /sys/class/net/$ifname/statistics/rx_bytes)
        tx2=$(cat /sys/class/net/$ifname/statistics/tx_bytes)
        rxs=$(expr $rx2 - $rx1)
        txs=$(expr $tx2 - $tx1)
        rxs=$(expr $rxs / $interval)
        txs=$(expr $txs / $interval)
        rxs=$(expr $rxs / 1024)
        txs=$(expr $txs / 1024)
done &
exec dwm
}}
== Starting ==
You can start dwm by configuring <code>~/.xinitrc</code> and running <code>startx</code>.
{{file|name=~/.xinitrc|lang=|desc=|body=
exec dwm
}}
<console>
$##i## startx
</console>
To autostart dwm on login see [[Getty as display manager]].
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 16:56, April 18, 2015

Dwm

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Installation

A program launcher is needed to run programs from dwm. You can choose dmenu or rofi.

   /etc/portage/make.conf - Set dmenu USE-flag
USE="$USE dmenu"
root # emerge -av dwm

Configuration

dwm is configured by editing /etc/portage/savedconfig/x11-wm/dwm-6.0 and rebuilding.


Enable savedconfig.

   /etc/portage/package.use
x11-wm/dwm savedconfig

Edit configuration file.

root # nano /etc/portage/savedconfig/x11-wm/dwm-6.0

Rebuild dwm.

root # emerge dwm

Basic usage

Shortcut Description
Alt META
META+p Run program with dmenu
META+3 Move to tag number 3
META+j / k Move to next / previous client
META+i / d Increase / decrease master clients
META+Enter Move client to master area
META+h / l Resize master area
META+t / f / m Switch to title / floating / monocle layout
shift+META+c Kill client
shift+META+3 Move client to tag 3
shift+META+Enter Run terminal
shift+META+q Quit dwm

Patching

Patches in /etc/portage/patches/x11-wm/dwm are applied when emerging dwm. Patches must have a .patch file extension.

root # mkdir -p /etc/portage/patches/x11-wm/dwm
root # cd /etc/portage/patches/x11-wm/dwm
root # wget -O dwm-6.0-pertag.patch http://dwm.suckless.org/patches/dwm-6.0-pertag.diff

Rebuild dwm.

root # emerge dwm

Customize statusbar

Dwm has a statusbar that can be customized with xsetroot. You can run xsetroot from ~/.xinitrc.

   ~/.xinitrc
ifname="wlan0"
interval=5

rxs=0
txs=0

while true; do
        temp="$(cat /sys/class/thermal/thermal_zone1/temp | cut -b1,2)C"
        load="$(cat /proc/loadavg | cut -d " " -f 1)"
        bandwidth="${rxs}KiB/s ${txs}KiB/s"
        batusage="$(cat /sys/class/power_supply/BAT0/capacity)%"
        batstatus="$(cat /sys/class/power_supply/BAT0/status)"
        date="$(date +"%a %d.%m %H:%M")"

        xsetroot -name "$temp $load | $bandwidth | $batusage $batstatus | $date"

        rx1=$(cat /sys/class/net/$ifname/statistics/rx_bytes)
        tx1=$(cat /sys/class/net/$ifname/statistics/tx_bytes)
        sleep $interval
        rx2=$(cat /sys/class/net/$ifname/statistics/rx_bytes)
        tx2=$(cat /sys/class/net/$ifname/statistics/tx_bytes)
        rxs=$(expr $rx2 - $rx1)
        txs=$(expr $tx2 - $tx1)
        rxs=$(expr $rxs / $interval)
        txs=$(expr $txs / $interval)
        rxs=$(expr $rxs / 1024)
        txs=$(expr $txs / 1024)
done &

exec dwm


Starting

You can start dwm by configuring ~/.xinitrc and running startx.

   ~/.xinitrc
exec dwm
user $ startx

To autostart dwm on login see Getty as display manager.