Fri 5 Jul 22:46:16 CEST 2024

This commit is contained in:
Thomas Avé 2024-07-05 22:46:16 +02:00
parent 96b62caffd
commit a4c80201af
6 changed files with 147 additions and 146 deletions

View File

@ -37,12 +37,6 @@
];
general.gaps_out = 1;
};
programs.waybar.settings.mainBar = {
output = "eDP-1";
height = 28;
margin = "0 0 5 0";
"custom/temperature".exec = "${pkgs.lm_sensors}/bin/sensors | ${pkgs.gnugrep}/bin/grep Package | cut -c17-23";
};
programs.alacritty.settings.font.size = 13;
}

View File

@ -15,10 +15,6 @@
];
};
};
programs.waybar.settings.mainBar = {
output = "DP-2";
"custom/temperature".exec = "sensors | grep Tctl | cut -c16-22";
};
wayland.windowManager.hyprland.settings = {
monitor = [
"DP-3,preferred,0x550,1"
@ -27,26 +23,130 @@
];
input.kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win";
};
programs.waybar.style = ''
* {
font-size: 18px;
font-weight:400;
home.file."${config.xdg.configHome}/ags/settings.json".text = builtins.toJSON {
temperature-cmd = "bash -c 'sensors | grep Tctl | cut -c16-22'";
};
home.file."${config.xdg.configHome}/ags/style.css".text = ''
window.bar {
background-color: rgba(0, 0, 0, 0.2);
font-size: 1.3em;
}
#tray {
padding: 0 14px;
margin-left:4px;
margin-right:4px;
margin-top:2px;
margin-bottom:2px;
.systray-item {
margin-left: 0.3em;
margin-right: 0.3em;
}
#workspaces {
margin: 4px 9px;
.systray {
margin-left: 0.4em;
}
#wireplumber {
background-color: #023269;
.window-box {
margin-bottom: 0.3em;
margin-top: 0.2em;
}
#tray {
.clients box {
margin-right: 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

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }:
{ inputs, pkgs, config, ... }:
{
imports = [ inputs.ags.homeManagerModules.default ];
home.packages = [
@ -7,11 +7,17 @@
];
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 Tctl | cut -c16-22'";
});
}

View File

@ -1,10 +1,11 @@
const hyprland = await Service.import("hyprland")
const audio = await Service.import("audio")
const battery = await Service.import("battery")
const systemtray = await Service.import("systemtray")
import { getIconName } from "./utils.js"
import { NotificationPopups } from "./notificationPopups.js"
const settings = JSON.parse(Utils.readFile(App.configDir + '/settings.json'))
const volumeIndicator = Widget.Button({
on_clicked: () => audio.speaker.is_muted = !audio.speaker.is_muted,
class_name: "item blue",
@ -90,12 +91,12 @@ function SysTray() {
.as(items => items.map(item => Widget.Button({
child: Widget.Icon({
icon: item.bind("icon"),
css: "margin-left: 0.3em;margin-right: 0.3em;"
class_name: "systray-item",
}),
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event),
tooltip_markup: item.bind("tooltip_markup"),
css: "margin-left: 0.4em;",
class_name: "systray",
})))
return Widget.Box({
@ -121,6 +122,8 @@ function Center() {
})
}
const divide = ([total, free]) => free / total
function Right() {
return Widget.Box({
hpack: "end",
@ -131,7 +134,12 @@ function Right() {
volumeIndicator,
Widget.Label({
class_name: "item",
label: Variable("", { poll: [5000, 'bash -c "top -bn1 | grep \\"Cpu(s)\\" | sed \\"s/.*, *\\([0-9.]*\\)%* id.*/\\\\1/\\" | awk \'{print \\"CPU \\" 100 - \\$1 \\"%\\"}\'"'] }).bind(),
label: Variable("", {
poll: [2000, 'top -b -n 1', out => "CPU " + out.split('\n')
.find(line => line.includes('Cpu(s)'))
.split(/\s+/)[1]
.replace(',', '.').toString() + "%"],
}).bind()
}),
Widget.Label({
class_name: "item blue",
@ -139,11 +147,16 @@ function Right() {
}),
Widget.Label({
class_name: "item",
label: Variable("", { poll: [5000, 'bash -c \'free -m | awk \'\\\'\'/^Mem/ {printf "%.2f GB\\n", $3/1024}\'\\\''] }).bind(),
label: Variable("", {
poll: [2000, 'free', out => (divide(out.split('\n')
.find(line => line.includes('Mem:'))
.split(/\s+/)
.splice(1, 2)) * 100).toFixed(2) + "GB"],
}).bind(),
}),
Widget.Label({
class_name: "item blue",
label: Variable("", { poll: [5000, 'bash -c "sensors | grep Tctl | cut -c16-22"'] }).bind(),
label: Variable("", { poll: [5000, settings["temperature-cmd"] ] }).bind(),
}),
Widget.Label({
class_name: "item",

View File

@ -1,112 +0,0 @@
window.bar {
background-color: rgba(0, 0, 0, 0.2);
font-size: 1.3em;
}
.window-box {
margin-bottom: 0.3em;
margin-top: 0.2em;
}
.clients box {
margin-right: 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

@ -3,7 +3,7 @@
imports = [
(import ./common.nix { inherit inputs config pkgs; })
(import ../hyprland { inherit inputs pkgs; })
(import ../ags { inherit inputs pkgs; })
(import ../ags { inherit inputs config pkgs; })
../rofi
../alacritty
../kitty