From eddf7cecb8773b81c43e816438f5289151f155cc Mon Sep 17 00:00:00 2001 From: Lilith Date: Wed, 12 Jun 2024 23:12:19 +0200 Subject: [PATCH] ags --- home/ags/config.js | 2 +- home/ags/default.nix | 14 ++++++++++++-- home/ags/modules/bar.js | 23 ++++++++++++++++++++--- home/ags/style.css | 41 +++++++++++++++++++++++++++++++++++++++++ home/default.nix | 4 ++-- home/waybar/default.nix | 4 ++-- 6 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 home/ags/style.css diff --git a/home/ags/config.js b/home/ags/config.js index 1b8fa917..a3916f62 100644 --- a/home/ags/config.js +++ b/home/ags/config.js @@ -1,4 +1,4 @@ -import Bar from modules/bar +import {Bar} from './modules/bar.js' App.config({ style: "./style.css", diff --git a/home/ags/default.nix b/home/ags/default.nix index 8b9da7ef..bffb8c20 100644 --- a/home/ags/default.nix +++ b/home/ags/default.nix @@ -1,7 +1,7 @@ { - pkgs, ... + pkgs, ags, ... }: { - imports = [ inputs.ags.homeManagerModules.default ]; + imports = [ ags.homeManagerModules.default ]; programs.ags = { enable = true; @@ -14,6 +14,16 @@ gtksourceview webkitgtk accountsservice + pavucontrol + networkmanager + gtk3 + wf-recorder + wl-clipboard + brightnessctl + fzf + fd + dart-sass + bun ]; }; } diff --git a/home/ags/modules/bar.js b/home/ags/modules/bar.js index 4035fb37..08f763c1 100644 --- a/home/ags/modules/bar.js +++ b/home/ags/modules/bar.js @@ -6,7 +6,7 @@ const battery = await Service.import("battery") const systemtray = await Service.import("systemtray") const date = Variable("", { - poll: [1000, 'date "+%H:%M:%S %b %e."'], + poll: [1000, 'date "+%a, %Y-%m-%d %H:%M:%S"'], }) // widgets can be only assigned as a child in one container @@ -16,9 +16,11 @@ const date = Variable("", { function Workspaces() { const activeId = hyprland.active.workspace.bind("id") const workspaces = hyprland.bind("workspaces") - .as(ws => ws.map(({ id }) => Widget.Button({ + .as(ws => ws + .filter(({ id }) => id > 0) + .map(({ id, name }) => Widget.Button({ on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), - child: Widget.Label(`${id}`), + child: Widget.Label(`${name}`), class_name: activeId.as(i => `${i === id ? "focused" : ""}`), }))) @@ -189,3 +191,18 @@ function Right() { ], }) } + +export function Bar(monitor = 0) { + return Widget.Window({ + name: `bar-${monitor}`, // name has to be unique + class_name: "bar", + monitor, + anchor: ["top", "left", "right"], + exclusivity: "exclusive", + child: Widget.CenterBox({ + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), + }) +} diff --git a/home/ags/style.css b/home/ags/style.css new file mode 100644 index 00000000..0fe4da7d --- /dev/null +++ b/home/ags/style.css @@ -0,0 +1,41 @@ +window.bar { + /* background-color: @theme_bg_color; */ + color: @theme_fg_color; + /* height: 5%; */ +} + +button { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + background-color: transparent; +} + +button:active { + background-color: @theme_selected_bg_color; +} + +button:hover { + border-bottom: 3px solid @theme_fg_color; +} + +/* label { */ + /* font-weight: bold; */ +/* } */ + +.workspaces button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + +.client-title { + color: @theme_selected_bg_color; +} + +.notification { + color: yellow; +} + +levelbar block, +highlight { + min-height: 10px; +} diff --git a/home/default.nix b/home/default.nix index 75092457..5a488e92 100644 --- a/home/default.nix +++ b/home/default.nix @@ -2,8 +2,8 @@ user = [ # Graphical setup - # ./ags # ToDo: get codin :3 - ./waybar.nix + ./ags # ToDo: get codin :3 + # ./waybar ./hyprland ./rofi.nix ./dunst.nix diff --git a/home/waybar/default.nix b/home/waybar/default.nix index ccdfff30..28ef2a43 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -70,7 +70,7 @@ tooltip = false; }; - "battery" = { + battery = { states = { good = 90; warning = 30; @@ -83,7 +83,7 @@ format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; }; - "tray": { + tray = { "icon-size" = 18; "spacing" = 18; };