Skip to content

Commit 7793212

Browse files
committed
Added README + polybar ini module file
1 parent 10990ef commit 7793212

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Stop smoking systemd service and polybar integration
2+
**Let's hope we're all gonna quit smoking :) But until then, you can use this nice program to reduce the number of cigarettes. It will tell you when to smoke and pull cigarettes out without you knoing. I'm trying it on me as well, so feel free to share your results**
3+
4+
## How it looks like
5+
Screenshot made using "shades" from: [https://github.com/adi1090x/polybar-themes](https://github.com/adi1090x/polybar-themes)
6+
7+
![Screenshot](https://github.com/fredtux/STOP_Smoking_Polybar/blob/main/Screenshot.png?raw=true)
8+
9+
## How to install it
10+
```bash
11+
make
12+
make install
13+
```
14+
15+
Copy **stopsmoking.ini** to your polybar modules folder and load it in the config.ini file then add it wherever you want.
16+
17+
## How to uninstall it
18+
```bash
19+
make uninstall
20+
```
21+
22+
Also keep in mind the **stopsmoking.ini** polybar module. Everyone has a different configuration so I'm not going to make it automatic.
23+
24+
## Files description
25+
1. stopsmoking.c (the service)
26+
2. stopsmoking-config (the configurer)
27+
3. stopsmoking-polybar (client for the service and middleman to polybar)
28+
4. run_polybar_stopsmoking.sh (script to be executed by polybar)
29+
5. stopsmoking.service (created after make install - service file)

stopsmoking.ini

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[module/stopsmoking]
2+
type = custom/script
3+
4+
; Available tokens:
5+
; %counter%
6+
; Command to be executed (using "/bin/sh -c [command]")
7+
exec = /usr/bin/run_polybar_stopsmoking.sh
8+
9+
; Conditional command that, if defined, needs to exit successfully
10+
; before the main exec command is invoked.
11+
; Default: ""
12+
;exec-if = pgrep -x stopsmoking
13+
14+
; Set this to true for scripts that continuously produce output
15+
; If set to 'true', everytime the script produces a new line of output, the module updates.
16+
; Otherwise, only the first line of output is considered and all later lines are discarded.
17+
; Default: false
18+
tail = false
19+
20+
; Seconds to sleep between updates
21+
; Default: 5 (0 if `tail = true`)
22+
interval = 3
23+
24+
; Set environment variables in the 'exec' script
25+
; New in version 3.6.0
26+
; env-NAME = VALUE
27+
; env-FOO = BAR
28+
; Available tags:
29+
; <label> (default)
30+
format = <label>
31+
format-background = ${color.shade3}
32+
format-foreground = #FFFFFF
33+
format-padding = 1
34+
35+
; Format used when the `exec` command returns with a non-zero exit code
36+
; Only used with `tail = false`
37+
; If not defined, format is used instead.
38+
; Available tags:
39+
; <label-fail>
40+
; New in version 3.6.0
41+
; format-fail = <label-fail>
42+
43+
; Available tokens:
44+
; %output%
45+
; Default: %output%
46+
label = %output:0:15:...%
47+
48+
; Available tokens:
49+
; %output%
50+
; Default: %output%
51+
; New in version 3.6.0
52+
label-fail = %output:0:15:...%
53+
54+
; Available tokens:
55+
; %counter%
56+
; %pid%
57+
;
58+
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
59+
click-left = pkill -SIGUSR1 stopsmoking-pol
60+
click-middle =
61+
click-right =
62+
double-click-left =
63+
double-click-middle =
64+
double-click-right =
65+
66+
; Available tokens:
67+
; %counter%
68+
; %pid%
69+
;
70+
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
71+
scroll-up =
72+
scroll-down =

0 commit comments

Comments
 (0)