autolinux


Logs | Files | README | LICENSE | GitLab


1
commit 8888d1aee29afe00cf1ccb2ba3f211f22b3d70f1
2
Author: Connor Etherington <[email protected]>
3
Date:   Sun Apr 2 05:33:24 2023 +0200
4
5
    Auto-Commit Update 02.04.2023 - 05:33:24
6
---
7
 AutoLinux             | Bin 114296 -> 118776 bytes
8
 config.h              |  39 +++++++++++++++++++++++++++++++--------
9
 patch/cust/bar_act.c  |  10 ----------
10
 patch/cust/bar_act.h  |   1 -
11
 patch/cust/bar_date.c |  19 -------------------
12
 patch/cust/bar_time.c |   6 ++++++
13
 patch/cust/bar_time.h |   1 +
14
 patch/functions.c     |  21 +++++++++++++++++++++
15
 patch/functions.h     |   0
16
 patch/include.c       |   1 +
17
 10 files changed, 60 insertions(+), 38 deletions(-)
18
19
diff --git a/AutoLinux b/AutoLinux
20
index 68100bc..ba7cafe 100755
21
Binary files a/AutoLinux and b/AutoLinux differ
22
diff --git a/config.h b/config.h
23
index 8de67d0..001b12b 100644
24
--- a/config.h
25
+++ b/config.h
26
@@ -8,6 +8,7 @@
27
 #define TERMCLASS "St"
28
 #define TERMINAL2 "alacritty"
29
 #define TERMCLASS2 "Alacritty"
30
+#define BROWSER "brave-browser-nightly"
31
 #define MODKEY Mod4Mask
32
 #define ALTKEY Mod1Mask
33
 #define CTRLKEY ControlMask
34
@@ -79,13 +80,22 @@ typedef struct {
35
 	const char *name;
36
 	const void *cmd;
37
 } Sp;
38
-const char *spcmd1[] = {TERMINAL, "-n", "spterm", "-g", "120x34", NULL };
39
+const char *spcmd1[] = {TERMINAL, "-n", "spterm", "-g", "160x50", NULL };
40
 const char *spcmd2[] = {TERMINAL, "-n", "spcalc", "-f", "monospace:size=16", "-g", "50x20", "-e", "bc", "-lq", NULL };
41
+const char *spcmd3[] = {TERMINAL, "-n", "spala", "-g", "160x50", NULL };
42
+const char *spcmd4[] = {TERMINAL, "-n", "spalat", "-g", "160x50", "-e", "gogb", NULL };
43
+const char *spcmd5[] = {TERMINAL, "-n", "spgbmon", "-g", "160x50", "-e", "gbmonit", NULL };
44
+const char *spcmd6[] = {BROWSER,  NULL };
45
+
46
 static Sp scratchpads[] = {
47
 
48
 	/* name          cmd  */
49
 	{"spterm",      spcmd1},
50
 	{"spcalc",      spcmd2},
51
+	{"spala",       spcmd3},
52
+	{"spalat",      spcmd4},
53
+	{"spgbmon",     spcmd5},
54
+	{"spbrowser",   spcmd6},
55
 };
56
 
57
 //----------------------------------------------------------- Tagging ----------------------------------------------------------//
58
@@ -108,6 +118,10 @@ static const Rule rules[] = {
59
 	{ NULL,       NULL,       "Event Tester",   0,            0,           0,         1,        -1 },
60
 	{ NULL,      "spterm",    NULL,       	    SPTAG(0),     1,           1,         0,        -1 },
61
 	{ NULL,      "spcalc",    NULL,       	    SPTAG(1),     1,           1,         0,        -1 },
62
+	{ NULL,      "spala",     NULL,             SPTAG(2),     1,           1,         0,        -1 },
63
+	{ NULL,      "spalat",    NULL,             SPTAG(3),     1,           1,         0,        -1 },
64
+	{ NULL,      "spgbmon",   NULL,             SPTAG(4),     1,           1,         0,        -1 },
65
+	{ NULL,      "spbrowser", NULL,             SPTAG(5),     1,           1,         0,        -1 },
66
 };
67
 
68
 
69
@@ -120,8 +134,9 @@ static const BarRule barrules[] = {
70
     { -1,       0,     BAR_ALIGN_LEFT_LEFT,    width_ltsymbol,        draw_ltsymbol,        click_ltsymbol,     "layout"   },
71
     //{ 0,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_status,       "time"     },
72
     { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_date,            draw_date,            click_date,       "date"     },
73
-    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_time,       "time"     },
74
-    { 0,        0,     BAR_ALIGN_LEFT,         width_wintitle,        draw_wintitle,        click_wintitle,     "wintitle" },
75
+    { 1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_time,       "time"     },
76
+    { 0,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            clickk_time,       "time"     },
77
+    { 1,        0,     BAR_ALIGN_LEFT,         width_wintitle,        draw_wintitle,        click_wintitle,     "wintitle" },
78
 };
79
 
80
 
81
@@ -240,6 +255,18 @@ static Key keys[] = {
82
   { MODKEY,             XK_equal,	  spawn,		SHCMD("cpSecPass 9") },
83
   { MODKEY,             XK_F13,     spawn,		SHCMD("cpSecPass 10") },
84
 
85
+
86
+  // Scratch Pads:
87
+
88
+	{ MODKEY,		XK_s,	 togglescratch, {.ui = 0 } },
89
+	{ ALTKEY,		XK_Return,  togglescratch, {.ui = 1 } },
90
+	{ MODKEY,		XK_backslash,	togglescratch, {.ui = 3 } },
91
+	{ MODKEY|ShiftMask,		XK_backslash,	togglescratch, {.ui = 4 } },
92
+	{ MODKEY|ControlMask, XK_period,  spawn, SHCMD(TERMINAL " -e job") },
93
+
94
+
95
+
96
+
97
   { MODKEY,         			XK_0,		view,		{.ui = ~0 } },
98
 	{ MODKEY|ShiftMask,		XK_0,		tag,		{.ui = ~0 } },
99
 	{ MODKEY,         			XK_minus,	spawn,		SHCMD("pamixer --allow-boost -d 5; kill -44 $(pidof dwmblocks)") },
100
@@ -249,10 +276,6 @@ static Key keys[] = {
101
 	{ MODKEY,         			XK_BackSpace,	spawn,		SHCMD("sysact") },
102
 	{ MODKEY|ShiftMask,		XK_BackSpace,	spawn,		SHCMD("sysact") },
103
 
104
-	{ MODKEY,		XK_s,	 togglescratch, {.ui = 0 } },
105
-	{ ALTKEY,		XK_Return,  togglescratch, {.ui = 1 } },
106
-	{ MODKEY|ShiftMask,		XK_a,	 togglescratch, {.ui = 2 } },
107
-	{ MODKEY|ControlMask, XK_period,  spawn, SHCMD(TERMINAL " -e job") },
108
 
109
 /*  { MODKEY|ShiftMask,        XK_a, scratchpad_show, {0} },
110
 	{ MODKEY|ShiftMask,        XK_s, scratchpad_hide, {0} },
111
@@ -292,7 +315,7 @@ static Key keys[] = {
112
 	{ MODKEY|ShiftMask,	XK_bracketleft,		spawn,		SHCMD("mpc seek -60") },
113
 	{ MODKEY,         			XK_bracketright,	spawn,		SHCMD("mpc seek +10") },
114
 	{ MODKEY|ShiftMask,	XK_bracketright,	spawn,		SHCMD("mpc seek +60") },
115
-	{ MODKEY,         			XK_backslash,		view,		{0} },
116
+//	{ MODKEY,         			XK_backslash,		view,		{0} },
117
 	/* { MODKEY|ShiftMask,		XK_backslash,		spawn,		SHCMD("") }, */
118
 
119
 	{ MODKEY,         			XK_a,		togglegaps,	{0} },
120
diff --git a/patch/cust/bar_act.c b/patch/cust/bar_act.c
121
deleted file mode 100644
122
index 03c47b2..0000000
123
--- a/patch/cust/bar_act.c
124
+++ /dev/null
125
@@ -1,10 +0,0 @@
126
-
127
-#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
128
-
129
-int
130
-click_act (Bar *bar, Arg *arg, BarClickArg *a)
131
-{
132
-  spawn (ROFI());
133
-}
134
-
135
-int
136
diff --git a/patch/cust/bar_act.h b/patch/cust/bar_act.h
137
deleted file mode 100644
138
index 434f567..0000000
139
--- a/patch/cust/bar_act.h
140
+++ /dev/null
141
@@ -1 +0,0 @@
142
-static int click_act(Bar *bar, Arg *arg, BarClickArg *a);
143
diff --git a/patch/cust/bar_date.c b/patch/cust/bar_date.c
144
index bcec6a2..5e2f0b1 100644
145
--- a/patch/cust/bar_date.c
146
+++ b/patch/cust/bar_date.c
147
@@ -1,23 +1,4 @@
148
 
149
-#define SH(cmd) (const char*[]){ "/bin/sh", "-c", cmd, NULL }
150
-#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
151
-#define TERM_RUN(cmd) (const char*[]){ "/bin/alacritty", "-e", cmd, NULL }
152
-
153
-void runcmd(const char *cmd[]) {
154
-  if (fork() == 0) {
155
-    setsid();
156
-    execvp(cmd[0], (char**)cmd);
157
-  }
158
-}
159
-
160
-void runsh(const char *cmd) {
161
-  runcmd(SH(cmd));
162
-}
163
-
164
-void termrun(const char *cmd) {
165
-  runcmd(TERM_RUN(cmd));
166
-}
167
-
168
 // get current time once a second
169
 void get_date(char *time) {
170
     FILE *fp;
171
diff --git a/patch/cust/bar_time.c b/patch/cust/bar_time.c
172
index 7b9fa73..a58538e 100644
173
--- a/patch/cust/bar_time.c
174
+++ b/patch/cust/bar_time.c
175
@@ -41,3 +41,9 @@ click_time(Bar *bar, Arg *arg, BarClickArg *a)
176
   return EXIT_SUCCESS;
177
 }
178
 
179
+int clickk_time(Bar *bar, Arg *arg, BarClickArg *a)
180
+{
181
+  termrun("gbmonit");
182
+  return EXIT_SUCCESS;
183
+}
184
+
185
diff --git a/patch/cust/bar_time.h b/patch/cust/bar_time.h
186
index 8fd9f76..5dd3a85 100644
187
--- a/patch/cust/bar_time.h
188
+++ b/patch/cust/bar_time.h
189
@@ -1,3 +1,4 @@
190
 static int width_time(Bar *bar, BarWidthArg *a);
191
 static int draw_time(Bar *bar, BarDrawArg *a);
192
 static int click_time(Bar *bar, Arg *arg, BarClickArg *a);
193
+static int clickk_time(Bar *bar, Arg *arg, BarClickArg *a);
194
diff --git a/patch/functions.c b/patch/functions.c
195
new file mode 100644
196
index 0000000..3809f58
197
--- /dev/null
198
+++ b/patch/functions.c
199
@@ -0,0 +1,21 @@
200
+
201
+#define SH(cmd) (const char*[]){ "/bin/sh", "-c", cmd, NULL }
202
+#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
203
+#define TERM_RUN(cmd) (const char*[]){ "/bin/alacritty", "-e", cmd, NULL }
204
+
205
+
206
+void runcmd(const char *cmd[]) {
207
+  if (fork() == 0) {
208
+    setsid();
209
+    execvp(cmd[0], (char**)cmd);
210
+  }
211
+}
212
+
213
+void runsh(const char *cmd) {
214
+  runcmd(SH(cmd));
215
+}
216
+
217
+void termrun(const char *cmd) {
218
+  runcmd(TERM_RUN(cmd));
219
+}
220
+
221
diff --git a/patch/functions.h b/patch/functions.h
222
new file mode 100644
223
index 0000000..e69de29
224
diff --git a/patch/include.c b/patch/include.c
225
index b04c267..c7c6827 100644
226
--- a/patch/include.c
227
+++ b/patch/include.c
228
@@ -1,4 +1,5 @@
229
 /* Bar functionality */
230
+#include "functions.c"
231
 #include "bar_ltsymbol.c"
232
 #include "bar_status.c"
233
 #include "bar_tags.c"