You are not logged in.
Thanks, this worked for me.
Offline
here is my config.c
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-terminus-*-*-*-*-18-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#719171";
static const char normbgcolor[] = "#3A3A3A";
static const char normfgcolor[] = "#CCCCCC";
static const char selbordercolor[] = "#9C9869";
static const char selbgcolor[] = "#3A3A3A";
static const char selfgcolor[] = "#719171";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = False; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5" };
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ NULL, "arandr", NULL, 0, True, -1 },
{ NULL, "lxappearance", NULL, 0, True, -1 },
{ NULL, NULL, "mpv", 0, True, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
#include "bstack.c"
#include "bstackhoriz.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "| TTT |", bstack },
{ "| []= |", tile }, /* first entry is default */
{ "| ><> |", NULL }, /* no layout function means floating behavior */
{ "| [M] |", monocle },
{ "| === |", bstackhoriz },
};
/* key definitions */
#define ALTKEY Mod1Mask
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *dmenu[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor,
static const char *urxvt[] = { "urxvt", NULL };
static const char *arm[] = { "urxvt", "-e", "arm", NULL };
static const char *news[] = { "urxvt", "-e", "newsbeuter", NULL };
static const char *htop[] = { "urxvt", "-e", "htop", NULL };
static const char *mail[] = { "urxvt", "-e", "mutt", NULL };
static const char *mc[] = { "urxvt", "-e", "mc", NULL };
static const char *ncmp[] = { "urxvt", "-e", "ncmpcpp", NULL };
static const char *net[] = { "urxvt", "-e", "elinks", NULL };
static const char *xsc[] = { "xscreensaver-command", "-lock", NULL };
static const char *gimp[] = { "gimp", NULL };
static const char *wri[] = { "libreoffice", "--writer", "--nologo", NULL };
static const char *cal[] = { "libreoffice", "--calc", "--nologo", NULL };
static const char *del[] = { "deluge-gtk", NULL };
static const char *scr[] = { "scrot", NULL };
static const char *lxa[] = { "lxappearance", NULL };
static const char *ara[] = { "arandr", NULL };
static const char *vup[] = { "amixer", "sset", "Master", "2+", NULL };
static const char *vdn[] = { "amixer", "sset", "Master", "2-", NULL };
static const char *vmt[] = { "amixer", "sset", "Master", "toggle", NULL };
static Key keys[] = {
/* modifier key function argument */
{ ALTKEY, 0x64, spawn, {.v = dmenu } },
{ ALTKEY, 0x66, spawn, {.v = mc } },
{ ALTKEY, 0x75, spawn, {.v = urxvt } },
{ ALTKEY, 0x70, spawn, {.v = ncmp } },
{ ALTKEY, 0x6e, spawn, {.v = news } },
{ ALTKEY, 0x6d, spawn, {.v = mail } },
{ ALTKEY, 0x61, spawn, {.v = arm } },
{ ALTKEY, 0x77, spawn, {.v = net } },
{ ALTKEY, 0x72, spawn, {.v = del } },
{ ALTKEY, 0x68, spawn, {.v = htop } },
{ ALTKEY, 0x6c, spawn, {.v = xsc } },
{ ALTKEY, 0xff97, spawn, {.v = gimp } },
{ ALTKEY, 0xff95, spawn, {.v = wri } },
{ ALTKEY, 0xff9a, spawn, {.v = cal } },
{ ALTKEY, 0xff96, spawn, {.v = ara } },
{ ALTKEY, 0xff98, spawn, {.v = scr } },
{ ALTKEY, 0xff9d, spawn, {.v = lxa } },
{ ALTKEY, 0x3d, spawn, {.v = vup } },
{ ALTKEY, 0x2d, spawn, {.v = vdn } },
{ ALTKEY, 0xff08, spawn, {.v = vmt } },
{ 0, 0xff7f, togglebar, {0} },
{ MODKEY, 0x6a, focusstack, {.i = +1 } },
{ MODKEY, 0x6b, focusstack, {.i = -1 } },
{ MODKEY, 0x69, incnmaster, {.i = +1 } },
{ MODKEY, 0x64, incnmaster, {.i = -1 } },
{ MODKEY, 0x68, setmfact, {.f = -0.05} },
{ MODKEY, 0x6c, setmfact, {.f = +0.05} },
{ MODKEY, 0xff0d, zoom, {0} },
{ MODKEY, 0xff09, view, {0} },
{ MODKEY|ShiftMask, 0x71, killclient, {0} },
{ MODKEY|ShiftMask, 0x62, setlayout, {.v = &layouts[0]} },
{ MODKEY|ShiftMask, 0x74, setlayout, {.v = &layouts[1]} },
{ MODKEY|ShiftMask, 0x66, setlayout, {.v = &layouts[2]} },
{ MODKEY|ShiftMask, 0x6d, setlayout, {.v = &layouts[3]} },
{ MODKEY|ShiftMask, 0x73, setlayout, {.v = &layouts[4]} },
{ MODKEY, 0x20, setlayout, {0} },
{ MODKEY|ShiftMask, 0x20, togglefloating, {0} },
{ MODKEY, 0x0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, 0x0, tag, {.ui = ~0 } },
{ MODKEY, 0x2c, focusmon, {.i = -1 } },
{ MODKEY, 0x2e, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, 0x2c, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, 0x2e, tagmon, {.i = +1 } },
TAGKEYS( 0x31, 0)
TAGKEYS( 0x32, 1)
TAGKEYS( 0x33, 2)
TAGKEYS( 0x34, 3)
TAGKEYS( 0x35, 4)
{ MODKEY|ShiftMask, 0x65, quit, {0} },
};
/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = urxvt } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
the bar via .xinitrc pretty simple and findable in wiki
while true; do
DWM_VOL=$( amixer -c0 sget Master | awk -vORS=' ' '/Mono:/{print($6$4)}');
DWM_CLOCK=$( date '+[%e %b %Y %a][%I:%M]');
DWM_STATUS="| $DWM_VOL| $DWM_CLOCK";
xsetroot -name "$DWM_STATUS";
sleep 1s;
done &
Offline
I finally managed to make a DWM status to my liking. It was based on our fellow archer W0ng's bar and can be seen here:
Here it is:
#!/bin/bash
#
# ~/bin/dwm-statusbar
# Adapted from w0ng status bar: https://github.com/w0ng/bin
# Colour codes from dwm/config.h
color0="\x01" # normal
color1="\x02" # selected
color2="\x03" # red alert
color3="\x04" # bright green on gray
color4="\x05" # red
color5="\x06" # orange
color6="\x07" # yellow
color7="\x08" # green
color8="\x09" # ocean green
color9="\x0a" # blue
color10="\x0b" # indigo
color11="\x0c" # violet
color12="\x0d" # bright green on light gray
# Icon glyphs are from font Tamsynmod. make sure to set your locale to an ISO8559 one, else icons won't show.
#---separator
sp="$(echo -ne "${color3} ")"
#---not currently in use
print_song_info() {
song_info="$(ncmpcpp --now-playing '{{{{%a - }%t}}|{%f}}' | head -c 75)"
if [[ ! $song_info ]]; then
song_info=""
fi
echo -ne "${color4}ê${color12}${song_info}"
}
print_power() {
status="$(cat /sys/class/power_supply/ACAD/online)"
battery="$(cat /sys/class/power_supply/BAT1/capacity)"
if [ "${status}" == 1 ]; then
echo -ne "${color5}Â${color12}on"
else
echo -ne "${color4}ð${color12}${battery}%"
fi
}
print_wifiqual() {
wifiqual="$(cat /proc/net/wireless | awk 'FNR == 3 {print $3}' | tr -d [:punct:])"
echo -ne "${color7}¤${color12}${wifiqual}%"
}
print_uptime() {
uptime="$(uptime | awk '{print $3}' | tr -d [=,=])"
echo -ne "${color6}È${color12}${uptime}"
}
print_hddfree() {
hddfree="$(df -Ph /dev/sda4 | awk '$3 ~ /[0-9]+/ {print $4}')"
echo -ne "${color8}¨${color12}${hddfree}"
}
print_swap_used() {
swapused="$(free -h | awk 'FNR == 4 {print $3}')"
echo -ne "${color9}Ð${color12}${swapused}"
}
print_mem_used() {
mem_used="$(free -h | awk 'FNR == 3 {print $3}')"
echo -ne "${color10}×${color12}${mem_used}"
}
print_volume() {
volume="$(amixer get PCM | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -ne "${color4}í${color12}${volume}%"
}
print_datetime() {
datetime="$(date "+%a %d %b %H:%M")"
echo -ne "${color5}É${color12}${datetime}"
}
# cpu (from: https://bbs.archlinux.org/viewtopic.php?pid=661641#p661641)
while true; do
# get new cpu idle and total usage
eval $(awk '/^cpu /{print "cpu_idle_now=" $5 "; cpu_total_now=" $2+$3+$4+$5 }' /proc/stat)
cpu_interval=$((cpu_total_now-${cpu_total_old:-0}))
# calculate cpu usage (%)
let cpu_used="100 * ($cpu_interval - ($cpu_idle_now-${cpu_idle_old:-0})) / $cpu_interval"
# output vars
print_cpu_used() {
printf "%-1b" "${color11}Ñ${color12}${cpu_used}%"
#"%-10b" "${color7}CPU:${cpu_used}%"
}
# Pipe to status bar, not indented due to printing extra spaces/tabs
xsetroot -name "$(print_power)${sp}$(print_uptime)${sp}$(print_wifiqual)${sp}$(print_hddfree)${sp}$(print_swap_used)${sp}$(print_mem_used)${sp}$(print_cpu_used)${sp}$(print_volume)${sp}$(print_datetime)"
# reset old rates
cpu_idle_old=$cpu_idle_now
cpu_total_old=$cpu_total_now
# loop stats every 1 second
sleep 1
done
The icon font used is Tamsynmod.
Also, my config.h:
/* appearance */
#define NUMCOLORS 13 // need at least 3
static const char colors[NUMCOLORS][ColLast][16] = {
// border foreground background
{ "#919191", "#919191", "#0c0c0c" }, // 0 = normal
{ "#e0f04e", "#e0f04e", "#0c0c0c" }, // 1 = selected
{ "#ff0000", "#ff0000", "#0c0c0c" }, // 2 = alert red
{ "#e0f04e", "#e0f04e", "#262626" }, // 3 = bright green on dark
{ "#f7f7f7", "#f46c50", "#262626" }, // 4 = red
{ "#f7f7f7", "#f4a550", "#262626" }, // 5 = orange
{ "#f7f7f7", "#f5df50", "#262626" }, // 6 = yellow
{ "#f7f7f7", "#9ddf49", "#262626" }, // 7 = green
{ "#f7f7f7", "#3ab166", "#262626" }, // 8 = oceangreen
{ "#f7f7f7", "#367e99", "#262626" }, // 9 = blue
{ "#f7f7f7", "#8c38a1", "#262626" }, // 10 = indigo
{ "#f7f7f7", "#d0447f", "#262626" }, // 11 = violet
{ "#c3c3c3", "#c3c3c3", "#262626" }, // 12 = gray on gray
// add more here
};
static const char font[] = "-*-tamsynmod-medium-r-*-*-17-*-*-*-*-*-*-*"; //-*-terminus-medium-r-*-*-20-*-*-*-*-*-*-*";
static const char font2[] = "-*-terminus-medium-r-*-*-22-*-*-*-*-*-*-*"; /* This is Dmenu's font */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 6; /* gap size between windows */
static const unsigned int snap = 8; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* tagging. */
static const char *tags[] = { "terms", "web", "files", "edit", "media", "xtra", };
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 1 << 3, True, -1 },
{ "Firefox", NULL, NULL, 1 << 1, False, -1 },
{ "Thunar", NULL, NULL, 1 << 2, False, -1 },
{ "Geany", NULL, NULL, 1 << 3, False, -1 },
{ "Uzbl", NULL, NULL, 1 << 1, False, -1 },
{ "MPlayer", NULL, NULL, 1 << 4, False, -1 },
{ "URxvt", NULL, NULL, 1 << 0, False, -1 },
{ "libreoffice", NULL, NULL, 1 << 3, True, -1 },
{ "Transmission-gtk", NULL, NULL, 1 << 5, False, -1 },
};
/* layout(s) */
static const float mfact = 0.52; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
#include "fibonacci.c"
#include "bstack.c"
#include "bstackhoriz.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "ù", spiral },
{ "þ", tile }, /* first entry is default */
{ "ý", NULL }, /* no layout function means floating behavior */
{ "ÿ", monocle },
{ "ø", dwindle },
{ "ü", bstack },
{ "û", bstackhoriz },
};
/* key definitions Super = Mod4Mask. Left Alt = Mod1Mask */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-b", "-fn", font2, "-nb", colors[0][ColBG], "-nf", colors[0][ColFG],"-sb", colors[1][ColBG], "-sf", colors[1][ColFG], NULL };
static const char *termcmd[] = { "urxvt", NULL };
/* static const char *muscmd[] = { "cmus", NULL }; */
/* static const char *fmcmd[] = { "thunar", NULL}; */
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_y, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_v, incnmaster, {.i = +1 } },
{ MODKEY, XK_p, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_s, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_w, setlayout, {.v = &layouts[4]} },
{ MODKEY, XK_b, setlayout, {.v = &layouts[5]} },
{ MODKEY, XK_n, setlayout, {.v = &layouts[6]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button3, view, {0} },
{ ClkTagBar, 0, Button1, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
Last edited by alexx (2014-02-07 12:56:59)
Offline
<Deleted Previous Post>
EDIT:
I started with a different patch base from KieranQuinn (Thanks Kieran!) and patched cycle and push to it. I had to modify JasonWRyan's patch to make it apply for this new set of patches (the modified patches are in the github). Thank you for sharing the patch! Push/Cycle is one of the "must have" patches. Used scripts/icons from JasonWRyan, W0ng, Alexx.
DWM Github
Statusbar Script Github
Patches:
statuscolors
statusallmons
centredfloating
savefloats
notitle
pertag2
systray
occupiedcol
uselessgaps
keysymfix
bstack
runorraise
Push
Cycle
Last edited by frank604 (2014-03-10 16:19:16)
Offline
Does someone know a patch who allows more fine grained settings per tag? I want to change some things per tag for dwm but also for the called programs. My target is to have a different layout of the status bar and a different colorscheme for each tag. (Programms don't have to switch the colorscheme on runtime, because the won't be moved outside their colorscheme.)
Last edited by bebna (2014-03-11 13:59:50)
Offline
Does someone know a patch who allows more fine grained settings per tag? I want to change some things per tag for dwm but also for the called programs. My target is to have a different layout of the status bar and a different colorscheme for each tag. (Programms don't have to switch the colorscheme on runtime, because the won't be moved outside their colorscheme.)
Different layout of statusbar = not dwm (Most people use xsetroot, dzen, or conky unless you mean tag names??)
Different colorscheme for each tag = ?? You mean the tag names? Or the color you see in terminals? What programs?
Bottom line: I don't think so unless you write it.
Offline
Does someone know a patch who allows more fine grained settings per tag? I want to change some things per tag for dwm but also for the called programs. My target is to have a different layout of the status bar and a different colorscheme for each tag. (Programms don't have to switch the colorscheme on runtime, because the won't be moved outside their colorscheme.)
This isn't a support thread: it's in Artwork and Screenshots. Also, look at Awesome.
Offline
There is this new status bar in C: :-)
I'm trying to make it show remaining battery time, it's almost decent
Offline
Thanks for the acknowedgement in there alexx. But you may want to check out Unia's version as he has taken this a lot farther than I ever did.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I already saw Unia's version, also looks very nice.
I ended up forking your version because I found it closer to my personal needs for a DWM status bar, and for some reason I found your code a little bit easier to follow (I used the dwm status bar to start learning C, so... )
Thanks for the reply
Offline
@alexx, Great stuff! I've been meaning to convert to a hardcoded statusbar sometime in the future. I did look at Trilby's and Unia's bar awhile ago. Guess it's time to work on this over this coming weekend and learn some C while I'm at it.
Offline
Both of you are free to send me an email if you need help I started exactly like you with Trilby as "instructor", so it would be awesome to do the same for someone else now!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
^^ hey guys, don't mean to offtopic but how to use these hardcoded bars ? I mean I compiled Trilby's code and ran with ./ but it didn't produce any output.
Exactly how'd I be able to see the output ?
"First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack." ~ George Carrette
Offline
I doesn't produce output - it sets the "output" or status information to the root window's title which is where dwm reads status information from.
(oops, good software is easy to confuse)
Last edited by Trilby (2014-03-19 22:26:29)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I doesn't produce output - it sets the "output" or status information to the root window's title which is where
dwbdwm reads status information from.
Fixed that for you
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Both of you are free to send me an email if you need help I started exactly like you with Trilby as "instructor", so it would be awesome to do the same for someone else now!
Thanks Unia, I'll hit you up with some questions if any arise. +1 to our Arch community
Offline
Long time lurker, first time writer, bla bla bla
terminal: st-dvtm
font: proggyoptis
statusbar: still i3status
dwm-source: http://git.uleenucks.de/builds/tree/dwm-git
theme: solarized
Offline
If only using floating window, https://github.com/sw2wolf/dwm.git works great! It is small and fast, i like it
e^(π⋅i) + 1 = 0
Offline
I'm using this dwm config (what can I say I like it simple)
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[] = "#222222";
static const char normfgcolor[] = "#bbbbbb";
static const char selbordercolor[] = "#005577";
static const char selbgcolor[] = "#005577";
static const char selfgcolor[] = "#eeeeee";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};
/* key definitions */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "uxterm", NULL };
static const char *shutdowncmd[] = { "sudo", "shutdown", "-h", "now", NULL };
static const char *rebootcmd[] = {"sudo", "shutdown", "-r", "now", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = shutdowncmd } },
{ MODKEY|ShiftMask, XK_r, spawn, {.v = rebootcmd } },
};
/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
Last edited by ioanm (2014-05-04 06:35:18)
Arch Linux + i3wm (amd64)
Offline
<Deleted Previous Post>
EDIT:
I started with a different patch base from KieranQuinn (Thanks Kieran!) and patched cycle and push to it. I had to modify JasonWRyan's patch to make it apply for this new set of patches (the modified patches are in the github). Thank you for sharing the patch! Push/Cycle is one of the "must have" patches. Used scripts/icons from JasonWRyan, W0ng, Alexx.http://www.frankshin.com/files/ss/screenthumb.png
http://www.frankshin.com/files/ss/screenthumb2.pngDWM Github
Statusbar Script GithubPatches:
statuscolors
statusallmons
centredfloating
savefloats
notitle
pertag2
systray
occupiedcol
uselessgaps
keysymfix
bstack
runorraise
Push
Cycle
Can you tell me what's the name of patch to get underline in tags?
rm -rf /
Offline
Can you tell me what's the name of patch to get underline in tags?
There has been a couple of different ones posted here and in the hackers thread.
There is this one that draws it on top ( can play with it to change it to bottom ); https://bbs.archlinux.org/viewtopic.php … 00#p899400
And one other one that simply reuses drawsquare() and turns it into a line that I can't find at the moment, but easy enough to do.
You could also just go to frank604's github and look at his dwm.c to see how he did it.
And another one here that did it; https://github.com/KieranQuinn/dwm
selected tag underline (configurable via config.h)
Last edited by Crunch (2014-05-14 00:41:57)
Registered Linux user #536591.
Offline
Crunch gave a far better answer than I could give. I wouldn't know the specific patch to enable the underline as I used Kieran's dwm base. The only two patches I had to apply were push cycle.
The config.h does have a taglinepx value you can modify and you can look at the dwm.c code (I see line 802-830 to be associated with this, there could be more). Sorry I'm not much of a help.
Offline
Thanks.
rm -rf /
Offline
Hi
Im brand new to dwm , i thought i3 was nice but this ... anyhoo not much to see here, just the default conky with some pkg update notifications (needs cower)
out_to_console yes
out_to_x no
background no
update_interval 2
total_run_times 0
use_spacer none
TEXT
Pacman Updates ${execi 7200 checkupdates | wc -l} AUR Updates ${execi 7200 cower -u | wc -l} | $mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% / ${cpu cpu3}% /${cpu cpu4}% | ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed enp4s0}K/s ${upspeed enp4s0}K/s :: ${time %a %b %d %I:%M%P}
cheers, excellent thread
Last edited by cirrus (2014-06-29 21:27:03)
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline
Hey!
Is somebody using JDownloader for downloading from different file hosts? I'm trying for hours now to configure dwm rules the right way..
I can tell the main window to always start on the last tag:
{ "jd-Main", NULL, "JDownloader", 1 << 8, False, -1 },
but this way the captcha window also starts only on the last tag. I would like it to start on the currently visible tag.
The class/instance name seems to be "sun-awt-X11-XDialogPeer", but creating rules for this doesn't work..
I was wondering if maybe one of you got it to work, or maybe got a workaround for this?
Offline