waybar refactoring
parent
a465cda40d
commit
1959d85536
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
MAC=94:DB:56:79:7D:86
|
||||||
|
bluetoothctl info "$MAC" | grep -q 'Connected: yes' &&
|
||||||
|
bluetoothctl disconnect "$MAC" || bluetoothctl connect "$MAC"
|
|
@ -1,39 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
cfg = config.services.arbtt;
|
|
||||||
|
|
||||||
in {
|
|
||||||
|
|
||||||
options.services.arbtt = {
|
|
||||||
enable = mkEnableOption "arbtt";
|
|
||||||
|
|
||||||
package = mkOption { type = types.package; default = pkgs.haskellPackages.arbtt; };
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
systemd.user.services.arbtt = {
|
|
||||||
Unit = {
|
|
||||||
Description = "arbtt";
|
|
||||||
After = [ "graphical-session-pre.target" ];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Service = {
|
|
||||||
ExecStart = ''
|
|
||||||
${cfg.package}/bin/arbtt-capture
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
|
@ -17,11 +17,15 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# TODO: waybar module from home-manager
|
# TODO: waybar module from home-manager
|
||||||
xdg.configFile."waybar" = {
|
xdg.configFile."waybar/config" = {
|
||||||
source = ./waybar;
|
text = builtins.toJSON (builtins.fromTOML (builtins.readFile ./waybar.toml));
|
||||||
recursive = true;
|
|
||||||
onChange = "systemctl --user restart waybar";
|
onChange = "systemctl --user restart waybar";
|
||||||
};
|
};
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
style = ./waybar.css;
|
||||||
|
systemd.enable = true;
|
||||||
|
};
|
||||||
programs.mako.enable = true;
|
programs.mako.enable = true;
|
||||||
services = {
|
services = {
|
||||||
gpg-agent.extraConfig = ''
|
gpg-agent.extraConfig = ''
|
||||||
|
@ -160,22 +164,6 @@ in
|
||||||
XDG_CURRENT_DESKTOP = "sway";
|
XDG_CURRENT_DESKTOP = "sway";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.waybar = {
|
|
||||||
Unit = {
|
|
||||||
Description = "waybar";
|
|
||||||
After = [ "graphical-session-pre.target" ];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
||||||
|
|
||||||
Service = {
|
|
||||||
ExecStart = ''
|
|
||||||
${pkgs.waybar}/bin/waybar
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.gebaard = {
|
systemd.user.services.gebaard = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "gebaard";
|
Description = "gebaard";
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
HOME = "/build";
|
HOME = "/build";
|
||||||
} "${pkgs.thefuck}/bin/thefuck -a > $out";
|
} "${pkgs.thefuck}/bin/thefuck -a > $out";
|
||||||
in {
|
in {
|
||||||
imports = [ ./arbtt.nix ./desktop.nix ];
|
imports = [ ./desktop.nix ];
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
inherit (import /home/yorick/dotfiles/config.nix) overlays;
|
inherit (import /home/yorick/dotfiles/config.nix) overlays;
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
layer = "top"
|
||||||
|
height = 26
|
||||||
|
modules-left = [ "sway/workspaces", "sway/mode", "custom/spotify" ]
|
||||||
|
modules-center = [ "sway/window" ]
|
||||||
|
modules-right = [ "pulseaudio", "network", "disk", "battery", "clock", "tray" ]
|
||||||
|
|
||||||
|
["sway/workspaces"]
|
||||||
|
all-outputs = false
|
||||||
|
format = "{icon} {name}"
|
||||||
|
|
||||||
|
["sway/workspaces".format-icons]
|
||||||
|
1 = ""
|
||||||
|
2 = "#"
|
||||||
|
3 = ""
|
||||||
|
4 = ""
|
||||||
|
5 = ""
|
||||||
|
6 = ""
|
||||||
|
7 = ""
|
||||||
|
urgent = ""
|
||||||
|
focused = ""
|
||||||
|
default = ""
|
||||||
|
|
||||||
|
["sway/mode"]
|
||||||
|
format = '<span style="italic">{}</span>'
|
||||||
|
|
||||||
|
[tray]
|
||||||
|
spacing = 10
|
||||||
|
|
||||||
|
[clock]
|
||||||
|
format = "{:%Y-%m-%d %H:%M}"
|
||||||
|
on-click = "xdg-open https://calendar.google.com"
|
||||||
|
|
||||||
|
[disk]
|
||||||
|
format = "{free} "
|
||||||
|
|
||||||
|
[battery]
|
||||||
|
format = "{capacity}% {icon}"
|
||||||
|
format-icons = [ "", "", "", "", "" ]
|
||||||
|
|
||||||
|
[battery.states]
|
||||||
|
warning = 30
|
||||||
|
critical = 15
|
||||||
|
|
||||||
|
[network]
|
||||||
|
format-wifi = "{essid} "
|
||||||
|
format-ethernet = "{ifname} "
|
||||||
|
format-disconnected = "Disconnected ⚠"
|
||||||
|
tooltip-format = "{ipaddr}"
|
||||||
|
|
||||||
|
[pulseaudio]
|
||||||
|
scroll-step = 5
|
||||||
|
format = "{volume}% {icon}"
|
||||||
|
format-bluetooth = "{volume}% {icon}"
|
||||||
|
format-muted = ""
|
||||||
|
on-click = "pkill pavucontrol; pavucontrol"
|
||||||
|
# toggle headphones
|
||||||
|
on-click-right = "~/dotfiles/bin/btoggle.sh"
|
||||||
|
|
||||||
|
[pulseaudio.format-icons]
|
||||||
|
headphones = ""
|
||||||
|
handsfree = ""
|
||||||
|
headset = ""
|
||||||
|
phone = ""
|
||||||
|
portable = ""
|
||||||
|
car = ""
|
||||||
|
default = [ "", "" ]
|
||||||
|
|
||||||
|
["custom/spotify"]
|
||||||
|
format = " {}"
|
||||||
|
escape = true
|
||||||
|
max-length = 40
|
||||||
|
on-click = "playerctl play-pause"
|
||||||
|
exec = "$HOME/dotfiles/bin/spotify_meta.sh 2> /dev/null"
|
|
@ -1,86 +0,0 @@
|
||||||
{
|
|
||||||
"layer": "top", // Waybar at top layer
|
|
||||||
// "position": "bottom", // Waybar at the bottom of your screen
|
|
||||||
"height": 26, // Waybar height
|
|
||||||
// "width": 1280, // Waybar width
|
|
||||||
// Choose the order of the modules
|
|
||||||
"modules-left": ["sway/workspaces", "sway/mode", "custom/spotify"],
|
|
||||||
"modules-center": ["sway/window"],
|
|
||||||
"modules-right": ["pulseaudio", "network", "disk", "battery", "clock", "tray"],
|
|
||||||
// Modules configuration
|
|
||||||
"sway/workspaces": {
|
|
||||||
"all-outputs": false,
|
|
||||||
"format": "{icon} {name}",
|
|
||||||
"format-icons": {
|
|
||||||
"1": "",
|
|
||||||
"2": "#",
|
|
||||||
"3": "",
|
|
||||||
"4": "",
|
|
||||||
"5": "",
|
|
||||||
"6": "",
|
|
||||||
"7": "",
|
|
||||||
"urgent": "",
|
|
||||||
"focused": "",
|
|
||||||
"default": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sway/mode": {
|
|
||||||
"format": "<span style=\"italic\">{}</span>"
|
|
||||||
},
|
|
||||||
"tray": {
|
|
||||||
// "icon-size": 21,
|
|
||||||
"spacing": 10
|
|
||||||
},
|
|
||||||
"clock": {
|
|
||||||
"format-alt": "{:%Y-%m-%d}"
|
|
||||||
},
|
|
||||||
"cpu": {
|
|
||||||
"format": "{load}% "
|
|
||||||
},
|
|
||||||
"memory": {
|
|
||||||
"format": "{}% "
|
|
||||||
},
|
|
||||||
"disk": {
|
|
||||||
"format": "{free} "
|
|
||||||
},
|
|
||||||
"battery": {
|
|
||||||
"states": {
|
|
||||||
// "good": 95,
|
|
||||||
"warning": 30,
|
|
||||||
"critical": 15
|
|
||||||
},
|
|
||||||
"format": "{capacity}% {icon}",
|
|
||||||
// "format-good": "", // An empty format will hide the module
|
|
||||||
// "format-full": "",
|
|
||||||
"format-icons": ["", "", "", "", ""]
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
//"interface": "wlp58s0", // (Optional) To force the use of this interface
|
|
||||||
"format-wifi": "{essid} ",
|
|
||||||
"format-ethernet": "{ifname} ",
|
|
||||||
"format-disconnected": "Disconnected ⚠"
|
|
||||||
},
|
|
||||||
"pulseaudio": {
|
|
||||||
"scroll-step": 5,
|
|
||||||
"format": "{volume}% {icon}",
|
|
||||||
"format-bluetooth": "{volume}% {icon}",
|
|
||||||
"format-muted": "",
|
|
||||||
"format-icons": {
|
|
||||||
"headphones": "",
|
|
||||||
"handsfree": "",
|
|
||||||
"headset": "",
|
|
||||||
"phone": "",
|
|
||||||
"portable": "",
|
|
||||||
"car": "",
|
|
||||||
"default": ["", ""]
|
|
||||||
},
|
|
||||||
"on-click": "pavucontrol"
|
|
||||||
},
|
|
||||||
"custom/spotify": {
|
|
||||||
"format": " {}",
|
|
||||||
"escape": true,
|
|
||||||
"max-length": 40,
|
|
||||||
"on-click": "playerctl play-pause",
|
|
||||||
"exec": "$HOME/dotfiles/bin/spotify_meta.sh 2> /dev/null" // Script in resources folder
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue