wip
This commit is contained in:
@@ -4,6 +4,5 @@ fi
|
||||
|
||||
alias ls="ls -a --color"
|
||||
alias comp="make && doas make install && make clean && pkill dwm"
|
||||
alias edit="sh /home/andrew/.config/suckless/dwm/scripts/edit-suckless.sh"
|
||||
alias update_world="doas emerge --ask --update --newuse --deep @world"
|
||||
alias env="sh /home/andrew/dotfiles/env.sh"
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
include config.mk
|
||||
PREFIX = /usr/local
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
FREETYPEINC = /usr/include/freetype2
|
||||
|
||||
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||
LIBS = -L${X11LIB} -lX11 ${FREETYPELIBS}
|
||||
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
CC = gcc
|
||||
|
||||
SRC = drw.c dwm.c util.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
@@ -8,7 +24,7 @@ all: dwm
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
${OBJ}: config.h
|
||||
|
||||
dwm: ${OBJ}
|
||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
@@ -17,11 +33,7 @@ clean:
|
||||
rm -f dwm ${OBJ}
|
||||
|
||||
install: all
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f dwm ${DESTDIR}${PREFIX}/bin
|
||||
chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
|
||||
install -Dm755 dwm ${DESTDIR}${PREFIX}/bin/dwm
|
||||
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
|
||||
|
||||
.PHONY: all install clean uninstall
|
||||
|
||||
@@ -37,7 +37,7 @@ static const Layout layouts[] = {
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
static char dmenumon[2] = "0";
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, NULL };
|
||||
static const char *dmenucmd[] = { "dmenu_run", NULL }; // "-m", dmenumon, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
static const char *browsercmd[] = { "librewolf", NULL };
|
||||
|
||||
@@ -59,10 +59,8 @@ static const Key keys[] = {
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
|
||||
{ MODKEY, XK_comma, spawn, SHCMD("sh /home/andrew/.config/suckless/dwm/scripts/change_layout.sh") },
|
||||
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ +2%") },
|
||||
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ -2%") },
|
||||
{ 0, XF86XK_AudioMute, spawn, SHCMD("pactl set-sink-mute @DEFAULT_SINK@ toggle") },
|
||||
|
||||
TAGKEYS( XK_1, 0 )
|
||||
TAGKEYS( XK_2, 1 )
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
PREFIX = /usr/local
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
FREETYPEINC = /usr/include/freetype2
|
||||
|
||||
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||
LIBS = -L${X11LIB} -lX11 ${FREETYPELIBS}
|
||||
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
|
||||
CC = gcc
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@@ -19,7 +17,6 @@
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
|
||||
/* macros */
|
||||
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
||||
@@ -32,7 +29,6 @@
|
||||
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||
|
||||
/* enums */
|
||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
variant=$(setxkbmap -query | awk '/variant:/ { print $2 }')
|
||||
|
||||
if [[ "$variant" == "colemak_dh" ]]; then
|
||||
setxkbmap us
|
||||
layout="qwe"
|
||||
else
|
||||
setxkbmap us -variant colemak_dh
|
||||
layout="cdh"
|
||||
fi
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
REBUILD=false
|
||||
|
||||
# Parse flags
|
||||
while getopts ":f" opt; do
|
||||
case $opt in
|
||||
f)
|
||||
REBUILD=true
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
APP="$1"
|
||||
APP_DIR="/home/andrew/dotfiles/.config/suckless/$APP"
|
||||
CONFIG_FILE="$APP_DIR/config.h"
|
||||
|
||||
if [[ -z "$APP" ]]; then
|
||||
echo "Usage:
|
||||
edit-suckless.sh [ option ] < suckless-app >"
|
||||
echo "Options:
|
||||
-f [ force rebuild even if no changes were made ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$CONFIG_FILE" ]]; then
|
||||
echo "Config file not found: $CONFIG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OLD_DIR="$(pwd)"
|
||||
cd "$APP_DIR" || {
|
||||
echo "Failed to cd into $APP_DIR"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Hash before edit
|
||||
BEFORE_HASH=$(sha256sum config.h | cut -d ' ' -f1)
|
||||
|
||||
# Edit file
|
||||
nvim config.h
|
||||
|
||||
# Hash after edit
|
||||
AFTER_HASH=$(sha256sum config.h | cut -d ' ' -f1)
|
||||
|
||||
if [[ "$BEFORE_HASH" != "$AFTER_HASH" || "$REBUILD" == true ]]; then
|
||||
echo "Rebuilding $APP..."
|
||||
make
|
||||
doas make install
|
||||
make clean
|
||||
pkill dwm
|
||||
else
|
||||
echo "No changes detected. Skipping rebuild."
|
||||
fi
|
||||
|
||||
cd "$OLD_DIR"
|
||||
@@ -5,9 +5,7 @@
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void
|
||||
die(const char *fmt, ...)
|
||||
{
|
||||
void die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
@@ -17,19 +15,13 @@ die(const char *fmt, ...)
|
||||
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||
fputc(' ', stderr);
|
||||
perror(NULL);
|
||||
} else {
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
} else fputc('\n', stderr);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void * ecalloc(size_t nmemb, size_t size) {
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
if (!(p = calloc(nmemb, size))) die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -9,23 +9,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
void die(const char *msg) {
|
||||
fprintf(stderr, "%s\n", msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const char* bgt() {
|
||||
static char buf[5];
|
||||
time_t now = time(NULL), last = now;
|
||||
FILE *f = fopen("/tmp/last_wallpaper_time", "r");
|
||||
if(fscanf(f, "%ld", &last) != 1) last = now;
|
||||
fclose(f);
|
||||
int rem = 600 - (int)(now - last);
|
||||
if (rem < 0) rem = 0;
|
||||
if (snprintf(buf, sizeof(buf), "%d:%02d", (rem / 60), (rem % 60)) < 0) return NULL;
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char* vol() {
|
||||
static char buf[5];
|
||||
float v;
|
||||
@@ -50,23 +33,25 @@ const char* age() {
|
||||
|
||||
volatile sig_atomic_t done = 0;
|
||||
void terminate() { done = 1; }
|
||||
void die(const char *msg) {
|
||||
fprintf(stderr, "%s\n", msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main() {
|
||||
Display *dpy;
|
||||
size_t i, len;
|
||||
int ret;
|
||||
char status[18];
|
||||
struct sigaction act = { .sa_handler = terminate, .sa_flags = SA_RESTART };
|
||||
struct arg {
|
||||
const char *(*func)(void);
|
||||
const char *fmt;
|
||||
};
|
||||
const struct arg args[] = {
|
||||
{ bgt, "W: %s " }, // 9 bytes
|
||||
{ vol, "V: %s " }, // 9 bytes
|
||||
{ age, "A: %sd" }, // 8 bytes
|
||||
};
|
||||
size_t i, len;
|
||||
int ret;
|
||||
char status[32];
|
||||
const char *res;
|
||||
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
@@ -74,8 +59,8 @@ int main() {
|
||||
if (!(dpy = XOpenDisplay(NULL))) die("XOpenDisplay: Failed to open display");
|
||||
while(!done) {
|
||||
status[0] = '\0';
|
||||
for (i = len = 0; i < 3; i++) {
|
||||
res = args[i].func();
|
||||
for (i = len = 0; i < 2; i++) {
|
||||
const char *res = args[i].func();
|
||||
if (!res) res = "n/a";
|
||||
if ((ret = snprintf(status + len, sizeof(status) - len, args[i].fmt, res)) < 0) break;
|
||||
len += ret;
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
.POSIX:
|
||||
|
||||
include config.mk
|
||||
PREFIX = /usr/local
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
# includes and libs
|
||||
INCS = $(shell pkg-config --cflags x11 fontconfig freetype2) # -I$(X11INC)
|
||||
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
|
||||
`$(PKG_CONFIG) --libs fontconfig` \
|
||||
`$(PKG_CONFIG) --libs freetype2`
|
||||
|
||||
# flags
|
||||
STCPPFLAGS = -D_XOPEN_SOURCE=600
|
||||
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||
STLDFLAGS = $(LIBS) $(LDFLAGS)
|
||||
|
||||
# compiler and linker
|
||||
CC = gcc
|
||||
|
||||
SRC = st.c x.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
@@ -13,7 +32,7 @@ all: st
|
||||
st.o: config.h st.h win.h
|
||||
x.o: arg.h config.h st.h win.h
|
||||
|
||||
$(OBJ): config.h config.mk
|
||||
$(OBJ): config.h
|
||||
|
||||
st: $(OBJ)
|
||||
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
|
||||
@@ -22,11 +41,7 @@ clean:
|
||||
rm -f st $(OBJ)
|
||||
|
||||
install: st
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f st $(DESTDIR)$(PREFIX)/bin
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
|
||||
install -Dm755 st $(DESTDIR)$(PREFIX)/bin/st
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
||||
|
||||
.PHONY: all clean install uninstall
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# VERSION = 0.9.2
|
||||
|
||||
PREFIX = /usr/local
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
# includes and libs
|
||||
INCS = -I$(X11INC) \
|
||||
`$(PKG_CONFIG) --cflags fontconfig` \
|
||||
`$(PKG_CONFIG) --cflags freetype2`
|
||||
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
|
||||
`$(PKG_CONFIG) --libs fontconfig` \
|
||||
`$(PKG_CONFIG) --libs freetype2`
|
||||
|
||||
# flags
|
||||
STCPPFLAGS = -D_XOPEN_SOURCE=600 # -DVERSION=\"$(VERSION)\"
|
||||
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||
STLDFLAGS = $(LIBS) $(LDFLAGS)
|
||||
|
||||
# compiler and linker
|
||||
CC = gcc
|
||||
@@ -1,27 +0,0 @@
|
||||
From e8f3c86d93613eef5af187dfd2dba9ae9919a2ee Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= <code@bnwr.net>
|
||||
Date: Sun, 27 Jan 2019 13:31:28 +0800
|
||||
Subject: [PATCH] Show bold not as bright
|
||||
|
||||
---
|
||||
x.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/x.c b/x.c
|
||||
index 0422421..904e1dc 100644
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -1296,10 +1296,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||
bg = &dc.col[base.bg];
|
||||
}
|
||||
|
||||
- /* Change basic system colors [0-7] to bright system colors [8-15] */
|
||||
- if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
|
||||
- fg = &dc.col[base.fg + 8];
|
||||
-
|
||||
if (IS_SET(MODE_REVERSE)) {
|
||||
if (fg == &dc.col[defaultfg]) {
|
||||
fg = &dc.col[defaultbg];
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1419,6 +1419,11 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||
bg = &dc.col[base.bg];
|
||||
}
|
||||
|
||||
/* Change basic system colors [0-7] to bright system colors [8-15] */
|
||||
if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
|
||||
fg = &dc.col[base.fg + 8];
|
||||
|
||||
|
||||
if (IS_SET(MODE_REVERSE)) {
|
||||
if (fg == &dc.col[defaultfg]) {
|
||||
fg = &dc.col[defaultbg];
|
||||
|
||||
@@ -3,3 +3,5 @@ This config is a meant to be very minimal and easy to setup by just using suckle
|
||||
My Dwm-Dots is slightly out of date for my system and configuration but it works fine and uses catppuccin if you like that. This one uses everforest
|
||||
|
||||
This is a heavily modified version of dwm, not in the sense of new features and bloat, but removing things that I dont need for my setup. If it doesnt work for you I would recommend pulling a clean dwm setup and then just copying my config.h or use a different set of dotfiles.
|
||||
For instance:
|
||||
* Slstatus: >100 lines of code including MakeFile. Heavily configured to be simple with just 2 args being my volume and days since system install
|
||||
|
||||
Reference in New Issue
Block a user