configured a spotify widget for waybar

This commit is contained in:
Rouven Seifert 2023-06-03 21:42:12 +02:00
parent b58ae611b6
commit 8f78e1f843
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
9 changed files with 95 additions and 19 deletions

View file

@ -1,5 +1,10 @@
{ pkgs, ... }:
{
# open ports for kde connect
networking.firewall = rec {
allowedTCPPortRanges = [{ from = 1714; to = 1764; }];
allowedUDPPortRanges = allowedTCPPortRanges;
};
# fixes pam entries for swaylock
security.pam.services.swaylock.text = ''
# Account management.

View file

@ -1,7 +1,6 @@
{ config, pkgs, hyprland, ... }:
{ self, config, pkgs, hyprland, ... }:
{
# waybar needs hyprctl
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.hyprland}/bin";
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.hyprland}/bin:${pkgs.playerctl}/bin:${pkgs.pulseaudio}/bin";
programs.waybar = {
enable = true;
systemd.enable = true;
@ -11,7 +10,7 @@
layer = "top";
position = "top";
height = 26;
modules-left = [ "wlr/workspaces" "hyprland/window" ];
modules-left = [ "wlr/workspaces" "hyprland/window" "custom/spotifytitle" ];
modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "clock" ];
network = {
format-wifi = " {essid} ({signalStrength}%)";
@ -29,6 +28,13 @@
format = " {}";
separate-outputs = true;
};
"custom/spotifytitle" = {
format = " {}";
max-length = 80;
return-type = "json";
exec = "${self.packages.x86_64-linux.pww}/bin/pww -w spotifyd:title -f '{{title}} - {{artist}}' -p None 2> /dev/null";
};
cpu = {
format = "{usage}% ";
};
@ -101,6 +107,7 @@
background-color: #eb4d4b;
}
#custom-spotifytitle,
#clock,
#battery,
#cpu,
@ -129,6 +136,20 @@
background-color: #${config.colorScheme.colors.base00};
}
#custom-spotifytitle {
background: #1db954;
color: #191414;
opacity: 1;
transition-property: opacity;
transition-duration: 0.25s;
}
#custom-spotifytitle.Paused,
#custom-spotifytitle.Stopped,
#custom-spotifytitle.Inactive {
opacity: 0.5;
}
#battery {
background-color: #${config.colorScheme.colors.base02};
color: #${config.colorScheme.colors.base05};

View file

@ -69,6 +69,11 @@
# })
];
services.kdeconnect = {
enable = true;
indicator = true;
};
xdg.mimeApps = {
enable = true;
defaultApplications =