Commit 934d12c4 authored by Ashley Chiara's avatar Ashley Chiara 👁
Browse files

Deleted modules/attachbelow.diff, modules/bash.nix, modules/dunst.nix,...

Deleted modules/attachbelow.diff, modules/bash.nix, modules/dunst.nix, modules/fibonacci.diff, modules/git.nix, modules/my-dwm-patch.diff, modules/my-st-patch.diff, modules/nvim.nix, modules/tmux.nix, config.nix, configuration.nix, home.nix, packages.nix files
parent 0e30bfed
{ pkgs, ... }:
{
allowUnfree = true;
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
}
/etc/nixos/configuration.nix
\ No newline at end of file
{ config, pkgs, ... }:
{
imports = [
./packages.nix
./modules/bash.nix
./modules/nvim.nix
./modules/tmux.nix
# ./modules/dunst.nix
./modules/git.nix
];
nixpkgs.overlays = [
(self: super: {
st = super.st.overrideAttrs (_: {
patches = [ ./modules/my-st-patch.diff ];
});
dwm = super.dwm.overrideAttrs (_: {
patches = [ ./modules/my-dwm-patch.diff ./modules/fibonacci.diff ./modules/attachbelow.diff];
});
}
)
];
nixpkgs.config = {
allowUnfree = true;
nativeOnly = true;
};
# Shell Options
programs.command-not-found.enable = true;
fonts.fontconfig.enable = true;
programs.home-manager = {
enable = true;
path = "…";
};
}
diff -up b/dwm.c a/dwm.c
--- b/dwm.c 2020-07-05 16:05:02.555947738 -0300
+++ a/dwm.c 2020-07-05 16:06:19.592609932 -0300
@@ -49,7 +49,8 @@
#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)) \
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
+#define ISVISIBLEONTAG(C, T) ((C->tags & T))
+#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
#define LENGTH(X) (sizeof X / sizeof X[0])
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
@@ -147,6 +148,7 @@ static int applysizehints(Client *c, int
static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
static void attach(Client *c);
+static void attachBelow(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -184,6 +186,7 @@ static void maprequest(XEvent *e);
static void monocle(Monitor *m);
static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg);
+static Client *nexttagged(Client *c);
static Client *nexttiled(Client *c);
static void pop(Client *);
static void propertynotify(XEvent *e);
@@ -406,6 +409,27 @@ attach(Client *c)
c->next = c->mon->clients;
c->mon->clients = c;
}
+void
+attachBelow(Client *c)
+{
+ //If there is nothing on the monitor or the selected client is floating, attach as normal
+ if(c->mon->sel == NULL || c->mon->sel->isfloating) {
+ Client *at = nexttagged(c);
+ if(!at) {
+ attach(c);
+ return;
+ }
+ c->next = at->next;
+ at->next = c;
+ return;
+ }
+
+ //Set the new client's next property to the same as the currently selected clients next
+ c->next = c->mon->sel->next;
+ //Set the currently selected clients next property to the new client
+ c->mon->sel->next = c;
+
+}
void
attachstack(Client *c)
@@ -1063,7 +1087,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachBelow(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1193,6 +1217,16 @@ movemouse(const Arg *arg)
}
}
+ Client *
+nexttagged(Client *c) {
+ Client *walked = c->mon->clients;
+ for(;
+ walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags));
+ walked = walked->next
+ );
+ return walked;
+}
+
Client *
nexttiled(Client *c)
{
@@ -1418,7 +1452,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
+ attachBelow(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -1901,6 +1935,7 @@ updategeom(void)
detachstack(c);
c->mon = mons;
attach(c);
+ attachBelow(c);
attachstack(c);
}
if (m == selmon)
{ pkgs, ... }:
{
programs.bash =
{
enable = true;
sessionVariables = {
EDITOR = "nvim";
TERMINAL = "konsole";
LESSHST = "/dev/null";
PATH = "$PATH:/home/ashley/scripts";
};
shellOptions = [
"autocd"
];
shellAliases = {
ls = "ls --color=auto";
l = "ls";
la = "ls -la";
ll = "ls -lh";
lla= "ls -Alah";
cls= "clear";
rm = "rm -v";
mv = "mv -v";
cp = "cp -v";
yt="youtube-dl --add-metadata";
yta="yt -x -f bestaudio/best";
ffmpeg="ffmpeg -hide_banner";
gc= "git clone";
};
initExtra = ''
set -o vi
bind -m vi-insert 'Control-l: clear-screen'
'';
};
}
{ pkgs, ... }:
{
services.dunst = {
settings = {
global = {
geometry = "300x5-30+20";
follow = "keyboard";
shrink = false;
notification_height = 0;
separator_height = 2;
padding = 8;
horizontal_padding = 8;
frame_width = 3;
color = "#ffffff";
frame_color = "#565d6d";
separator_color = "#565d6d";
font = "Hack";
line_height = 0;
markup = "full";
format = "<b>%s</b>\n%b";
alignment = "left";
show_age_threshold = 60;
word_wrap = true;
ignore_newline = false;
stack_duplicates = true;
hide_duplicate_count = false;
sticky_history = true;
history_length = 20;
title = "Dunst";
class = "Dunst";
startup_notification = false;
};
urgency_low = {
background = "#2f343f";
foreground = "#ffffff";
timeout = 10;
};
urgency_normal = {
background = "#2f343f";
foreground = "#ffffff";
timeout = 10;
};
urgency_critical = {
background = "#2f343f";
foreground = "#ffffff";
timeout = 10;
};
};
};
}
From ec9f55b6005cfa3b025b3d700c61af3ce539d057 Mon Sep 17 00:00:00 2001
From: Niki Yoshiuchi <nyoshiuchi@gmail.com>
Date: Sat, 18 Apr 2020 09:55:26 -0700
Subject: [PATCH] Adding the fibonacci layout patch
---
fibonacci.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 fibonacci.c
diff --git a/fibonacci.c b/fibonacci.c
new file mode 100644
index 0000000..fce0a57
--- /dev/null
+++ b/fibonacci.c
@@ -0,0 +1,66 @@
+void
+fibonacci(Monitor *mon, int s) {
+ unsigned int i, n, nx, ny, nw, nh;
+ Client *c;
+
+ for(n = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
+
+ nx = mon->wx;
+ ny = 0;
+ nw = mon->ww;
+ nh = mon->wh;
+
+ for(i = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) {
+ if((i % 2 && nh / 2 > 2 * c->bw)
+ || (!(i % 2) && nw / 2 > 2 * c->bw)) {
+ if(i < n - 1) {
+ if(i % 2)
+ nh /= 2;
+ else
+ nw /= 2;
+ if((i % 4) == 2 && !s)
+ nx += nw;
+ else if((i % 4) == 3 && !s)
+ ny += nh;
+ }
+ if((i % 4) == 0) {
+ if(s)
+ ny += nh;
+ else
+ ny -= nh;
+ }
+ else if((i % 4) == 1)
+ nx += nw;
+ else if((i % 4) == 2)
+ ny += nh;
+ else if((i % 4) == 3) {
+ if(s)
+ nx += nw;
+ else
+ nx -= nw;
+ }
+ if(i == 0)
+ {
+ if(n != 1)
+ nw = mon->ww * mon->mfact;
+ ny = mon->wy;
+ }
+ else if(i == 1)
+ nw = mon->ww - nw;
+ i++;
+ }
+ resize(c, nx, ny, nw - 2 * c->bw, nh - 2 * c->bw, False);
+ }
+}
+
+void
+dwindle(Monitor *mon) {
+ fibonacci(mon, 1);
+}
+
+void
+spiral(Monitor *mon) {
+ fibonacci(mon, 0);
+}
--
2.20.1
{ pkgs, ... }:
{
programs.git = {
enable = true;
userEmail = "PersonaVinny@protonmail.com";
userName = "Ashley Chiara";
};
}
diff --git a/config.def.h b/config.def.h
index 1c0b587..f9f6875 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */
-
+#include <X11/XF86keysym.h>
+#define PrintScreenDWM 0x0000ff61
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
@@ -9,17 +10,17 @@ static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
-static const char col_gray3[] = "#bbbbbb";
+static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
-static const char col_cyan[] = "#005577";
+static const char col_cyan[] = "#4f72bb";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+ [SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
/* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+static const char *tags[] = { "", "", "", "", "", "", "", "", "" };
static const Rule rules[] = {
/* xprop(1):
@@ -36,8 +37,11 @@ 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 int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+#include "fibonacci.c"
static const Layout layouts[] = {
/* symbol arrange function */
+ { "[\\]", dwindle },
+ { "[@]", spiral },
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -57,12 +61,26 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
-static const char *termcmd[] = { "st", NULL };
+static const char *termcmd[] = { "st", "-e", "tmux", NULL };
+static const char *lightupd[] = { "brightnessctl", "s", "+5%", NULL };
+static const char *lightdownd[] = { "brightnessctl", "s", "5%-", NULL };
+static const char *upvol[] = { "amixer", "sset", "Master", "5%+", NULL };
+static const char *downvol[] = { "amixer", "sset", "Master", "5%-", NULL };
+static const char *mutevol[] = { "amixer", "sset", "Master", "toggle", NULL };
+static const char *scrn[] = { "screenshot", NULL };
+
+static const char *killx[] = { "killall", "xinit", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
+ { 0, XF86XK_MonBrightnessUp, spawn, {.v = lightupd } },
+ { 0, XF86XK_MonBrightnessDown, spawn, {.v = lightdownd } },
+ { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol} },
+ { 0, XF86XK_AudioMute, spawn, {.v = mutevol} },
+ { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol} },
+ { 0, PrintScreenDWM, spawn, {.v = scrn } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@@ -76,6 +94,8 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_r, setlayout, {.v = &layouts[3]} },
+ { MODKEY|ShiftMask, XK_r, setlayout, {.v = &layouts[4]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
@@ -94,6 +114,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
+ { MODKEY|ShiftMask, XK_Delete, spawn, {.v = killx } },
};
/* button definitions */
diff --git a/config.def.h b/config.def.h
index 6f05dce..a5023bf 100644
--- a/config.def.h
+++ b/config.def.h
@@ -5,7 +5,7 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+static char *font = "monospace:pixelsize=14:antialias=true:autohint=true";
static int borderpx = 2;
/*
@@ -96,30 +96,31 @@ unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
- "black",
- "red3",
- "green3",
- "yellow3",
- "blue2",
- "magenta3",
- "cyan3",
+ "#373E4D",
+ "#FA5AA4",
+ "#2BE491",
+ "#FA946E",
+ "#63C5EA",
+ "#CF8EF4",
+ "#00D9C0",
"gray90",
/* 8 bright colors */
- "gray50",
- "red",
- "green",
- "yellow",
- "#5c5cff",
- "magenta",
- "cyan",
- "white",
+ "#282828",
+ "#FA74B2",
+ "#44EB9F",
+ "#FAA687",
+ "#7ACBEA",
+ "#D8A6F4",
+ "#00F5D8",
+ "#F9F9F9",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
+ "#222222",
};
@@ -128,7 +129,7 @@ static const char *colorname[] = {
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 7;
-unsigned int defaultbg = 0;
+unsigned int defaultbg = 258;
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
diff --git a/x.c b/x.c
index 7186040..3acc687 100644
--- a/x.c
+++ b/x.c
@@ -81,6 +81,7 @@ typedef XftGlyphFontSpec GlyphFontSpec;
typedef struct {
int tw, th; /* tty width and height */
int w, h; /* window width and height */
+ int hborderpx, vborderpx;
int ch; /* char height */
int cw; /* char width */
int mode; /* window state/mode flags */
@@ -331,7 +332,7 @@ ttysend(const Arg *arg)
int
evcol(XEvent *e)
{
- int x = e->xbutton.x - borderpx;
+ int x = e->xbutton.x - win.hborderpx;
LIMIT(x, 0, win.tw - 1);
return x / win.cw;
}
@@ -339,7 +340,7 @@ evcol(XEvent *e)
int
evrow(XEvent *e)
{
- int y = e->xbutton.y - borderpx;
+ int y = e->xbutton.y - win.vborderpx;
LIMIT(y, 0, win.th - 1);
return y / win.ch;
}
@@ -723,6 +724,9 @@ cresize(int width, int height)
col = MAX(1, col);
row = MAX(1, row);
+ win.hborderpx = (win.w - col * win.cw) / 2;
+ win.vborderpx = (win.h - row * win.ch) / 2;
+
tresize(col, row);
xresize(col, row);
ttyresize(win.tw, win.th);
@@ -840,8 +844,8 @@ xhints(void)
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
sizeh->height = win.h;
sizeh->width = win.w;
- sizeh->height_inc = win.ch;
- sizeh->width_inc = win.cw;
+ sizeh->height_inc = 1;
+ sizeh->width_inc = 1;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
sizeh->min_height = win.ch + 2 * borderpx;
@@ -1123,8 +1127,8 @@ xinit(int cols, int rows)
xloadcols();
/* adjust fixed window geometry */
- win.w = 2 * borderpx + cols * win.cw;
- win.h = 2 * borderpx + rows * win.ch;
+ win.w = 2 * win.hborderpx + 2 * borderpx + cols * win.cw;
+ win.h = 2 * win.vborderpx + 2 * borderpx + rows * win.ch;
if (xw.gm & XNegative)
xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2;
if (xw.gm & YNegative)
@@ -1213,7 +1217,7 @@ xinit(int cols, int rows)
int
xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x, int y)
{
- float winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, xp, yp;
+ float winx = win.hborderpx + x * win.cw, winy = win.vborderpx + y * win.ch, xp, yp;
ushort mode, prevmode = USHRT_MAX;
Font *font = &dc.font;
int frcflags = FRC_NORMAL;
@@ -1346,7 +1350,7 @@ void
xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y)
{
int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1);
- int winx = borderpx + x * win.cw, winy = borderpx + y * win.ch,
+ int winx = win.hborderpx + x * win.cw, winy = win.vborderpx + y * win.ch,
width = charlen * win.cw;
Color *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
@@ -1436,17 +1440,17 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
/* Intelligent cleaning up of the borders. */
if (x == 0) {
- xclear(0, (y == 0)? 0 : winy, borderpx,
+ xclear(0, (y == 0)? 0 : winy, win.vborderpx,
winy + win.ch +
- ((winy + win.ch >= borderpx + win.th)? win.h : 0));
+ ((winy + win.ch >= win.vborderpx + win.th)? win.h : 0));
}
- if (winx + width >= borderpx + win.tw) {
+ if (winx + width >= win.hborderpx + win.tw) {
xclear(winx + width, (y == 0)? 0 : winy, win.w,
- ((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch)));
+ ((winy + win.ch >= win.vborderpx + win.th)? win.h : (winy + win.ch)));
}
if (y == 0)
- xclear(winx, 0, winx + width, borderpx);
- if (winy + win.ch >= borderpx + win.th)
+ xclear(winx, 0, winx + width, win.vborderpx);
+ if (winy + win.ch >= win.vborderpx + win.th)
xclear(winx, winy + win.ch, winx + width, win.h);
/* Clean up the region we want to draw to. */
@@ -1540,35 +1544,35 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
case 3: /* Blinking Underline */
case 4: /* Steady Underline */
XftDrawRect(xw.draw, &drawcol,
- borderpx + cx * win.cw,
- borderpx + (cy + 1) * win.ch - \
+ win.hborderpx + cx * win.cw,
+ win.vborderpx + (cy + 1) * win.ch - \
cursorthickness,
win.cw, cursorthickness);
break;
case 5: /* Blinking bar */
case 6: /* Steady bar */
XftDrawRect(xw.draw, &drawcol,
- borderpx + cx * win.cw,
- borderpx + cy * win.ch,
+ win.hborderpx + cx * win.cw,
+ win.vborderpx + cy * win.ch,
cursorthickness, win.ch);
break;
}
} else {
XftDrawRect(xw.draw, &drawcol,
- borderpx + cx * win.cw,
- borderpx + cy * win.ch,