autolinux


Logs | Files | README | LICENSE | GitLab


1
commit c185d7eab42399aa3d684b7a6282c866dc613e72
2
Author: Connor Etherington <[email protected]>
3
Date:   Sat Mar 25 04:38:06 2023 +0200
4
5
    Auto-Commit Update 25.03.2023 - 04:38:06
6
---
7
 AutoLinux             | Bin 114224 -> 114256 bytes
8
 config.h              |   6 +++---
9
 patch/cust/bar_date.c |  23 +++++++++++++++++++++++
10
 patch/cust/bar_date.h |   1 +
11
 patch/cust/bar_time.c |  15 ---------------
12
 5 files changed, 27 insertions(+), 18 deletions(-)
13
14
diff --git a/AutoLinux b/AutoLinux
15
index d7533d1..845b694 100755
16
Binary files a/AutoLinux and b/AutoLinux differ
17
diff --git a/config.h b/config.h
18
index a33d71a..2490e6d 100644
19
--- a/config.h
20
+++ b/config.h
21
@@ -119,7 +119,7 @@ static const BarRule barrules[] = {
22
   	{ -1,       0,     BAR_ALIGN_CENTER,       width_tags,            draw_tags,            click_tags,         "tags"     },
23
     { -1,       0,     BAR_ALIGN_LEFT_LEFT,    width_ltsymbol,        draw_ltsymbol,        click_time,     "layout"   },
24
     //{ 0,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_status,       "time"     },
25
-    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_date,            draw_date,            click_time,       "date"     },
26
+    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_date,            draw_date,            click_date,       "date"     },
27
     { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_time,       "time"     },
28
     { 0,        0,     BAR_ALIGN_LEFT,         width_wintitle,        draw_wintitle,        click_wintitle,     "wintitle" },
29
 };
30
@@ -299,8 +299,8 @@ static Key keys[] = {
31
 	{ MODKEY|ShiftMask,     XK_a,		defaultgaps,	{0} },
32
 //	{ MODKEY,         			XK_s,		togglesticky,	{0} },
33
   { MODKEY|ShiftMask,		XK_s,		spawn,     SHCMD("gnome-screenshot -i") },
34
-	{ MODKEY,         			XK_d,		spawn,          SHCMD("rofi -show run") },
35
-	{ MODKEY|ALTKEY,         			XK_d,		spawn,  SHCMD("rofi -show run") },
36
+	{ MODKEY,         			XK_d,		spawn,          SHCMD("rfi 33") },
37
+	{ MODKEY|ALTKEY,         			XK_d,		spawn,  SHCMD("rfi 40") },
38
 	{ MODKEY|ALTKEY,         		  XK_b,		spawn,		SHCMD("passmenu") },
39
 	{ MODKEY,               XK_f,		togglefullscr,	{0} },
40
 	{ MODKEY|ShiftMask,     XK_f,		setlayout,	{.v = &layouts[8]} },
41
diff --git a/patch/cust/bar_date.c b/patch/cust/bar_date.c
42
index b680420..bcec6a2 100644
43
--- a/patch/cust/bar_date.c
44
+++ b/patch/cust/bar_date.c
45
@@ -1,5 +1,22 @@
46
 
47
 #define SH(cmd) (const char*[]){ "/bin/sh", "-c", cmd, NULL }
48
+#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
49
+#define TERM_RUN(cmd) (const char*[]){ "/bin/alacritty", "-e", cmd, NULL }
50
+
51
+void runcmd(const char *cmd[]) {
52
+  if (fork() == 0) {
53
+    setsid();
54
+    execvp(cmd[0], (char**)cmd);
55
+  }
56
+}
57
+
58
+void runsh(const char *cmd) {
59
+  runcmd(SH(cmd));
60
+}
61
+
62
+void termrun(const char *cmd) {
63
+  runcmd(TERM_RUN(cmd));
64
+}
65
 
66
 // get current time once a second
67
 void get_date(char *time) {
68
@@ -37,3 +54,9 @@ draw_date(Bar *bar, BarDrawArg *a)
69
   return x + w;
70
 }
71
 
72
+int
73
+click_date(Bar *bar, Arg *arg, BarClickArg *a)
74
+{
75
+  runsh("rfi 40");
76
+  return EXIT_SUCCESS;
77
+}
78
diff --git a/patch/cust/bar_date.h b/patch/cust/bar_date.h
79
index 29416b2..68f3cd7 100644
80
--- a/patch/cust/bar_date.h
81
+++ b/patch/cust/bar_date.h
82
@@ -1,2 +1,3 @@
83
 static int width_date(Bar *bar, BarWidthArg *a);
84
 static int draw_date(Bar *bar, BarDrawArg *a);
85
+static int click_date(Bar *bar, Arg *arg, BarClickArg *a);
86
diff --git a/patch/cust/bar_time.c b/patch/cust/bar_time.c
87
index 7443010..7b9fa73 100644
88
--- a/patch/cust/bar_time.c
89
+++ b/patch/cust/bar_time.c
90
@@ -4,21 +4,6 @@
91
 #define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
92
 #define TERM_RUN(cmd) (const char*[]){ "/bin/alacritty", "-e", cmd, NULL }
93
 
94
-void runcmd(const char *cmd[]) {
95
-  if (fork() == 0) {
96
-    setsid();
97
-    execvp(cmd[0], (char**)cmd);
98
-  }
99
-}
100
-
101
-void runsh(const char *cmd) {
102
-  runcmd(SH(cmd));
103
-}
104
-
105
-void termrun(const char *cmd) {
106
-  runcmd(TERM_RUN(cmd));
107
-}
108
-
109
 void get_time(char *time) {
110
     FILE *fp;
111
     char buf[100];