diff options
-rw-r--r-- | .config/calcurse/keys | 95 | ||||
-rwxr-xr-x | arch/required | 4 | ||||
-rwxr-xr-x | build | 20 | ||||
-rw-r--r-- | config/dwm.h (renamed from dwm/config.h) | 0 | ||||
-rw-r--r-- | config/st.h (renamed from st/config.h) | 0 | ||||
-rwxr-xr-x | debian/required | 59 | ||||
-rw-r--r-- | dwm/custom.diff | 104 | ||||
-rw-r--r-- | dwmstatus/custom.diff | 172 | ||||
-rw-r--r-- | pinentry-dmenu/config.h | 19 | ||||
-rw-r--r-- | pinentry-dmenu/config.mk | 36 | ||||
-rwxr-xr-x | scripts/pinentry-auto | 3 | ||||
-rwxr-xr-x | scripts/ssh-lxd | 9 | ||||
-rw-r--r-- | st/custom.diff | 35 |
13 files changed, 53 insertions, 503 deletions
diff --git a/.config/calcurse/keys b/.config/calcurse/keys index 28ff9e4..3304bbb 100644 --- a/.config/calcurse/keys +++ b/.config/calcurse/keys @@ -6,50 +6,51 @@ # via the key configuration menu of the interactive user # interface. It should not be edited directly. -generic-cancel ESC -generic-select SPC -generic-credits @ -generic-help ? -generic-quit q Q -generic-save s S ^S -generic-reload R -generic-copy c -generic-paste p ^V -generic-change-view TAB -generic-import i I -generic-export x X -generic-goto g G -generic-other-cmd o O -generic-config-menu C -generic-redraw ^R -generic-add-appt ^A -generic-add-todo ^T -generic-prev-day T ^H -generic-next-day t ^L -generic-prev-week W ^K -generic-next-week w -generic-prev-month M -generic-next-month m -generic-prev-year Y -generic-next-year y -generic-scroll-down ^N -generic-scroll-up ^P -generic-goto-today ^G -generic-command : -move-right l L RGT -move-left h H LFT -move-down j J DWN -move-up k K UP -start-of-week 0 -end-of-week $ -add-item a A -del-item d D -edit-item e E -view-item v V RET -pipe-item | -flag-item ! -repeat r -edit-note n N -view-note > -raise-priority + -lower-priority - +generic-cancel ESC +generic-select SPC +generic-credits @ +generic-help ? +generic-quit q Q +generic-save s S ^S +generic-reload R +generic-copy c +generic-paste p ^V +generic-change-view TAB +generic-prev-view KEY_BTAB +generic-import i I +generic-export x X +generic-goto g G +generic-other-cmd o O +generic-config-menu C +generic-redraw ^R +generic-add-appt ^A +generic-add-todo ^T +generic-prev-day T ^H +generic-next-day t ^L +generic-prev-week W ^K +generic-next-week w +generic-prev-month M +generic-next-month m +generic-prev-year Y +generic-next-year y +generic-scroll-down ^N +generic-scroll-up ^P +generic-goto-today ^G +generic-command : +move-right l L RGT +move-left h H LFT +move-down j J DWN +move-up k K UP +start-of-week 0 +end-of-week $ +add-item a A +del-item d D +edit-item e E +view-item v V RET +pipe-item | +flag-item ! +repeat r +edit-note n N +view-note > +raise-priority + +lower-priority - diff --git a/arch/required b/arch/required index ffc0604..bf6c8a4 100755 --- a/arch/required +++ b/arch/required @@ -1,7 +1,7 @@ #!/bin/bash set -e U=tom -pacman -S --needed - < mainline +pacman -S --needed - <mainline useradd -m $U passwd $U @@ -10,7 +10,7 @@ git clone https://aur.archlinux.org/yay-bin.git /home/$U/yay chown $U:$U -R /home/$U -echo "$U ALL=(ALL) ALL" >> /etc/sudoers +echo "$U ALL=(ALL) ALL" >>/etc/sudoers cd /home/$U/yay && sudo -u $U makepkg -si --noconfirm @@ -9,43 +9,27 @@ mkdir "$HOME/bin" # dwm setup DWM_DIR="$HOME/src/dwm" git clone https://git.tombarrett.xyz/git/dwm "$DWM_DIR" - -patch "$DWM_DIR/dwm.c" "$RC_DIR/dwm/custom.diff" - -ln -s "$RC_DIR/dwm/config.h" "$DWM_DIR" - +ln -s "$RC_DIR/config/dwm.h" "$DWM_DIR/config.h" make -C "$DWM_DIR" - ln -s "$DWM_DIR/dwm" "$HOME/bin" # dwmstatus setup DWMSTS_DIR="$HOME/src/dwmstatus" git clone https://git.tombarrett.xyz/git/dwmstatus "$DWMSTS_DIR" - -patch "$DWMSTS_DIR/dwmstatus.c" "$RC_DIR/dwmstatus/custom.diff" - make -C "$DWMSTS_DIR" - ln -s "$DWMSTS_DIR/dwmstatus" "$HOME/bin" # st setup ST_DIR="$HOME/src/st" git clone https://git.tombarrett.xyz/git/st "$ST_DIR" - -ln -s "$RC_DIR/st/config.h" "$ST_DIR" - +ln -s "$RC_DIR/config/st.h" "$ST_DIR/config.h" make -C "$ST_DIR" - ln -s "$ST_DIR/st" "$HOME/bin" # pinentry-dmenu setup PE_DIR="$HOME/src/pinentry-dmenu" git clone https://git.tombarrett.xyz/git/pinentry-dmenu "$PE_DIR" - -cp "$RC_DIR/pinentry-dmenu/config*" "$PE_DIR" - make -C "$PE_DIR" - ln -s "$PE_DIR/pinentry-dmenu" "$HOME/bin" # wallpapers setup diff --git a/dwm/config.h b/config/dwm.h index 0847dd8..0847dd8 100644 --- a/dwm/config.h +++ b/config/dwm.h diff --git a/st/config.h b/config/st.h index 8be1371..8be1371 100644 --- a/st/config.h +++ b/config/st.h diff --git a/debian/required b/debian/required deleted file mode 100755 index 9b5dd3b..0000000 --- a/debian/required +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# display -apt install -y \ - arandr \ - atril \ - feh \ - nitrogen \ - scrot \ - xauth \ - xinit \ - xorg \ - xorg-dev - -# utilities -apt install -y \ - dmenu \ - fish \ - git \ - htop \ - ncdu \ - neovim \ - tree - -# web -apt install -y \ - curl \ - firefox-esr \ - netcat \ - nmap \ - w3m \ - w3m-img - -# security -apt install -y \ - ccrypt \ - pwgen - -# lxc containers -apt install -y \ - bridge-utils \ - dnsmasq-base \ - ebtables \ - iptables \ - libpam-cgfs \ - libvirt0 \ - libvirt-clients \ - libvirt-daemon-system \ - lxc - -# misc -apt install -y \ - acpi \ - build-essential \ - ledger \ - lshw \ - psmisc \ - rcconf \ - sshpass diff --git a/dwm/custom.diff b/dwm/custom.diff deleted file mode 100644 index 12e1096..0000000 --- a/dwm/custom.diff +++ /dev/null @@ -1,104 +0,0 @@ -diff --git a/dwm.c b/dwm.c -index 9fd0286..f1373cf 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -119,6 +119,7 @@ struct Monitor { - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ -+ int gapp; /* gap */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; -@@ -210,7 +210,6 @@ static void spawn(const Arg *arg); - static void tag(const Arg *arg); - static void tagmon(const Arg *arg); - static void tile(Monitor *m); --static void togglebar(const Arg *arg); - static void togglefloating(const Arg *arg); - static void toggletag(const Arg *arg); - static void toggleview(const Arg *arg); -@@ -639,6 +639,7 @@ createmon(void) - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; -+ m->gapp = gapp; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -@@ -1674,40 +1675,33 @@ tagmon(const Arg *arg) - void - tile(Monitor *m) - { -- unsigned int i, n, h, mw, my, ty; -+ unsigned int i, n, h, r, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; -- - if (n > m->nmaster) -- mw = m->nmaster ? m->ww * m->mfact : 0; -+ mw = m->nmaster ? (m->ww + m->gapp) * m->mfact : 0; - else -- mw = m->ww; -- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ mw = m->ww - 2*m->gapp + m->gapp; -+ for (i = 0, my = ty = m->gapp, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { -- h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- if (my + HEIGHT(c) < m->wh) -- my += HEIGHT(c); -+ r = MIN(n, m->nmaster) - i; -+ h = (m->wh - my - m->gapp - m->gapp * (r - 1)) / r; -+ resize(c, m->wx + m->gapp, m->wy + my, mw - (2*c->bw) - m->gapp, h - (2*c->bw), 0); -+ -+ if ((HEIGHT(c) + m->gapp) < m->wh) -+ my += HEIGHT(c) + m->gapp; - } else { -- h = (m->wh - ty) / (n - i); -- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- if (ty + HEIGHT(c) < m->wh) -- ty += HEIGHT(c); -+ r = n - i; -+ h = (m->wh - ty - m->gapp - m->gapp * (r - 1)) / r; -+ resize(c, m->wx + mw + m->gapp, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gapp, h - (2*c->bw), 0); -+ if ((ty + HEIGHT(c) + m->gapp) < m->wh) -+ ty += HEIGHT(c) + m->gapp; - } - } - --void --togglebar(const Arg *arg) --{ -- selmon->showbar = !selmon->showbar; -- updatebarpos(selmon); -- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); -- arrange(selmon); --} -- - void - togglefloating(const Arg *arg) - { -@@ -2127,6 +2121,11 @@ zoom(const Arg *arg) - pop(c); - } - -+void -+autostart(void) { -+ system("~/.autostart &"); -+} -+ - int - main(int argc, char *argv[]) - { -@@ -2145,6 +2144,7 @@ main(int argc, char *argv[]) - die("pledge"); - #endif /* __OpenBSD__ */ - scan(); -+ autostart(); - run(); - cleanup(); - XCloseDisplay(dpy); diff --git a/dwmstatus/custom.diff b/dwmstatus/custom.diff deleted file mode 100644 index e4f37f1..0000000 --- a/dwmstatus/custom.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff --git a/dwmstatus.c b/dwmstatus.c -index ce7914a..793cff9 100644 ---- a/dwmstatus.c -+++ b/dwmstatus.c -@@ -17,8 +17,6 @@ - - #include <X11/Xlib.h> - --char *tzargentina = "America/Buenos_Aires"; --char *tzutc = "UTC"; - char *tzberlin = "Europe/Berlin"; - - static Display *dpy; -@@ -89,90 +87,7 @@ loadavg(void) - if (getloadavg(avgs, 3) < 0) - return smprintf(""); - -- return smprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]); --} -- --char * --readfile(char *base, char *file) --{ -- char *path, line[513]; -- FILE *fd; -- -- memset(line, 0, sizeof(line)); -- -- path = smprintf("%s/%s", base, file); -- fd = fopen(path, "r"); -- free(path); -- if (fd == NULL) -- return NULL; -- -- if (fgets(line, sizeof(line)-1, fd) == NULL) -- return NULL; -- fclose(fd); -- -- return smprintf("%s", line); --} -- --char * --getbattery(char *base) --{ -- char *co, status; -- int descap, remcap; -- -- descap = -1; -- remcap = -1; -- -- co = readfile(base, "present"); -- if (co == NULL) -- return smprintf(""); -- if (co[0] != '1') { -- free(co); -- return smprintf("not present"); -- } -- free(co); -- -- co = readfile(base, "charge_full_design"); -- if (co == NULL) { -- co = readfile(base, "energy_full_design"); -- if (co == NULL) -- return smprintf(""); -- } -- sscanf(co, "%d", &descap); -- free(co); -- -- co = readfile(base, "charge_now"); -- if (co == NULL) { -- co = readfile(base, "energy_now"); -- if (co == NULL) -- return smprintf(""); -- } -- sscanf(co, "%d", &remcap); -- free(co); -- -- co = readfile(base, "status"); -- if (!strncmp(co, "Discharging", 11)) { -- status = '-'; -- } else if(!strncmp(co, "Charging", 8)) { -- status = '+'; -- } else { -- status = '?'; -- } -- -- if (remcap < 0 || descap < 0) -- return smprintf("invalid"); -- -- return smprintf("%.0f%%%c", ((float)remcap / (float)descap) * 100, status); --} -- --char * --gettemperature(char *base, char *sensor) --{ -- char *co; -- -- co = readfile(base, sensor); -- if (co == NULL) -- return smprintf(""); -- return smprintf("%02.0f°C", atof(co) / 1000); -+ return smprintf("%.2f", avgs[1]); - } - - char * -@@ -200,46 +115,38 @@ int - main(void) - { - char *status; -- char *avgs; -- char *bat; -- char *tmar; -- char *tmutc; -+ char *avg; - char *tmbln; -- char *t0; -- char *t1; -- char *kbmap; -+ char *ips; -+ char *track; -+ char *temp; -+ char *partition; - - if (!(dpy = XOpenDisplay(NULL))) { - fprintf(stderr, "dwmstatus: cannot open display.\n"); - return 1; - } - -- for (;;sleep(30)) { -- avgs = loadavg(); -- bat = getbattery("/sys/class/power_supply/BAT0"); -- tmar = mktimes("%H:%M", tzargentina); -- tmutc = mktimes("%H:%M", tzutc); -- tmbln = mktimes("KW %W %a %d %b %H:%M %Z %Y", tzberlin); -- kbmap = execscript("setxkbmap -query | grep layout | cut -d':' -f 2- | tr -d ' '"); -- t0 = gettemperature("/sys/devices/virtual/thermal/thermal_zone0", "temp"); -- t1 = gettemperature("/sys/devices/virtual/thermal/thermal_zone1", "temp"); -- -- status = smprintf("K:%s T:%s|%s L:%s B:%s A:%s U:%s %s", -- kbmap, t0, t1, avgs, bat, tmar, tmutc, -- tmbln); -+ for (;;sleep(1)) { -+ avg = loadavg(); -+ tmbln = mktimes("%a %d %b %H:%M", tzberlin); -+ ips = execscript("ip a | grep 'inet ' | grep -v 127.0.0.1 | tr -s ' ' |cut -f3 -d' '"); -+ temp = execscript("sensors amdgpu-pci-0400 | grep edge | cut -c 16-22"); -+ track = execscript("mpc -h core-a.lan | head -n 1 | grep -v volume || echo"); -+ partition = execscript("df -lh | grep /dev/sda2 | tr -s ' ' | cut -d ' ' -f 4"); -+ -+ status = smprintf(" %s | %s | %s | %s | %s", -+ track, avg, temp, partition, tmbln); - setstatus(status); - -- free(kbmap); -- free(t0); -- free(t1); -- free(avgs); -- free(bat); -- free(tmar); -- free(tmutc); -+ free(avg); - free(tmbln); -+ free(ips); -+ free(track); -+ free(temp); -+ free(partition); - free(status); - } -- - XCloseDisplay(dpy); - - return 0; diff --git a/pinentry-dmenu/config.h b/pinentry-dmenu/config.h deleted file mode 100644 index 8e5d90a..0000000 --- a/pinentry-dmenu/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -/* Default settings; can be overriden by command line. */ - -static int bottom = 0; -static int embedded = 0; -static int minpwlen = 32; -static int mon = -1; - -static const char *asterisk = "*"; -static const char *fonts[] = { - "monospace:size=10" -}; -static const char *prompt = NULL; -static const char *colors[SchemeLast][4] = { - [SchemePrompt] = { "#bbbbbb", "#222222" }, - [SchemeNormal] = { "#bbbbbb", "#222222" }, - [SchemeSelect] = { "#eeeeee", "#005577" }, - [SchemeDesc] = { "#bbbbbb", "#222222" } -}; diff --git a/pinentry-dmenu/config.mk b/pinentry-dmenu/config.mk deleted file mode 100644 index 94b1542..0000000 --- a/pinentry-dmenu/config.mk +++ /dev/null @@ -1,36 +0,0 @@ -# Pinentry settings -DATE = $$(date +'%B %Y') -VERSION = 0.1 -BUGREPORT = https:\/\/github.com\/ritze\/pinentry-dmenu - -# Paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# Freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -# FREETYPEINC = ${X11INC}/freetype2 -# ADDINCS = -I/usr/local/include -# ADDLIBS = -L/usr/local/lib - -# Includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} ${ADDINCS} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${ADDLIBS} - - -# Flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -DPACKAGE_VERSION=\"${VERSION}\" -DPACKAGE_BUGREPORT=\"${BUGREPORT}\" -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} - -# Compiler and linker -CC = cc diff --git a/scripts/pinentry-auto b/scripts/pinentry-auto index 54e59c2..66ca97c 100755 --- a/scripts/pinentry-auto +++ b/scripts/pinentry-auto @@ -7,8 +7,7 @@ if [ -z "$exists" ]; then PATH="/run/current-system/sw/bin/:"$PATH fi - -if pgrep -x 'X|Xorg' > /dev/null; then +if pgrep -x 'X|Xorg' >/dev/null; then /home/"$USER"/bin/pinentry-dmenu "$@" else pinentry-curses "$@" diff --git a/scripts/ssh-lxd b/scripts/ssh-lxd deleted file mode 100755 index b4bf2fe..0000000 --- a/scripts/ssh-lxd +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -IP=$(lxc ls -fcsv | grep $1 | tr ' ' , | cut -d, -f3) -if ! ssh -o BatchMode=yes root@$IP; then - lxc exec $1 -- bash -c "mkdir -p /root/.ssh && \ - echo \"$(ssh-add -L)\" \ - > /root/.ssh/authorized_keys" - ssh root@$IP -fi diff --git a/st/custom.diff b/st/custom.diff deleted file mode 100644 index 32a30e4..0000000 --- a/st/custom.diff +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/x.c b/x.c -index 210f184..3fede15 100644 ---- a/x.c -+++ b/x.c -@@ -732,10 +732,6 @@ xresize(int col, int row) - win.tw = col * win.cw; - win.th = row * win.ch; - -- XFreePixmap(xw.dpy, xw.buf); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -- XftDrawChange(xw.draw, xw.buf); - xclear(0, 0, win.w, win.h); - - /* resize to new width */ -@@ -1148,9 +1144,7 @@ xinit(int cols, int rows) - gcvalues.graphics_exposures = False; - dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, - &gcvalues); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); -+ xw.buf = xw.win; - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); - - /* font spec buffer */ -@@ -1632,8 +1626,6 @@ xdrawline(Line line, int x1, int y1, int x2) - void - xfinishdraw(void) - { -- XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, -- win.h, 0, 0); - XSetForeground(xw.dpy, dc.gc, - dc.col[IS_SET(MODE_REVERSE)? - defaultfg : defaultbg].pixel); |