From ee901946e2f4c234f13570b14ed12a67fe24de76 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Tue, 18 Jun 2024 21:06:19 +0200 Subject: [PATCH] more bar --- modules/desktop-environment/default.nix | 3 + .../desktop-environment/home/sway/default.nix | 109 +++++++++++++++++- 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/modules/desktop-environment/default.nix b/modules/desktop-environment/default.nix index 3e149b8..59206a0 100644 --- a/modules/desktop-environment/default.nix +++ b/modules/desktop-environment/default.nix @@ -4,4 +4,7 @@ ./flatpak.nix ./home ]; + services.upower = { + enable = true; + }; } diff --git a/modules/desktop-environment/home/sway/default.nix b/modules/desktop-environment/home/sway/default.nix index 0aafe8e..7159b7c 100644 --- a/modules/desktop-environment/home/sway/default.nix +++ b/modules/desktop-environment/home/sway/default.nix @@ -7,6 +7,108 @@ programs.wofi.enable = true; programs.swaylock.enable = true; + programs.waybar = { + enable = true; + systemd = { + enable = true; + target = "sway-session.target"; + }; + settings = { + infobar = { + layer = "top"; + position = "top"; + modules-left = ["memory" "cpu" "network" "group/bats"]; + modules-center = ["sway/window"]; + modules-right = ["clock"]; + "group/bats" = { + orientation = "inherit"; + modules = ["battery#bat0" "battery#bat1" "upower#headphones"]; + }; + "battery#bat0" = { + adapter = "AC"; + bat = "BAT0"; + interval = 2; + format = "{icon} {capacity}% {time}"; + format-charging = "󱐋 {icon} {capacity}% {time}"; + format-time = "{h}:{m}"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip = true; + tooltip-format = "BAT0: {cycles} cycles"; + }; + "battery#bat1" = { + adapter = "AC"; + bat = "BAT1"; + interval = 2; + format = "󱐋 {icon} {capacity}% {time}"; + format-time = "{H}:{M}"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip = true; + tooltip-format = "BAT1: {cycles} cycles"; + }; + "upower#headphones" = { + native-path = "/org/bluez/hci0/dev_4C_87_5D_29_B3_76"; + format = "󰋋 {percentage} {time}"; + hide-if-empty = true; + show-icon = false; + }; + }; + interactiveBar = { + layer = "top"; + position = "bottom"; + modules-left = ["sway/workspaces" "sway/mode"]; + modules-center = ["tray"]; + modules-right = ["wlr/taskbar"]; + }; + # mainBar = { + # layer = "top"; + # position = "top"; + # height = 30; + # output = [ + # "eDP-1" + # "HDMI-A-1" + # ]; + # modules-left = ["sway/workspaces" "sway/mode" "wlr/taskbar"]; + # modules-center = ["sway/window" "custom/hello-from-waybar"]; + # modules-right = ["mpd" "custom/mymodule#with-css-id" "temperature"]; + + # "sway/workspaces" = { + # disable-scroll = true; + # all-outputs = true; + # }; + # "custom/hello-from-waybar" = { + # format = "hello {}"; + # max-length = 40; + # interval = "once"; + # exec = pkgs.writeShellScript "hello-from-waybar" '' + # echo "from within waybar" + # ''; + # }; + # }; + }; + }; + wayland.windowManager.sway = { enable = true; systemd = { @@ -43,6 +145,7 @@ xkb_variant = "altgr-intl"; }; }; + bars = []; menu = "wofi -d"; modifier = "Mod4"; keybindings = with { @@ -73,8 +176,8 @@ # "${mod}+Shift+c" = "focus child"; # screenshot # "${mod}+w" = "exec window-screenshot.sh"; - # "${mod}+s" = "exec flameshot gui -c -p $HOME/Pictures/screenshots"; - # "${mod}+a" = "exec flameshot screen -c -p $HOME/Pictures/screenshots"; + "${mod}+s" = "exec flameshot gui -c -p $HOME/Pictures/screenshots"; + "${mod}+a" = "exec flameshot screen -c -p $HOME/Pictures/screenshots"; # "${mod}+t" = "exec ocr-screenshot.sh"; # rofi fuckery @@ -169,7 +272,7 @@ window = { border = 2; - titlebar = true; + titlebar = false; }; }; };