aboutsummaryrefslogtreecommitdiff
path: root/home/eww.nix
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2024-05-26 20:16:58 -0700
committerCaroline Larimore <caroline@larimo.re>2024-05-26 20:16:58 -0700
commit9eee40299e1f844a11d62d3b8b331c710b8d48ad (patch)
tree0720306d7b91125ff81526d86b7c375a0c0880fc /home/eww.nix
parent577d92eb35ab98df96e993029a26c4fdafade561 (diff)
Tweak eww scripts
Diffstat (limited to 'home/eww.nix')
-rw-r--r--home/eww.nix16
1 files changed, 6 insertions, 10 deletions
diff --git a/home/eww.nix b/home/eww.nix
index 6d7935f..7ed6881 100644
--- a/home/eww.nix
+++ b/home/eww.nix
@@ -4,9 +4,7 @@
home.packages = with pkgs; [
eww
- (writeShellScriptBin "eww-toggle"''
- #!/usr/bin/env bash
-
+ (writeShellScriptBin "eww-toggle" ''
if ${pkgs.eww}/bin/eww active-windows | grep $1; then
${pkgs.eww}/bin/eww close $1
else
@@ -14,24 +12,22 @@
fi
'')
- (writeShellScriptBin "get-album-art"''
- #!/usr/bin/env bash
-
+ (writeShellScriptBin "get-album-art" ''
OUTFILE=".mpris-art"
while read -r line; do
if [[ -n $line ]]; then
rm -f ~/$OUTFILE
- cmus_path=$(cmus-remote -Q | grep file | cut -c 6-)
+ cmus_path=$(${pkgs.cmus}/bin/cmus-remote -Q | grep file | cut -c 6-)
if [[ -n $cmus_path ]]; then
if [[ -f $(dirname "$cmus_path")/cover.jpg ]]; then
cp "$(dirname "$cmus_path")/cover.jpg" ~/$OUTFILE
else
- ffmpeg -y -v quiet -i "$cmus_path" -c:v copy -f mjpeg ~/$OUTFILE
+ ${pkgs.ffmpeg}/bin/ffmpeg -y -v quiet -i "$cmus_path" -c:v copy -f mjpeg ~/$OUTFILE
fi
else
- mpris=$(playerctl --player=cmus,firefox,%any metadata mpris:artUrl)
+ mpris=$(${pkgs.playerctl}/bin/playerctl --player=cmus,firefox,%any metadata mpris:artUrl)
if [[ $mpris == data:image* ]]; then
echo $mpris | sed s/.*,//g | base64 --decode > ~/$OUTFILE
@@ -54,7 +50,7 @@
xdg.configFile."eww/eww.yuck".source = eww/eww.yuck;
xdg.configFile."eww/eww.css".source = eww/eww.css;
-
+
xdg.configFile."eww/windows".source = eww/windows;
xdg.configFile."eww/colors.css".text = let c = config.theme.colors; in ''