Skip to content

Commit 32093eb

Browse files
authored
Merge pull request #2 from budlabs/next
added polipop command
2 parents 7cf0ae4 + 63ab015 commit 32093eb

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019, budRich
3+
Copyright (c) 2020, budRich
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ install:
1313
test -d $(INSTMAN) || mkdir -p $(INSTMAN)
1414

1515
install -m 0755 $(SCRIPT) $(INSTBIN)
16+
install -m 0755 polifypop $(INSTBIN)
1617
install -m 0644 $(MANPAGE) $(INSTMAN)
1718
.PHONY: install
1819

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ Since only the last line of the file is the one that will
108108
be visible in the bar, it is possible to write and read text
109109
to the file and use them to f.i. store the state of a
110110
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...
112119

113120
```
114121
$ polify --module polifyModule1 --msg "mode1" --foreground '#FF0000' this is mode one
@@ -117,6 +124,12 @@ mode1
117124
```
118125

119126

127+
```
128+
$ polify --module polifyModule1 --msg "POLIPOP notify-send 'hello pop'" hello bar
129+
$ polifypop polifyModule1
130+
```
131+
132+
120133
`polifymodetoggler.sh`
121134

122135
``` shell
@@ -228,6 +241,11 @@ UPDATES
228241

229242
#### 2019.08.05.0
230243

244+
Added polifypop.
245+
246+
#### 2019.08.05.0
247+
248+
231249
Initial release.
232250

233251

polify

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
___printversion(){
44

55
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
88
EOB
99
}
1010

polify.1

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.TH POLIFY 1 2019\-08\-05 Linux "User Manuals"
1+
.nh
2+
.TH POLIFY 1 2020\-06\-03 Linux "User Manuals"
23
.SH NAME
34
.PP
45
\fB\fCpolify\fR \- Update polybar hookmodules in a safe
@@ -132,6 +133,15 @@ f.i. store the state of a module. This is
132133
conveniently done by using the \fB\fC\-\-msg MESSAGE\fR
133134
option.
134135

136+
.PP
137+
polify is shipped with the script \fBpolifypop\fP,
138+
which can be used to execute commands on the
139+
\fB\fC\-\-msg\fRline. It will only execute a command if it
140+
is prefixed with the word \fBPOLIPOP\fP\&. And the
141+
first argument to \fBpolifypop\fP needs to be the
142+
name of the module, it is cool to bind polifypop
143+
to a hotkey...
144+
135145
.PP
136146
.RS
137147

@@ -143,6 +153,16 @@ mode1
143153
.fi
144154
.RE
145155

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+
146166
.PP
147167
\fB\fCpolifymodetoggler.sh\fR
148168

@@ -317,7 +337,7 @@ state. defaults to: /tmp/polify
317337
\fB\fCbash\fR \fB\fCpolybar\fR \fB\fCgetopt\fR
318338

319339
.PP
320-
budRich
340+
budRich https://github.com/budlabs/polify
321341
\[la]https://github.com/budlabs/polify\[ra]
322342

323343
.SH SEE ALSO

polifypop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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#* }"

0 commit comments

Comments
 (0)