diff --git a/Makefile b/Makefile index 49606d3..46dfb5a 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ install: all cp -f scripts/speedwm-netctrl ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm-netctrl cp -f scripts/speedwm-btctrl ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm-btctrl cp -f scripts/speedwm_run ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm_run + cp -f scripts/speedwm_status ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm_status cp -f scripts/speedwm-core ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm-core cp -f scripts/speedwm-dfmpeg ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm-dfmpeg cp -f status ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/status @@ -98,6 +99,8 @@ install: all uninstall: rm -rf ${DESTDIR}${PREFIX}/bin/speedwm \ ${DESTDIR}${PREFIX}/bin/speedwm-utils \ + ${DESTDIR}${PREFIX}/bin/speedwm_run \ + ${DESTDIR}${PREFIX}/bin/speedwm_status \ ${DESTDIR}${PREFIX}/bin/speedwm-audioctrl \ ${DESTDIR}${PREFIX}/bin/speedwm-applist \ ${DESTDIR}${PREFIX}/bin/speedwm-winnav \ diff --git a/autostart.h b/autostart.h index 35f1d8d..6c10cec 100644 --- a/autostart.h +++ b/autostart.h @@ -11,33 +11,22 @@ * Once you're done with your edits, run 'make clean install'. *************************************************************/ -static const char *const autostart[] = { +static const char *autostart[] = { /* Autostart script, if it exists */ shell, "-c", "ls $HOME/.config/speedwm-de/autostart.sh && $HOME/.config/speedwm-de/autostart.sh", NULL, - /* Bind Right Super+hjkl to arrow keys */ - shell, "-c", "xmodmap -e 'keycode 134 = Mode_switch'", NULL, - shell, "-c", "xmodmap -e 'keycode 43 = h H Left H'", NULL, - shell, "-c", "xmodmap -e 'keycode 44 = j J Down J'", NULL, - shell, "-c", "xmodmap -e 'keycode 45 = k K Up K", NULL, - shell, "-c", "xmodmap -e 'keycode 46 = l L Right L", NULL, - - /* Caps Lock = Escape */ - shell, "-c", "xmodmap -e 'clear Lock'", NULL, - shell, "-c", "xmodmap -e 'keycode 66 = Escape NoSymbol Escape'", NULL, - /* Run the defined clipboard manager */ - shell, "-c", CLIPBOARD "&", NULL, + shell, "-c", CLIPBOARD "& > /tmp/clipboard-log", NULL, /* Run the defined compositor */ - shell, "-c", COMPOSITOR "&", NULL, + shell, "-c", COMPOSITOR "& > /tmp/compositor-log", NULL, /* Run the defined notification daemon */ - shell, "-c", NOTIFICATION "&", NULL, + shell, "-c", NOTIFICATION "& > /tmp/notification-log", NULL, - /* Run the status bar defined */ - shell, "-c", status, NULL, + /* Run the defined status bar */ + shell, "-c", "speedwm_status", NULL, NULL }; diff --git a/colors.h b/colors.h index 36e7b48..e78ec28 100644 --- a/colors.h +++ b/colors.h @@ -3,7 +3,8 @@ * * Once you're done with your edits, run 'make clean install'. */ -/* Misc color options */ +/* Misc color options + */ static char *colors[][3] = { [SchemeBar] = { col_textnorm, col_background, col_windowbordernorm }, [SchemeTags] = { col_textnorm, col_background, col_windowbordernorm }, @@ -12,13 +13,14 @@ static char *colors[][3] = { [SchemeStatus] = { col_textnorm, col_background, col_textsel }, [SchemeNormTitle] = { col_textnorm, col_background, col_background }, [SchemeSelTitle] = { col_textsel, col_title, col_textsel }, - [SchemeHid] = { col_title, col_background, col_title }, + [SchemeHiddenTitle] = { col_title, col_background, col_title }, [SchemeLayout] = { col_layouttext, col_layoutbgsel, col_layoutbgnorm }, /* text background window border */ }; -/* Colors for the status bar (.Xresources) */ +/* Colors for the status bar (.Xresources) + */ static char *colstatus[] = { col_status0, col_status1, @@ -40,7 +42,6 @@ static char *colstatus[] = { /* Colors to use for opacity */ - static const unsigned int alphas[][3] = { /* fg bg border/unused */ [SchemeBar] = { OPAQUE, baropacity, baropacity }, @@ -48,11 +49,12 @@ static const unsigned int alphas[][3] = { [SchemeSelTitle] = { OPAQUE, seltitleopacity, seltitleopacity }, [SchemeLayout] = { OPAQUE, layoutopacity, layoutopacity }, [SchemeStatus] = { OPAQUE, statusopacity, statusopacity }, - [SchemeHid] = { OPAQUE, hiddenopacity, hiddenopacity }, + [SchemeHiddenTitle] = { OPAQUE, hiddenopacity, hiddenopacity }, [SchemeTags] = { tagselopacity, tagselopacity, tagnormopacity }, }; -/* Colors to use for tags */ +/* Colors to use for tags + */ static char *tagsel[][2] = { { col_tag1_text, col_tag1 }, { col_tag2_text, col_tag2 }, @@ -66,7 +68,8 @@ static char *tagsel[][2] = { /* Text Background */ }; -/* Alpha for tags */ +/* Alpha for tags + */ static const unsigned int tagalpha[] = { tagselopacity, tagnormopacity, diff --git a/docs/example.Xresources b/docs/example.Xresources index 9ac7503..1972c18 100644 --- a/docs/example.Xresources +++ b/docs/example.Xresources @@ -165,6 +165,10 @@ !! - speedwm.autoresize: 1 !! +!! Urgent windows +!! + - speedwm.urgentwindows: 1 +!! !! Window icon size in pixels: !! - speedwm.iconsize: 10 diff --git a/options.h b/options.h index bb3df67..4170918 100644 --- a/options.h +++ b/options.h @@ -192,6 +192,7 @@ static char *alttrayname = "tray"; /* Polybar tray instance /* Misc */ static char shell[] = "/bin/sh"; /* Shell to use */ static int warpcursor = 1; /* Warp cursor when switching client/monitor */ +static int urgentwindows = 1; /* Color urgent tags */ static int pertag = 1; /* Use different mfact and layout for each layout */ static int wmclass = 1; /* Enable (1) workaround for when a class cannot be grabbed */ static int clicktofocus = 0; /* Click to focus, or focus when the mouse moves to another window */ diff --git a/options.mk b/options.mk index 4dc65ce..0df9b6d 100644 --- a/options.mk +++ b/options.mk @@ -43,7 +43,7 @@ FREETYPEINC = /usr/include/freetype2 # includes and libs INCS = -I${X11INC} -I${FREETYPEINC} -I${YAJLINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender ${IMLIB2LIBS} -lX11-xcb -lxcb -lxcb-res -lXext ${YAJLLIBS} -lXrdb +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender ${IMLIB2LIBS} -lX11-xcb -lxcb -lxcb-res -lXext ${YAJLLIBS} # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} diff --git a/scripts/speedwm-applist b/scripts/speedwm-applist index 64a8f71..34e16dc 100755 --- a/scripts/speedwm-applist +++ b/scripts/speedwm-applist @@ -31,7 +31,7 @@ fi # create applist MK_APPLIST() { if [ -e "$HOME/.local/share/speedwm/applist" ]; then - USER_CMD="$(printf "$(cat $HOME/.local/share/speedwm/applist)\n------\nAdd command\nRemove command\nClear\n" | $RUNLAUNCHER -l 20 -p 'Run: ' $GRIDARG $GRIDNUM)" + USER_CMD="$(printf "$(cat $HOME/.local/share/speedwm/applist)\n------\nAdd command\nRemove command\nClear\n" | $RUNLAUNCHER -l 20 -p 'Run:' $GRIDARG $GRIDNUM)" else mkdir -p $HOME/.local/share/speedwm echo "No commands added." > $HOME/.local/share/speedwm/applist @@ -67,7 +67,7 @@ CLEAR_CMD() { # add command ADD_CMD() { grep -q "No commands added" $HOME/.local/share/speedwm/applist && rm -f $HOME/.local/share/speedwm/applist - USER_I_ARG="$(printf "" | $RUNLAUNCHER -l 0 -p 'Enter a command: ' $GRIDARG $GRIDNUM)" + USER_I_ARG="$(printf "" | $RUNLAUNCHER -l 0 -p 'Enter a command:' $GRIDARG $GRIDNUM)" printf "$USER_I_ARG\n" >> $HOME/.local/share/speedwm/applist $0 && exit 0 } diff --git a/scripts/speedwm-compatcheck b/scripts/speedwm-compatcheck index c7cf050..b50d6e8 100755 --- a/scripts/speedwm-compatcheck +++ b/scripts/speedwm-compatcheck @@ -8,35 +8,35 @@ BINDIR=$(cat /usr/share/speedwm/bindir) if [ -e "${BINDIR}xrdb" ]; then xrdb_exists=true else - printf "WARNING: xrdb was not found. .Xresources and Pywal support will not work.\n" + printf "Error: ${BINDIR}xrdb was not found\n" && exit 1 fi # Check if wmctrl exists if [ -e "${BINDIR}wmctrl" ]; then wmctrl_exists=true else - printf "WARNING: wmctrl was not found. Window management using 'Alt+Tab' will not work.\n" + printf "Error: ${BINDIR}wmctrl was not found\n" && exit 1 fi # Check if xsetroot exists if [ -e "${BINDIR}xsetroot" ]; then xsetroot_exists=true else - printf "\nError: ${BINDIR}xsetroot was not found\n" && exit 1 + printf "Error: ${BINDIR}xsetroot was not found\n" && exit 1 fi # Check if xwallpaper exists if [ -e "${BINDIR}xwallpaper" ]; then xwallpaper_exists=true else - printf "WARNING: xwallpaper was not found. This means setting your wallpaper and Pywal support won't work.\n" + printf "Error: ${BINDIR}xwallpaper was not found\n" && exit 1 fi # Check if xmodmap exists if [ -e "${BINDIR}xmodmap" ]; then xmodmap_exists=true else - printf "WARNING: xmodmap was not found. This means the Alt+Tab script will not be able to remap Alt+hjkl temporarily.\n" + printf "Error: ${BINDIR}xmodmap was not found\n" && exit 1 fi # Check if trayer exists @@ -49,9 +49,11 @@ fi # Check if srg or not. if [ "$trayer_exists" = "false" ]; then - printf "WARNING: trayer was not found. This means the systray will not be available.\n" -elif [ "$trayer_srg" = "true" ]; then - printf "WARNING: Before trayer-srg can be used instead of trayer, you must edit ~/.config/speedwm-de/systray/config and set USE_SRG to true.\n" + if [ "$trayer_srg" = "true" ]; then + printf "WARNING: Before trayer-srg can be used instead of trayer, you must edit ~/.config/speedwm-de/systray/config and set USE_SRG to true.\n" + else + printf "WARNING: trayer was not found. This means the systray will not be available.\n" + fi fi # Check if dmenu exists diff --git a/scripts/speedwm-dm b/scripts/speedwm-dm index 04c3dc8..8ca78fe 100755 --- a/scripts/speedwm-dm +++ b/scripts/speedwm-dm @@ -23,10 +23,14 @@ PADDING=$(grep "barpaddingv" options.h | grep "0" | awk '{ print $5 }') # Write the compositor to /usr/share/speedwm/compositor COMPOSITOR=$(grep "define COMPOSITOR " options.h | awk '{ print $3 }' | sed 's/"//g') +# Status +STATUS=$(grep "char status" options.h | awk '{ print $5 }' | sed 's/"//g; s/;//g') + # Print all of it echo $TOPBAR | grep -q "1" && touch /usr/share/speedwm/topbar echo $PADDING | grep -q "0" && touch /usr/share/speedwm/nopadding echo $COMPOSITOR > /usr/share/speedwm/compositor +echo $STATUS > /usr/share/speedwm/statusbar echo $(pwd) > /usr/share/speedwm/sourcedir sed "s/#define //g" toggle.h | grep LAYOUT | sed "s|/[*]|#|g; s|[*]/||g; s/ //g; s/1/=1/g; s/0/=0/g; s/#/ # /g" > /usr/share/speedwm/layouts diff --git a/speedwm.c b/speedwm.c index ded2b1b..8b60ea4 100644 --- a/speedwm.c +++ b/speedwm.c @@ -82,7 +82,7 @@ enum { SchemeNormBorder, SchemeSelBorder, SchemeTags, SchemeBar, - SchemeHid, + SchemeHiddenTitle, SchemeLayout, SchemeNormTitle, SchemeSelTitle, @@ -625,6 +625,8 @@ static xcb_connection_t *xcon; #define SUPER Mod4Mask #define SHIFTL Mod5Mask +/* Misc */ +#define STATUSBAR status /* Rest of the headers */ #include "layouts.c" /* Enable patched layouts */ @@ -1858,7 +1860,7 @@ drawbar(Monitor *m) if (m->sel == c) scm = SchemeSelTitle; else if (HIDDEN(c)) - scm = SchemeHid; + scm = SchemeHiddenTitle; else scm = SchemeNormTitle; drw_setscheme(drw, scheme[scm]); @@ -1965,7 +1967,7 @@ focus(Client *c) if (c) { if (c->mon != selmon) selmon = c->mon; - if (c->isurgent) + if (c->isurgent && urgentwindows) seturgent(c, 0); detachstack(c); attachstack(c); @@ -5040,7 +5042,6 @@ updatepreview(void) .border_pixel = 0, .colormap = cmap, .override_redirect = True, - //.background_pixmap = ParentRelative, .event_mask = ButtonPressMask|ExposureMask }; @@ -5048,8 +5049,6 @@ updatepreview(void) m->tagwin = XCreateWindow(dpy, root, m->wx, m->by + bh, m->mw / scalepreview, m->mh / scalepreview, 0, depth, CopyFromParent, visual, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); - //DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), - //CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); XDefineCursor(dpy, m->tagwin, cursor[CurNormal]->cursor); XMapRaised(dpy, m->tagwin); XUnmapWindow(dpy, m->tagwin); diff --git a/xresources.h b/xresources.h index 4420928..6331e04 100644 --- a/xresources.h +++ b/xresources.h @@ -171,6 +171,7 @@ ResourcePref resources[] = { { "resetgaps", INTEGER, &resetgaps }, { "wmclass", INTEGER, &wmclass }, { "clicktofocus", INTEGER, &clicktofocus }, + { "urgentwindows", INTEGER, &urgentwindows }, #if USEROUNDCORNERS { "roundedcorners", INTEGER, &roundedcorners }, { "cornerradius", INTEGER, &cornerradius },