-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(polybar): updated polybar cava integration
- Loading branch information
Showing
14 changed files
with
665 additions
and
203 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/env bash | ||
|
||
box=$(echo -en "archlinux\nalpine\ndebian\nubuntu:20.04\nfedora\nnode:14.20.0-bullseye-slim\nmcr.microsoft.com/playwright\nmcr.microsoft.com/playwright:v1.25.0-focal" | fzf -i +m --height 10% --reverse ) | ||
box=$(echo -en "bytelearn/hcsolveer:preprod\npython:3.11\narchlinux\nalpine\ndebian\nubuntu:20.04\nfedora\nnode:14.20.0-bullseye-slim\nmcr.microsoft.com/playwright\nmcr.microsoft.com/playwright:v1.25.0-focal" | fzf -i +m --height 10% --reverse ) | ||
echo $box | ||
docker run -w /workdir -p 8000:8000 -it --rm -v `pwd`:/workdir $box bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
power=$(echo -en "$(cat /sys/class/power_supply/BAT0/power_now) / 1000000" | kalker) | ||
power=$(echo -en "$(cat /sys/class/power_supply/BAT0/power_now) / 1000000" | kalker -p 4) | ||
echo -en "$power watts" | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /bin/bash | ||
|
||
# bar="⠀▂▃▄▅▆▇█" | ||
# bar="▂▃▄▅▆▇█" | ||
bar="▁▂▃▄▅▆▇█" | ||
dict="s/;//g;" | ||
|
||
# creating "dictionary" to replace char with bar | ||
i=0 | ||
while [ $i -lt ${#bar} ] | ||
do | ||
dict="${dict}s/$i/${bar:$i:1}/g;" | ||
i=$((i=i+1)) | ||
done | ||
|
||
# make sure to clean pipe | ||
pipe="/tmp/cava.fifo" | ||
if [ -p $pipe ]; then | ||
unlink $pipe | ||
fi | ||
mkfifo $pipe | ||
|
||
# write cava config | ||
config_file="/tmp/polybar_cava_config" | ||
echo " | ||
[general] | ||
bars = 130 | ||
[output] | ||
method = raw | ||
raw_target = $pipe | ||
data_format = ascii | ||
ascii_max_range = 7 | ||
" > $config_file | ||
|
||
# run cava in the background | ||
cava -p $config_file & | ||
|
||
# reading data from fifo | ||
while read -r cmd; do | ||
echo $cmd | sed $dict | ||
done < $pipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.