summaryrefslogtreecommitdiffstats
path: root/.config/polybar
diff options
context:
space:
mode:
authorYigit Sever2021-10-31 16:29:10 +0300
committerYigit Sever2021-10-31 16:29:10 +0300
commit7d02d49ee5dd8c43b72cd50cd00a6e9de79f74ed (patch)
tree6d4f202b6612bebf5c770536e6ed8a2a0481163f /.config/polybar
parenta0d0369640dbdf7aa64009556bc23e6252dfbb4c (diff)
downloaddotfiles-7d02d49ee5dd8c43b72cd50cd00a6e9de79f74ed.tar.gz
dotfiles-7d02d49ee5dd8c43b72cd50cd00a6e9de79f74ed.tar.bz2
dotfiles-7d02d49ee5dd8c43b72cd50cd00a6e9de79f74ed.zip
polybar: iss tracker (spaaaace)
Diffstat (limited to '.config/polybar')
-rw-r--r--.config/polybar/config##h.maus62
-rwxr-xr-x.config/polybar/launch.sh15
-rwxr-xr-x.config/polybar/scripts/space31
3 files changed, 54 insertions, 54 deletions
diff --git a/.config/polybar/config##h.maus b/.config/polybar/config##h.maus
index cf390c7..15e98ac 100644
--- a/.config/polybar/config##h.maus
+++ b/.config/polybar/config##h.maus
@@ -23,20 +23,6 @@ purple = #7F21AD
23aqua = #4CC9BE 23aqua = #4CC9BE
24orange = #C24049 24orange = #C24049
25 25
26; [colors]
27; background = #080808
28; background_modules = #eeeeee
29; foreground = #b2b2b2
30; foreground_modules = #080808
31; red = #ff5454
32; green = #8cc85f
33; sold_out_green = #1DB954
34; yellow = #e3c78a
35; blue = #80a0ff
36; purple = #d183e8
37; aqua = #79dac8
38; orange = #ff5189
39
40[bar/top] 26[bar/top]
41monitor = DP-0 27monitor = DP-0
42width = 100% 28width = 100%
@@ -45,6 +31,7 @@ offset-x = 0
45offset-y = 0 31offset-y = 0
46radius = 0 32radius = 0
47fixed-center = true 33fixed-center = true
34enable-ipc = true
48 35
49background = ${colors.background} 36background = ${colors.background}
50foreground = ${colors.foreground} 37foreground = ${colors.foreground}
@@ -55,7 +42,7 @@ module-margin = 1
55font-0 = scientifica:antialias=false;1 42font-0 = scientifica:antialias=false;1
56font-1 = Siji:size=20;1 43font-1 = Siji:size=20;1
57 44
58modules-left = i3 pulseaudio-control spotify mpd github 45modules-left = i3 pulseaudio-control spotify mpd github iss
59modules-center = xwindow 46modules-center = xwindow
60modules-right = focus notification_pause memory cpu download upload date time 47modules-right = focus notification_pause memory cpu download upload date time
61 48
@@ -87,15 +74,20 @@ format-prefix-padding = 1
87format-offline = <label-offline> 74format-offline = <label-offline>
88label-offline = Github offline 75label-offline = Github offline
89 76
77[module/iss]
78type = custom/script
79exec = /home/yigit/.config/polybar/scripts/space
80interval = 5
81
90[module/focus] 82[module/focus]
91type = custom/script 83type = custom/script
92exec = ~/.config/polybar/scripts/focus 84exec = /home/yigit/.config/polybar/scripts/focus
93double-click-left = exec ~/.config/polybar/scripts/stop & 85double-click-left = exec /home/yigit/.config/polybar/scripts/stop &
94interval = 1 86interval = 10
95 87
96[module/notification_pause] 88[module/notification_pause]
97type = custom/script 89type = custom/script
98exec = ~/.config/polybar/scripts/notification_pause 90exec = /home/yigit/.config/polybar/scripts/notification_pause
99interval = 5 91interval = 5
100 92
101[module/spotify] 93[module/spotify]
@@ -109,7 +101,6 @@ format-prefix-foreground = ${colors.foreground_modules}
109format = <label> 101format = <label>
110format-padding = 0 102format-padding = 0
111exec = python /usr/share/polybar/scripts/spotify_status.py -f '{play_pause} {artist} - {song}' -p ', ' 103exec = python /usr/share/polybar/scripts/spotify_status.py -f '{play_pause} {artist} - {song}' -p ', '
112;契
113 104
114[module/mpd] 105[module/mpd]
115type = internal/mpd 106type = internal/mpd
@@ -329,39 +320,18 @@ label-background = ${colors.background_modules}
329label-foreground = ${colors.foreground_modules} 320label-foreground = ${colors.foreground_modules}
330label-padding = 1 321label-padding = 1
331 322
332[module/pulseaudio]
333type = internal/pulseaudio
334interval = 5
335
336format-volume = <label-volume>
337
338format-volume-prefix = 
339format-volume-prefix-background = ${colors.purple}
340format-volume-prefix-foreground = ${colors.background_modules}
341format-volume-prefix-padding = 1
342
343label-volume = %percentage%
344label-volume-background = ${colors.background_modules}
345label-volume-foreground = ${colors.foreground_modules}
346label-volume-padding = 1
347
348label-muted = 
349label-muted-background = ${colors.purple}
350label-muted-foreground = ${colors.foreground}
351label-muted-padding = 2
352
353[module/pulseaudio-control] 323[module/pulseaudio-control]
354type = custom/script 324type = custom/script
355tail = true 325tail = true
356label = %output% 326label = %output%
357interval = 5 327interval = 5
358 328
359exec = ~/.config/polybar/scripts/pulseaudio_control --listen 329exec = /home/yigit/.config/polybar/scripts/pulseaudio_control --listen
360click-right = exec pavucontrol & 330click-right = exec pavucontrol &
361click-left = ~/.config/polybar/scripts/pulseaudio_control --togmute 331click-left = /home/yigit/.config/polybar/scripts/pulseaudio_control --togmute
362click-middle = ~/.config/polybar/scripts/pulseaudio_control --change 332click-middle = /home/yigit/.config/polybar/scripts/pulseaudio_control --change
363scroll-up = ~/.config/polybar/scripts/pulseaudio_control --up 333scroll-up = /home/yigit/.config/polybar/scripts/pulseaudio_control --up
364scroll-down = ~/.config/polybar/scripts/pulseaudio_control --down 334scroll-down = /home/yigit/.config/polybar/scripts/pulseaudio_control --down
365label-padding = 2 335label-padding = 2
366label-foreground = ${colors.foreground_modules} 336label-foreground = ${colors.foreground_modules}
367label-background = ${colors.background_modules} 337label-background = ${colors.background_modules}
diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh
index 0f657c9..1e94ee3 100755
--- a/.config/polybar/launch.sh
+++ b/.config/polybar/launch.sh
@@ -1,15 +1,14 @@
1#!/bin/bash 1#!/usr/bin/env bash
2
3# Try your luck one last time
4# fc-cache -fv
5 2
6# Terminate already running bar instances 3# Terminate already running bar instances
7killall -q polybar 4# killall -q polybar
8 5
9# Wait until the processes have been shut down 6# If all your bars have ipc enabled, you can also use
10while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 7polybar-msg cmd quit
11 8
12# Launch bar 9# Launch bar
13polybar top & 10# Launch bar1 and bar2
11echo "---" | tee -a /tmp/polybar.top.log
12polybar top 2>&1 | tee -a /tmp/polybar.top.log & disown
14 13
15echo "Bar launched..." 14echo "Bar launched..."
diff --git a/.config/polybar/scripts/space b/.config/polybar/scripts/space
new file mode 100755
index 0000000..af5060a
--- /dev/null
+++ b/.config/polybar/scripts/space
@@ -0,0 +1,31 @@
1#!/usr/bin/env bash
2
3# Ankara & Eskisehir are about 200kms away long/lat wise;
4#
5# Ank: 39.925533, 32.866287
6# Esk: 39.766193, 30.526714.
7#
8# That's about 2.34 diff in longitude (much less in latitude), multiply by 100,
9# get rid of the floating part (round down aggressively), 200 seems like a good
10# margin, that's probably within Ankara borders
11#
12# The API recommends calling every 5 seconds (not more frequently, please!), 30
13# seems fine
14#
15# Coords below are from the METU hoodie :)
16
17LEEWAY=200
18
19response=$(curl -s http://api.open-notify.org/iss-now.json)
20
21lat=$(echo "${response}"| jq '.iss_position.latitude')
22long=$(echo "${response}"| jq '.iss_position.longitude')
23
24distlat=$(perl -e "print int(100 * abs(${lat} - 39.885833))")
25distlong=$(perl -e "print int(100 * abs(${long} - 32.779444))")
26
27if [ $distlat -lt $LEEWAY ] && [ $distlong -lt $LEEWAY ]; then
28 echo ""
29else
30 echo
31fi