From d966639a715d47261636423fd2927469d893cca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 6 Jul 2024 13:21:49 +0200 Subject: [PATCH] Sat 6 Jul 13:21:49 CEST 2024 --- home/Kell.nix | 9 --- home/ags/default.nix | 142 +-------------------------------------- home/ags/files/config.js | 18 +++-- home/ags/files/style.css | 128 +++++++++++++++++++++++++++++++++++ hosts/Kell/default.nix | 10 +++ 5 files changed, 154 insertions(+), 153 deletions(-) create mode 100644 home/ags/files/style.css diff --git a/home/Kell.nix b/home/Kell.nix index 8b1dd89..5b609b0 100644 --- a/home/Kell.nix +++ b/home/Kell.nix @@ -23,13 +23,4 @@ ]; input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; }; - home.file."${config.xdg.configHome}/ags/settings.json".text = builtins.toJSON { - temperature-cmd = "bash -c 'sensors | grep Tctl | cut -c16-22'"; - enable-battery = false; - }; - home.file."${config.xdg.configHome}/ags/style.css".text = pkgs.lib.mkAfter '' - window.bar { - font-size: 1.2em; - } - ''; } diff --git a/home/ags/default.nix b/home/ags/default.nix index 2f8212f..e4724be 100644 --- a/home/ags/default.nix +++ b/home/ags/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, config, ... }: +{ inputs, pkgs, ... }: { imports = [ inputs.ags.homeManagerModules.default ]; home.packages = [ @@ -7,149 +7,11 @@ ]; programs.ags = { enable = true; + configDir = ./files; extraPackages = with pkgs; [ gtksourceview webkitgtk accountsservice ]; }; - home.file."${config.xdg.configHome}/ags" = { - source = ./files; - recursive = true; - }; - home.file."${config.xdg.configHome}/ags/settings.json".text = pkgs.lib.mkDefault (builtins.toJSON { - temperature-cmd = "bash -c 'sensors | grep Package | cut -c17-23'"; - enable-battery = true; - }); - home.file."${config.xdg.configHome}/ags/style.css".text = '' - window.bar { - background-color: rgba(0, 0, 0, 0.2); - font-size: 1em; - font-family: "Noto Sans", "FontAwesome"; - } - - .systray-item { - margin-left: 0.4em; - margin-right: 0.4em; - } - - .systray { - margin-left: 0.6em; - } - - .window-box { - margin-bottom: 0.3em; - margin-top: 0.2em; - } - - .clients box { - margin-right: 0.3em; - } - - .battery-item { - padding-left: 0.6em; - padding-right: 0.6em; - border-radius: 0.3em; - background: #1f2430; - } - - .item, .clients box { - background: #1f2430; - padding-left: 0.7em; - padding-right: 0.7em; - border-radius: 0.3em; - } - - .app-icon { - margin-right: 0.6em; - } - - button { - background: #1f2430; - border:none; - padding: 0.2em; - border-radius: 0.3em; - } - - .focused, .clients box.focused { - background: #023269; - } - - button:hover { - background: #023269; - } - - .workspaces button { - padding-left: 0.4em; - padding-right: 0.4em; - margin-left: 0.2em; - margin-right: 0.2em; - } - - .notification { - color: yellow; - } - - .blue { - background: #023269; - } - - /* Notifications */ - window.notification-popups box.notifications { - padding: .5em; - } - - .icon { - min-width: 68px; - min-height: 68px; - margin-right: 1em; - } - - .icon image { - font-size: 58px; - /* to center the icon */ - margin: 5px; - color: @theme_fg_color; - } - - .icon box { - min-width: 68px; - min-height: 68px; - border-radius: 7px; - } - - .notification { - min-width: 350px; - border-radius: 11px; - padding: 1em; - margin: .5em; - background-color: #1f2430; - } - - .notification.critical { - border: 1px solid lightcoral; - } - - .title { - color: @theme_fg_color; - font-size: 1.4em; - } - - .body { - color: @theme_unfocused_fg_color; - } - - .actions .action-button { - margin: 0 .4em; - margin-top: .8em; - } - - .actions .action-button:first-child { - margin-left: 0; - } - - .actions .action-button:last-child { - margin-right: 0; - } - ''; } diff --git a/home/ags/files/config.js b/home/ags/files/config.js index 28d03e7..d88069e 100644 --- a/home/ags/files/config.js +++ b/home/ags/files/config.js @@ -7,10 +7,12 @@ import { NotificationPopups } from "./notificationPopups.js" const battery = await Service.import('battery') const powerProfiles = await Service.import('powerprofiles') -const settings = JSON.parse(Utils.readFile(App.configDir + '/settings.json')) + // temperature-cmd = "bash -c 'sensors | grep Tctl | cut -c16-22'"; + // temperature-cmd = "bash -c 'sensors | grep Package | cut -c17-23'"; const batteryIndicator = Widget.Box({ - children: settings["enable-battery"]? [ + visible: battery.available, + children: battery.available? [ Widget.Icon().hook(battery, self => { const thresholds = [...Array(11).keys()].map( i => i * 10); const icon = thresholds.find(threshold => threshold >= battery.percent) @@ -203,7 +205,11 @@ function Right() { }), Widget.Label({ class_name: "item blue", - label: Variable("", { poll: [5000, settings["temperature-cmd"] ] }).bind(), + label: Variable("", { + poll: [5000, 'sensors', out => out.split('\n') + .find(line => line.includes('Tctl') || line.includes('Package')) + .split(/\s+/)[1].replace("+", "")], + }).bind(), }), Widget.Label({ class_name: "item", @@ -224,6 +230,7 @@ function Bar(monitor = 0) { monitor, anchor: ["top", "left", "right"], exclusivity: "exclusive", + css: "font-size: " + hyprland.monitors[monitor]["width"] > 1920? "1.2em;": "1em", child: Widget.CenterBox({ class_name: "window-box", start_widget: Left(), @@ -237,9 +244,12 @@ App.config({ style: "./style.css", iconTheme: "Papirus", windows: [ - Bar(0), + Bar(), NotificationPopups(), ], }) + // window.bar { + // font-size: 1.2em; + // } export { } diff --git a/home/ags/files/style.css b/home/ags/files/style.css new file mode 100644 index 0000000..7b92842 --- /dev/null +++ b/home/ags/files/style.css @@ -0,0 +1,128 @@ +window.bar { + background-color: rgba(0, 0, 0, 0.2); + font-family: "Noto Sans", "FontAwesome"; +} + +.systray-item { + margin-left: 0.4em; + margin-right: 0.4em; +} + +.systray { + margin-left: 0.6em; +} + +.window-box { + margin-bottom: 0.3em; + margin-top: 0.2em; +} + +.clients box { + margin-right: 0.3em; +} + +.battery-item { + padding-left: 0.6em; + padding-right: 0.6em; + margin-right: 0.6em; + border-radius: 0.3em; +} + +.item, .clients box { + background: #1f2430; + padding-left: 0.7em; + padding-right: 0.7em; + border-radius: 0.3em; +} + +.app-icon { + margin-right: 0.6em; +} + +button { + background: #1f2430; + border:none; + padding: 0.2em; + border-radius: 0.3em; +} + +.focused, .clients box.focused { + background: #023269; +} + +button:hover { + background: #023269; +} + +.workspaces button { + padding-left: 0.4em; + padding-right: 0.4em; + margin-left: 0.2em; + margin-right: 0.2em; +} + +.notification { + color: yellow; +} + +.blue { + background: #023269; +} + +/* Notifications */ +window.notification-popups box.notifications { + padding: .5em; +} + +.icon { + min-width: 68px; + min-height: 68px; + margin-right: 1em; +} + +.icon image { + font-size: 58px; + /* to center the icon */ + margin: 5px; + color: @theme_fg_color; +} + +.icon box { + min-width: 68px; + min-height: 68px; + border-radius: 7px; +} + +.notification { + min-width: 350px; + border-radius: 11px; + padding: 1em; + margin: .5em; + background-color: #1f2430; +} + +.notification.critical { + border: 1px solid lightcoral; +} + +.title { + color: @theme_fg_color; + font-size: 1.4em; +} + +.body { + color: @theme_unfocused_fg_color; +} + +.actions .action-button { + margin: 0 .4em; + margin-top: .8em; +} + +.actions .action-button:first-child { + margin-left: 0; +} + +.actions .action-button:last-child { + margin-right: 0; +} diff --git a/hosts/Kell/default.nix b/hosts/Kell/default.nix index cf94887..c23986b 100644 --- a/hosts/Kell/default.nix +++ b/hosts/Kell/default.nix @@ -10,6 +10,7 @@ boot.blacklistedKernelModules = [ "k10temp" ]; boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ]; boot.kernelModules = [ "zenpower amd_pstate=active" ]; + boot.kernelParams = ["amd_pstate=active"]; # AMD CPU & GPU boot.initrd.kernelModules = [ "amdgpu" ]; @@ -39,4 +40,13 @@ }; }; programs.gnupg.agent.enable = true; + networking.wireless.iwd.enable = true; + networking.wireless.iwd.settings = { + IPv6 = { + Enabled = true; + }; + Settings = { + AutoConnect = true; + }; + }; }