File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,8 @@ zeit export --format tyme --project "my project" --since "2020-04-01T15:04:05+07
278
278
Here are a few integrations and extensions built by myself as well as other
279
279
people that make use of ` zeit ` :
280
280
281
+ - [ ` zeit-waybar-wofi.sh ` ] ( https://github.com/mrusme/zeit/blob/main/extras/zeit-waybar-wofi.sh ) ,
282
+ a script for integrating ` zeit ` into waybar, using wofi
281
283
- [ ` zeit.1m.sh ` ] ( https://github.com/mrusme/zeit/blob/main/extras/zeit.1m.sh ) ,
282
284
an [ ` xbar ` ] ( https://github.com/matryer/xbar ) plugin for ` zeit `
283
285
- [ ` zeit-status.sh ` ] ( https://github.com/khughitt/dotfiles/blob/master/polybar/scripts/zeit-status.sh ) ,
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # Example waybar configuration:
4
+ #
5
+ # "custom/zeit": {
6
+ # "format": "{}",
7
+ # "exec": "zeit-waybar-wofi.sh",
8
+ # "on-click": "zeit-waybar-wofi.sh click",
9
+ # "interval": 10
10
+ # },
11
+ #
12
+
13
+ ZEIT_BIN=zeit
14
+
15
+ tracking=$( $ZEIT_BIN tracking --no-colors)
16
+
17
+ if [[ " $1 " == " click" ]]
18
+ then
19
+ if echo " $tracking " | grep -q ' ^ ▶ tracking'
20
+ then
21
+ $ZEIT_BIN finish
22
+ exit 0
23
+ fi
24
+
25
+ selection=$( $ZEIT_BIN list \
26
+ --only-projects-and-tasks \
27
+ --append-project-id-to-task \
28
+ | wofi \
29
+ --dmenu \
30
+ --sort-order default \
31
+ --cache-file /dev/null\
32
+ )
33
+
34
+ task=$( echo $selection | pcregrep -io1 ' └── (.+) \[.+' )
35
+ project=$( echo $selection | pcregrep -io1 ' .+\[(.+)\]' )
36
+
37
+ if [[ " $task " == " " ]] || [[ " $project " == " " ]]
38
+ then
39
+ exit 1
40
+ fi
41
+
42
+ $ZEIT_BIN track -p " $project " -t " $task "
43
+ exit 0
44
+ fi
45
+
46
+ echo -n $tracking
47
+
You can’t perform that action at this time.
0 commit comments