Sat 6 Jul 13:21:49 CEST 2024

This commit is contained in:
Thomas Avé 2024-07-06 13:21:49 +02:00
parent e65bb2e5af
commit d966639a71
5 changed files with 154 additions and 153 deletions

View File

@ -23,13 +23,4 @@
]; ];
input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win"; 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;
}
'';
} }

View File

@ -1,4 +1,4 @@
{ inputs, pkgs, config, ... }: { inputs, pkgs, ... }:
{ {
imports = [ inputs.ags.homeManagerModules.default ]; imports = [ inputs.ags.homeManagerModules.default ];
home.packages = [ home.packages = [
@ -7,149 +7,11 @@
]; ];
programs.ags = { programs.ags = {
enable = true; enable = true;
configDir = ./files;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
gtksourceview gtksourceview
webkitgtk webkitgtk
accountsservice 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;
}
'';
} }

View File

@ -7,10 +7,12 @@ import { NotificationPopups } from "./notificationPopups.js"
const battery = await Service.import('battery') const battery = await Service.import('battery')
const powerProfiles = await Service.import('powerprofiles') 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({ const batteryIndicator = Widget.Box({
children: settings["enable-battery"]? [ visible: battery.available,
children: battery.available? [
Widget.Icon().hook(battery, self => { Widget.Icon().hook(battery, self => {
const thresholds = [...Array(11).keys()].map( i => i * 10); const thresholds = [...Array(11).keys()].map( i => i * 10);
const icon = thresholds.find(threshold => threshold >= battery.percent) const icon = thresholds.find(threshold => threshold >= battery.percent)
@ -203,7 +205,11 @@ function Right() {
}), }),
Widget.Label({ Widget.Label({
class_name: "item blue", 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({ Widget.Label({
class_name: "item", class_name: "item",
@ -224,6 +230,7 @@ function Bar(monitor = 0) {
monitor, monitor,
anchor: ["top", "left", "right"], anchor: ["top", "left", "right"],
exclusivity: "exclusive", exclusivity: "exclusive",
css: "font-size: " + hyprland.monitors[monitor]["width"] > 1920? "1.2em;": "1em",
child: Widget.CenterBox({ child: Widget.CenterBox({
class_name: "window-box", class_name: "window-box",
start_widget: Left(), start_widget: Left(),
@ -237,9 +244,12 @@ App.config({
style: "./style.css", style: "./style.css",
iconTheme: "Papirus", iconTheme: "Papirus",
windows: [ windows: [
Bar(0), Bar(),
NotificationPopups(), NotificationPopups(),
], ],
}) })
// window.bar {
// font-size: 1.2em;
// }
export { } export { }

128
home/ags/files/style.css Normal file
View File

@ -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;
}

View File

@ -10,6 +10,7 @@
boot.blacklistedKernelModules = [ "k10temp" ]; boot.blacklistedKernelModules = [ "k10temp" ];
boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ]; boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ];
boot.kernelModules = [ "zenpower amd_pstate=active" ]; boot.kernelModules = [ "zenpower amd_pstate=active" ];
boot.kernelParams = ["amd_pstate=active"];
# AMD CPU & GPU # AMD CPU & GPU
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
@ -39,4 +40,13 @@
}; };
}; };
programs.gnupg.agent.enable = true; programs.gnupg.agent.enable = true;
networking.wireless.iwd.enable = true;
networking.wireless.iwd.settings = {
IPv6 = {
Enabled = true;
};
Settings = {
AutoConnect = true;
};
};
} }