autolinux


Logs | Files | LICENSE | LICENSE | GitLab


1
commit eaf0c30f78df81fd77ea573812c25e5f54d120a0
2
Author: Connor Etherington <[email protected]>
3
Date:   Fri Mar 24 23:34:38 2023 +0200
4
5
    Auto-Commit Update 24.03.2023 - 23:34:38
6
---
7
 AutoLinux             | Bin 110072 -> 114224 bytes
8
 config.h              |  18 +++++++++---------
9
 patch/cust/bar_act.c  |  10 ++++++++++
10
 patch/cust/bar_act.h  |   1 +
11
 patch/cust/bar_date.c |   4 ++--
12
 patch/cust/bar_time.c |  30 +++++++++++++++++++++++++++---
13
 6 files changed, 49 insertions(+), 14 deletions(-)
14
15
diff --git a/AutoLinux b/AutoLinux
16
index 0d9013c..d7533d1 100755
17
Binary files a/AutoLinux and b/AutoLinux differ
18
diff --git a/config.h b/config.h
19
index b5787b7..a33d71a 100644
20
--- a/config.h
21
+++ b/config.h
22
@@ -55,13 +55,13 @@ static char selfgcolor[]            = "#00ff00";
23
 static char selbordercolor[]        = "#c9c9c9";
24
 static char selbgcolor[]            = "#1A2026";
25
 static char timefgcolor[]           = "#1A2026";
26
-static char timebordercolor[]       = "#ff5782";
27
-static char timebgcolor[]           = "#ff5782";
28
-static char activefgcolor[]         = "#EFEFEF";
29
-static char activebordercolor[]     = "#ff5782";
30
+static char timebordercolor[]       = "#ff2782";
31
+static char timebgcolor[]           = "#ff2782";
32
+static char activefgcolor[]         = "#efeff0";
33
+static char activebordercolor[]     = "#ff2782";
34
 static char activebgcolor[]         = "#0077aa";
35
-static char inactivefgcolor[]       = "#ff5782";
36
-static char inactivebordercolor[]   = "#ff5782";
37
+static char inactivefgcolor[]       = "#ff2782";
38
+static char inactivebordercolor[]   = "#ff2782";
39
 static char inactivebgcolor[]       = "#efeff0";
40
 
41
 static char *colors[][3] = {
42
@@ -117,10 +117,10 @@ static const BarRule barrules[] = {
43
    	/* monitor  bar    alignment               widthfunc              drawfunc              clickfunc           name */
44
  /* { -1,       0,     BAR_ALIGN_LEFT,         width_tags,            draw_tags,            click_tags,         "tags"     }, */
45
   	{ -1,       0,     BAR_ALIGN_CENTER,       width_tags,            draw_tags,            click_tags,         "tags"     },
46
-    { -1,       0,     BAR_ALIGN_LEFT_LEFT,    width_ltsymbol,        draw_ltsymbol,        click_ltsymbol,     "layout"   },
47
+    { -1,       0,     BAR_ALIGN_LEFT_LEFT,    width_ltsymbol,        draw_ltsymbol,        click_time,     "layout"   },
48
     //{ 0,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_status,       "time"     },
49
-    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_date,            draw_date,            click_status,       "date"     },
50
-    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_status,       "time"     },
51
+    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_date,            draw_date,            click_time,       "date"     },
52
+    { -1,        0,     BAR_ALIGN_RIGHT_RIGHT,  width_time,            draw_time,            click_time,       "time"     },
53
     { 0,        0,     BAR_ALIGN_LEFT,         width_wintitle,        draw_wintitle,        click_wintitle,     "wintitle" },
54
 };
55
 
56
diff --git a/patch/cust/bar_act.c b/patch/cust/bar_act.c
57
new file mode 100644
58
index 0000000..03c47b2
59
--- /dev/null
60
+++ b/patch/cust/bar_act.c
61
@@ -0,0 +1,10 @@
62
+
63
+#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
64
+
65
+int
66
+click_act (Bar *bar, Arg *arg, BarClickArg *a)
67
+{
68
+  spawn (ROFI());
69
+}
70
+
71
+int
72
diff --git a/patch/cust/bar_act.h b/patch/cust/bar_act.h
73
new file mode 100644
74
index 0000000..434f567
75
--- /dev/null
76
+++ b/patch/cust/bar_act.h
77
@@ -0,0 +1 @@
78
+static int click_act(Bar *bar, Arg *arg, BarClickArg *a);
79
diff --git a/patch/cust/bar_date.c b/patch/cust/bar_date.c
80
index c417129..b680420 100644
81
--- a/patch/cust/bar_date.c
82
+++ b/patch/cust/bar_date.c
83
@@ -5,7 +5,7 @@
84
 void get_date(char *time) {
85
     FILE *fp;
86
     char buf[100];
87
-    fp = popen("date '+%a, %d %b    '", "r");
88
+    fp = popen("echo -en \"  `date '+%a, %d %b'`\"", "r");
89
     fgets(buf, 100, fp);
90
     pclose(fp);
91
     strcpy(time, buf);
92
@@ -29,7 +29,7 @@ draw_date(Bar *bar, BarDrawArg *a)
93
 
94
   char date[100];
95
   get_date(date);
96
-  date[strlen(date) - 1] = '\0';
97
+//  date[strlen(date) - 1] = '\0';
98
 
99
   drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, date, 0);
100
   drw_map(drw, bar->win, 0, 0, w, bh);
101
diff --git a/patch/cust/bar_time.c b/patch/cust/bar_time.c
102
index a555e1a..7443010 100644
103
--- a/patch/cust/bar_time.c
104
+++ b/patch/cust/bar_time.c
105
@@ -1,10 +1,28 @@
106
 
107
+
108
 #define SH(cmd) (const char*[]){ "/bin/sh", "-c", cmd, NULL }
109
+#define ROFI() (const char*[]){ "/bin/rofi", "-show", "run", NULL }
110
+#define TERM_RUN(cmd) (const char*[]){ "/bin/alacritty", "-e", cmd, NULL }
111
+
112
+void runcmd(const char *cmd[]) {
113
+  if (fork() == 0) {
114
+    setsid();
115
+    execvp(cmd[0], (char**)cmd);
116
+  }
117
+}
118
+
119
+void runsh(const char *cmd) {
120
+  runcmd(SH(cmd));
121
+}
122
+
123
+void termrun(const char *cmd) {
124
+  runcmd(TERM_RUN(cmd));
125
+}
126
 
127
 void get_time(char *time) {
128
     FILE *fp;
129
     char buf[100];
130
-    fp = popen("date '+%H:%M'", "r");
131
+    fp = popen("echo -en \" `date +%H:%M`\"", "r");
132
     fgets(buf, 100, fp);
133
     pclose(fp);
134
     strcpy(time, buf);
135
@@ -13,7 +31,7 @@ void get_time(char *time) {
136
 int
137
 width_time(Bar *bar, BarWidthArg *a)
138
 {
139
-  return TEXTW("00:00  ") + lrpad;
140
+  return TEXTW("00:00") + lrpad;
141
 }
142
 
143
 int
144
@@ -28,7 +46,13 @@ draw_time(Bar *bar, BarDrawArg *a)
145
 
146
   char time[100];
147
   get_time(time);
148
-  time[strlen(time) - 1] = '\0';
149
   return drw_text(drw, x, 0, w, bh, lrpad / 2, time, 0);
150
 }
151
 
152
+int
153
+click_time(Bar *bar, Arg *arg, BarClickArg *a)
154
+{
155
+  termrun("ttyclk");
156
+  return EXIT_SUCCESS;
157
+}
158
+