File tree Expand file tree Collapse file tree 6 files changed +54
-6
lines changed Expand file tree Collapse file tree 6 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 1
1
MIT License
2
2
3
- Copyright (c) 2019 , budRich
3
+ Copyright (c) 2020 , budRich
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ install:
13
13
test -d $(INSTMAN ) || mkdir -p $(INSTMAN )
14
14
15
15
install -m 0755 $(SCRIPT) $(INSTBIN)
16
+ install -m 0755 polifypop $(INSTBIN)
16
17
install -m 0644 $(MANPAGE) $(INSTMAN)
17
18
.PHONY : install
18
19
Original file line number Diff line number Diff line change @@ -108,7 +108,14 @@ Since only the last line of the file is the one that will
108
108
be visible in the bar, it is possible to write and read text
109
109
to the file and use them to f.i. store the state of a
110
110
module. This is conveniently done by using the `--msg
111
- MESSAGE` option.
111
+ MESSAGE` option.
112
+
113
+ polify is shipped with the script ** polifypop** , which can
114
+ be used to execute commands on the ` --msg ` line. It will only
115
+ execute a command if it is prefixed with the word
116
+ ** POLIPOP** . And the first argument to ** polifypop** needs
117
+ to be the name of the module, it is cool to bind polifypop
118
+ to a hotkey...
112
119
113
120
```
114
121
$ polify --module polifyModule1 --msg "mode1" --foreground '#FF0000' this is mode one
@@ -117,6 +124,12 @@ mode1
117
124
```
118
125
119
126
127
+ ```
128
+ $ polify --module polifyModule1 --msg "POLIPOP notify-send 'hello pop'" hello bar
129
+ $ polifypop polifyModule1
130
+ ```
131
+
132
+
120
133
` polifymodetoggler.sh `
121
134
122
135
``` shell
@@ -228,6 +241,11 @@ UPDATES
228
241
229
242
#### 2019.08.05.0
230
243
244
+ Added polifypop.
245
+
246
+ #### 2019.08.05.0
247
+
248
+
231
249
Initial release.
232
250
233
251
Original file line number Diff line number Diff line change 3
3
___printversion (){
4
4
5
5
cat << 'EOB ' >&2
6
- polify - version: 2019.08.05.8
7
- updated: 2019-08-05 by budRich
6
+ polify - version: 2020.06.03.1
7
+ updated: 2020-06-03 by budRich
8
8
EOB
9
9
}
10
10
Original file line number Diff line number Diff line change 1
- .TH POLIFY 1 2019\- 08\- 05 Linux "User Manuals"
1
+ .nh
2
+ .TH POLIFY 1 2020\- 06\- 03 Linux "User Manuals"
2
3
.SH NAME
3
4
.PP
4
5
\fB \f C polify\fR \- Update polybar hookmodules in a safe
@@ -132,6 +133,15 @@ f.i. store the state of a module. This is
132
133
conveniently done by using the \fB \f C \-\- msg MESSAGE\fR
133
134
option.
134
135
136
+ .PP
137
+ polify is shipped with the script \fB polifypop \fP ,
138
+ which can be used to execute commands on the
139
+ \fB \f C \-\- msg\fR line. It will only execute a command if it
140
+ is prefixed with the word \fB POLIPOP \fP \& . And the
141
+ first argument to \fB polifypop \fP needs to be the
142
+ name of the module, it is cool to bind polifypop
143
+ to a hotkey...
144
+
135
145
.PP
136
146
.RS
137
147
@@ -143,6 +153,16 @@ mode1
143
153
.fi
144
154
.RE
145
155
156
+ .PP
157
+ .RS
158
+
159
+ .nf
160
+ $ polify \-\- module polifyModule1 \-\- msg "POLIPOP notify\- send 'hello pop'" hello bar
161
+ $ polifypop polifyModule1
162
+
163
+ .fi
164
+ .RE
165
+
146
166
.PP
147
167
\fB \f C polifymodetoggler.sh\fR
148
168
@@ -317,7 +337,7 @@ state. defaults to: /tmp/polify
317
337
\fB \f C bash\fR \fB \f C polybar\fR \fB \f C getopt\fR
318
338
319
339
.PP
320
- budRich
340
+ budRich https://github.com/budlabs/polify
321
341
\[la ] https://github.com/budlabs/polify\[ra ]
322
342
323
343
.SH SEE ALSO
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ ERX (){ >&2 echo " [ERROR]" " $* " && exit 1 ; }
4
+
5
+ [[ -z $1 ]] && ERX first argument should be the name of a polify module
6
+
7
+ msg=$( polify --module " $1 " | head -1)
8
+ [[ ${msg%% * } = POLIPOP ]] || exit 1
9
+ eval " ${msg#* } "
You can’t perform that action at this time.
0 commit comments