improve connection check in dwmbar, improve keybinds

This commit is contained in:
opfez 2021-05-06 21:08:42 +02:00
parent 80a2cec7a2
commit 2321635eed
2 changed files with 10 additions and 14 deletions

View File

@ -1,13 +1,11 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 4; /* border pixel of windows */
static const unsigned int gappx = 8; /* gaps between windows */
static const int swallowfloating = 1;
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 0; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "SourceCodePro:size=20" };
static const char dmenufont[] = "SourceCodePro:size=10";
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
//static const char col_gray1[] = "#890a01";
static const char col_gray2[] = "#333333";
@ -82,12 +80,12 @@ static Key keys[] = {
{ 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_k, focusstack, {.i = +1 } },
{ MODKEY, XK_l, 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_j, setmfact, {.f = -0.05} },
{ MODKEY, XK_semicolon, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_q, killclient, {0} },

4
dwmbar
View File

@ -36,7 +36,7 @@ battery() {
}
internetp() {
if ping archlinux.org -c 1 > /dev/null; then
if ip a | grep "inet " | grep -v 127 > /dev/null; then
printf "NET connected"
else
printf "NET disconnected"
@ -53,8 +53,6 @@ while true; do
dispstr=""
dispstr="$dispstr$(keyboard)"
dispstr="$dispstr$(alsa)"
dispstr="$dispstr$(chargingp)"
dispstr="$dispstr$(battery)"
dispstr="$dispstr$(internetp)"
dispstr="$dispstr$(current_time)"