From d6c181bc5b8f9ceade840e76c1a1bc6aff821980 Mon Sep 17 00:00:00 2001 From: zackartz Date: Sun, 28 Apr 2024 20:50:20 -0400 Subject: [PATCH] 495 current 2024-04-28 20:50:10 24.05.20240428.30ddacc 6.8.6-zen1 * --- flake.lock | 51 +++- flake.nix | 2 + modules/home-manager/default.nix | 5 +- modules/rice/ags/cfg/config.js | 29 +++ modules/rice/ags/cfg/imports.js | 32 +++ modules/rice/ags/cfg/modules/bar/bar.js | 35 +++ modules/rice/ags/cfg/modules/bar/clock.js | 13 ++ modules/rice/ags/cfg/modules/bar/media.js | 21 ++ .../rice/ags/cfg/modules/bar/notification.js | 20 ++ .../ags/cfg/modules/bar/sysinfo/battery.js | 38 +++ .../ags/cfg/modules/bar/sysinfo/bluetooth.js | 13 ++ .../ags/cfg/modules/bar/sysinfo/network.js | 23 ++ .../ags/cfg/modules/bar/sysinfo/sysinfo.js | 20 ++ .../ags/cfg/modules/bar/sysinfo/volume.js | 25 ++ modules/rice/ags/cfg/modules/bar/title.js | 11 + modules/rice/ags/cfg/modules/bar/tray.js | 15 ++ .../rice/ags/cfg/modules/bar/workspaces.js | 43 ++++ .../ags/cfg/modules/dashboard/bluetooth.js | 52 +++++ .../cfg/modules/dashboard/brightnessSlider.js | 42 ++++ .../ags/cfg/modules/dashboard/calendar.js | 16 ++ .../ags/cfg/modules/dashboard/dashboard.js | 62 +++++ .../ags/cfg/modules/dashboard/iconButtons.js | 21 ++ .../cfg/modules/dashboard/notificationList.js | 117 ++++++++++ .../ags/cfg/modules/dashboard/volumeSlider.js | 60 +++++ .../rice/ags/cfg/modules/dashboard/wifi.js | 52 +++++ modules/rice/ags/cfg/scss/_colors.scss | 1 + modules/rice/ags/cfg/scss/bar/_bar.scss | 11 + modules/rice/ags/cfg/scss/bar/_clock.scss | 8 + modules/rice/ags/cfg/scss/bar/_media.scss | 12 + .../rice/ags/cfg/scss/bar/_notification.scss | 9 + modules/rice/ags/cfg/scss/bar/_sysinfo.scss | 39 ++++ modules/rice/ags/cfg/scss/bar/_title.scss | 13 ++ modules/rice/ags/cfg/scss/bar/_tray.scss | 26 +++ .../rice/ags/cfg/scss/bar/_workspaces.scss | 27 +++ .../rice/ags/cfg/scss/dashboard/_Slider.scss | 31 +++ .../ags/cfg/scss/dashboard/_calendar.scss | 13 ++ .../ags/cfg/scss/dashboard/_dashboard.scss | 9 + .../cfg/scss/dashboard/_notifications.scss | 26 +++ .../ags/cfg/scss/dashboard/_quicktoggles.scss | 37 +++ modules/rice/ags/cfg/scss/main.scss | 14 ++ modules/rice/ags/cfg/services/brightness.js | 49 ++++ modules/rice/ags/cfg/style.css | 219 ++++++++++++++++++ modules/rice/ags/cfg/style.cssyazicd | 219 ++++++++++++++++++ modules/rice/ags/cfg/utils/popupWindow.js | 52 +++++ modules/rice/ags/default.nix | 61 +++++ modules/rice/hyprland/binds.nix | 1 + 46 files changed, 1685 insertions(+), 10 deletions(-) create mode 100644 modules/rice/ags/cfg/config.js create mode 100644 modules/rice/ags/cfg/imports.js create mode 100644 modules/rice/ags/cfg/modules/bar/bar.js create mode 100644 modules/rice/ags/cfg/modules/bar/clock.js create mode 100644 modules/rice/ags/cfg/modules/bar/media.js create mode 100644 modules/rice/ags/cfg/modules/bar/notification.js create mode 100644 modules/rice/ags/cfg/modules/bar/sysinfo/battery.js create mode 100644 modules/rice/ags/cfg/modules/bar/sysinfo/bluetooth.js create mode 100644 modules/rice/ags/cfg/modules/bar/sysinfo/network.js create mode 100644 modules/rice/ags/cfg/modules/bar/sysinfo/sysinfo.js create mode 100644 modules/rice/ags/cfg/modules/bar/sysinfo/volume.js create mode 100644 modules/rice/ags/cfg/modules/bar/title.js create mode 100644 modules/rice/ags/cfg/modules/bar/tray.js create mode 100644 modules/rice/ags/cfg/modules/bar/workspaces.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/bluetooth.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/brightnessSlider.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/calendar.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/dashboard.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/iconButtons.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/notificationList.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/volumeSlider.js create mode 100644 modules/rice/ags/cfg/modules/dashboard/wifi.js create mode 100644 modules/rice/ags/cfg/scss/_colors.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_bar.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_clock.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_media.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_notification.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_sysinfo.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_title.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_tray.scss create mode 100644 modules/rice/ags/cfg/scss/bar/_workspaces.scss create mode 100644 modules/rice/ags/cfg/scss/dashboard/_Slider.scss create mode 100644 modules/rice/ags/cfg/scss/dashboard/_calendar.scss create mode 100644 modules/rice/ags/cfg/scss/dashboard/_dashboard.scss create mode 100644 modules/rice/ags/cfg/scss/dashboard/_notifications.scss create mode 100644 modules/rice/ags/cfg/scss/dashboard/_quicktoggles.scss create mode 100644 modules/rice/ags/cfg/scss/main.scss create mode 100644 modules/rice/ags/cfg/services/brightness.js create mode 100644 modules/rice/ags/cfg/style.css create mode 100644 modules/rice/ags/cfg/style.cssyazicd create mode 100644 modules/rice/ags/cfg/utils/popupWindow.js create mode 100644 modules/rice/ags/default.nix diff --git a/flake.lock b/flake.lock index 834a11b..d3576cf 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "ags": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1713301451, + "narHash": "sha256-LzYVqEukjOJjm4HGFe6rtHBiuJxAyPqd2MY1k5ci9QU=", + "owner": "Aylur", + "repo": "ags", + "rev": "33bcaf34d5277031ecb97047fb8ddd44abd8d80e", + "type": "github" + }, + "original": { + "owner": "Aylur", + "repo": "ags", + "type": "github" + } + }, "catppuccin": { "locked": { "lastModified": 1713895615, @@ -646,16 +664,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706487304, - "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "lastModified": 1708475490, + "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "rev": "0e74ca98a74bc7270d28838369593635a5db3260", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -695,6 +713,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1714290118, "narHash": "sha256-6PzUtOvU7hMQxZV579B04CHE1HXSq/loh9E+d/4fKZY=", @@ -710,7 +744,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -782,6 +816,7 @@ }, "root": { "inputs": { + "ags": "ags", "catppuccin": "catppuccin", "home-manager": "home-manager", "hyprcontrib": "hyprcontrib", @@ -791,7 +826,7 @@ "lanzaboote": "lanzaboote", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "rio-term": "rio-term", "spicetify-nix": "spicetify-nix", "systems": "systems_8", @@ -801,7 +836,7 @@ "rust-overlay": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1709259239, @@ -845,7 +880,7 @@ "rust-overlay_3": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1714011248, diff --git a/flake.nix b/flake.nix index 2bb9edb..3143e7d 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + ags.url = "github:Aylur/ags"; + nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index b9dc9ca..7bc6094 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -12,12 +12,13 @@ in { ./vim/default.nix ./firefox.nix + ../rice/ags ../rice/hyprland # ../rice/sway ../rice/gtk.nix ../rice/kitty.nix - ../rice/waybar - ../rice/dunst.nix + # ../rice/waybar + # ../rice/dunst.nix ../rice/rio.nix ../rice/wofi.nix ../shell diff --git a/modules/rice/ags/cfg/config.js b/modules/rice/ags/cfg/config.js new file mode 100644 index 0000000..6bb3620 --- /dev/null +++ b/modules/rice/ags/cfg/config.js @@ -0,0 +1,29 @@ +import { Utils, App } from "./imports.js"; + +// Windows +import { Bar } from "./modules/bar/bar.js"; +import { Dashboard } from "./modules/dashboard/dashboard.js"; + +// Apply css +const applyScss = () => { + // Compile scss + Utils.exec( + `sassc ${App.configDir}/scss/main.scss ${App.configDir}/style.css`, + ); + console.log("Scss compiled"); + + // Apply compiled css + App.resetCss(); + App.applyCss(`${App.configDir}/style.css`); + console.log("Compiled css applied"); +}; + +// Apply css then check for changes +applyScss(); + + +// Main config +export default { + style: `${App.configDir}/style.css`, + windows: [Bar(), Dashboard() ], +}; diff --git a/modules/rice/ags/cfg/imports.js b/modules/rice/ags/cfg/imports.js new file mode 100644 index 0000000..e7d2e67 --- /dev/null +++ b/modules/rice/ags/cfg/imports.js @@ -0,0 +1,32 @@ +import App from "resource:///com/github/Aylur/ags/app.js"; +import Widget from "resource:///com/github/Aylur/ags/widget.js"; +import Service from "resource:///com/github/Aylur/ags/service.js"; +import Variable from "resource:///com/github/Aylur/ags/variable.js"; +import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; + +import Applications from "resource:///com/github/Aylur/ags/service/applications.js"; +import Audio from "resource:///com/github/Aylur/ags/service/audio.js"; +import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; +import Bluetooth from "resource:///com/github/Aylur/ags/service/bluetooth.js"; +import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js"; +import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js"; +import Network from "resource:///com/github/Aylur/ags/service/network.js"; +import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; +import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js"; + +export { + App, + Widget, + Service, + Variable, + Utils, + Applications, + Audio, + Battery, + Bluetooth, + Hyprland, + Mpris, + Network, + Notifications, + SystemTray, +}; diff --git a/modules/rice/ags/cfg/modules/bar/bar.js b/modules/rice/ags/cfg/modules/bar/bar.js new file mode 100644 index 0000000..1f880d4 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/bar.js @@ -0,0 +1,35 @@ +import { Widget } from "../../imports.js"; +const { Window, Box, CenterBox } = Widget; + +// Widgets +import { Workspaces } from "./workspaces.js"; +import { Title } from "./title.js"; +import { Media } from "./media.js"; +import { Notification } from "./notification.js" +import { SysInfo } from "./sysinfo/sysinfo.js"; +import { sysTray } from "./tray.js"; +import { Clock } from "./clock.js"; + +const Left = () => Box({ + children: [Workspaces(), Title()], +}); +const Center = () => Box({ + children: [Media()], +}); +const Right = () => Box({ + hpack: "end", + children: [Notification(), sysTray(), SysInfo(), Clock()], +}); + +export const Bar = () => Window({ + name: "bar", + anchor: ["top", "right", "left"], + margins: [10, 15, 0], + exclusivity: "exclusive", + child: CenterBox({ + className: "bar", + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), +}); diff --git a/modules/rice/ags/cfg/modules/bar/clock.js b/modules/rice/ags/cfg/modules/bar/clock.js new file mode 100644 index 0000000..fb1607f --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/clock.js @@ -0,0 +1,13 @@ +import { Widget, Utils } from "../../imports.js"; +const { execAsync } = Utils; + +export const Clock = () => Widget.Button({ + className: "clock", + setup: (self) => { + self.poll(1000, (self) => + execAsync(["date", "+%a %b %d %H:%M"]) + .then((time) => (self.label = time)) + .catch(console.error), + ); + }, +}); diff --git a/modules/rice/ags/cfg/modules/bar/media.js b/modules/rice/ags/cfg/modules/bar/media.js new file mode 100644 index 0000000..440d202 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/media.js @@ -0,0 +1,21 @@ +import { Widget, Utils, Mpris } from "../../imports.js"; +const { execAsync } = Utils; + +export const Media = () => Widget.Button({ + class_name: 'media', + on_primary_click: () => Mpris.getPlayer('').playPause(), + onSecondaryClickRelease: () => { + execAsync(['bash', '-c', 'anyrun', '&']); + }, + on_scroll_up: () => Mpris.getPlayer('').next(), + on_scroll_down: () => Mpris.getPlayer('').previous(), + child: Widget.Label('-').hook(Mpris, self => { + if (Mpris.players[0]) { + const { track_title } = Mpris.players[0]; + self.label = track_title.length > 60 ? `${track_title.substring(0, 60)}...` : track_title; + } else { + self.label = 'Nothing is playing'; + } + }, 'player-changed'), +}); + diff --git a/modules/rice/ags/cfg/modules/bar/notification.js b/modules/rice/ags/cfg/modules/bar/notification.js new file mode 100644 index 0000000..f89a827 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/notification.js @@ -0,0 +1,20 @@ +import { Widget, Notifications } from "../../imports.js" + +const { Box } = Widget + +export const Notification = () => Box({ + class_name: 'barNotification', + visible: Notifications.bind('popups').transform(p => p.length > 0), + children: [ + Widget.Label({ + label: '󰍡 ', + }), + Widget.Label({ + label: Notifications.bind('popups').transform(p => { + const summary = p[0]?.summary || ''; + const maxLength = 50; + return summary.length > maxLength ? summary.slice(0, maxLength) + '...' : summary; + }), + }), + ], +}); diff --git a/modules/rice/ags/cfg/modules/bar/sysinfo/battery.js b/modules/rice/ags/cfg/modules/bar/sysinfo/battery.js new file mode 100644 index 0000000..d3777b1 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/sysinfo/battery.js @@ -0,0 +1,38 @@ +import { Widget, Utils, Battery } from "../../../imports.js"; +const { Box } = Widget; + +export const BatteryWidget = () => Box({ + className: "battery", + children: [ + Widget.Label({ + className: "batIcon", + hexpand: true, + setup: (self) => { + self.hook(Battery, (self) => { + const icons = [ + ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], + ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"], + ]; + + self.label = + icons[Battery.charging ? 1 : 0][ + Math.floor(Battery.percent / 10) + ].toString(); + + if (Battery.percent <= 15 && Battery.charging === false) { + self.toggleClassName("low", true); + } else { + self.toggleClassName("low", false); + } + }); + }, + }), + Widget.Label({ + setup: (self) => { + self.hook(Battery, (self) => { + self.label = `${Battery.percent}%`; + }); + }, + }), + ], +}); diff --git a/modules/rice/ags/cfg/modules/bar/sysinfo/bluetooth.js b/modules/rice/ags/cfg/modules/bar/sysinfo/bluetooth.js new file mode 100644 index 0000000..0700bca --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/sysinfo/bluetooth.js @@ -0,0 +1,13 @@ +import { Widget } from "../../../imports.js"; +import { Bluetooth } from "../../../imports.js"; +const { Box } = Widget; + +export const BluetoothWidget = () => Box({ + class_name: 'bluetoothindicator', + children: [ + Widget.Icon({ + icon: Bluetooth.bind('enabled').transform(on => + `bluetooth-${on ? 'active' : 'disabled'}-symbolic`), + }) + ] +}) diff --git a/modules/rice/ags/cfg/modules/bar/sysinfo/network.js b/modules/rice/ags/cfg/modules/bar/sysinfo/network.js new file mode 100644 index 0000000..870d2a2 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/sysinfo/network.js @@ -0,0 +1,23 @@ +import { Network } from "../../../imports.js" +import { Widget } from "../../../imports.js"; + +const WifiIndicator = () => Widget.Box({ + children: [ + Widget.Icon({ + icon: Network.wifi.bind('icon_name'), + }), + ], +}) + +const WiredIndicator = () => Widget.Icon({ + icon: Network.wired.bind('icon_name'), +}) + +export const NetworkWidget = () => Widget.Stack({ + class_name: 'network', + items: [ + ['wifi', WifiIndicator()], + ['wired', WiredIndicator()], + ], + shown: Network.bind('primary').transform(p => p || 'wifi'), +}) diff --git a/modules/rice/ags/cfg/modules/bar/sysinfo/sysinfo.js b/modules/rice/ags/cfg/modules/bar/sysinfo/sysinfo.js new file mode 100644 index 0000000..f11ccd3 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/sysinfo/sysinfo.js @@ -0,0 +1,20 @@ +import { Widget } from "../../../imports.js" +const { Box } = Widget; + +import{ NetworkWidget } from "./network.js" +import{ BluetoothWidget } from "./bluetooth.js" +import{ Volume } from "./volume.js" +import{ BatteryWidget } from "./battery.js" + +export const SysInfo = () => Widget.Button({ + class_name: 'sysinfo', + onClicked: () => App.toggleWindow("dashboard"), + child: Box({ + children: [ + NetworkWidget(), + BluetoothWidget(), + Volume(), + // BatteryWidget(), + ] + }), +}); diff --git a/modules/rice/ags/cfg/modules/bar/sysinfo/volume.js b/modules/rice/ags/cfg/modules/bar/sysinfo/volume.js new file mode 100644 index 0000000..59a378f --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/sysinfo/volume.js @@ -0,0 +1,25 @@ +import { Widget, Audio } from "../../../imports.js"; +const { Box } = Widget; + +export const Volume = () => Box({ + class_name: 'volume', + children: [ + Widget.Icon().hook(Audio, self => { + if (!Audio.speaker) + return; + + const category = { + 101: 'overamplified', + 67: 'high', + 34: 'medium', + 1: 'low', + 0: 'muted', + }; + + const icon = Audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( + threshold => threshold <= Audio.speaker.volume * 100); + + self.icon = `audio-volume-${category[icon]}-symbolic`; + }, 'speaker-changed'), + ], +}); diff --git a/modules/rice/ags/cfg/modules/bar/title.js b/modules/rice/ags/cfg/modules/bar/title.js new file mode 100644 index 0000000..af682e7 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/title.js @@ -0,0 +1,11 @@ +import { Widget, Hyprland, Utils } from "../../imports.js"; +const { execAsync } = Utils; + +export const Title = () => Widget.Button({ + className: 'title', + visible:Hyprland.active.client.bind('title').transform(title => title.length > 0), + label: Hyprland.active.client.bind('title').transform(title => title.length > 40 ? title.substring(0, 40) + '...' : title), + onClicked: () => { + execAsync(['bash', '-c', 'hyprctl dispatch killactive', '&']); + }, +}); diff --git a/modules/rice/ags/cfg/modules/bar/tray.js b/modules/rice/ags/cfg/modules/bar/tray.js new file mode 100644 index 0000000..facada8 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/tray.js @@ -0,0 +1,15 @@ +import { SystemTray } from "../../imports.js" +import { Widget } from "../../imports.js"; +const { Box } = Widget; + +const SysTrayItem = item => Widget.Button({ + child: Widget.Icon().bind('icon', item, 'icon'), + tooltipMarkup: item.bind('tooltip_markup'), + onPrimaryClick: (_, event) => item.activate(event), + onSecondaryClick: (_, event) => item.openMenu(event), +}); + +export const sysTray = () => Box({ + class_name: 'tray', + children: SystemTray.bind('items').transform(i => i.map(SysTrayItem)) +}) diff --git a/modules/rice/ags/cfg/modules/bar/workspaces.js b/modules/rice/ags/cfg/modules/bar/workspaces.js new file mode 100644 index 0000000..c0035b4 --- /dev/null +++ b/modules/rice/ags/cfg/modules/bar/workspaces.js @@ -0,0 +1,43 @@ +import { Utils, Widget, Hyprland } from "../../imports.js"; +const { execAsync } = Utils; +const { Box } = Widget; + +export const Workspaces = () => Box({ + className:"workspaces_pill", + child:Box({ + className: "workspaces", + child: Box({ + children: Array.from({ length: 10 }, (_, i) => i + 1).map((i) => + Widget.Button({ + cursor: "pointer", + attribute: { index: i }, + onClicked: () => + execAsync(["hyprctl", "dispatch", "workspace", `${i}`]).catch( + console.error, + ), + onSecondaryClick: () => + execAsync([ + "hyprctl", + "dispatch", + "movetoworkspacesilent", + `${i}`, + ]).catch(console.error), + }), + ), + setup: (self) => { + self.hook(Hyprland, (self) => + self.children.forEach((btn) => { + btn.className = + btn.attribute.index === Hyprland.active.workspace.id + ? "focused" + : ""; + btn.visible = Hyprland.workspaces.some( + (ws) => ws.id === btn.attribute.index, + ); + }), + ); + }, + }), + }), + +}); diff --git a/modules/rice/ags/cfg/modules/dashboard/bluetooth.js b/modules/rice/ags/cfg/modules/dashboard/bluetooth.js new file mode 100644 index 0000000..554471c --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/bluetooth.js @@ -0,0 +1,52 @@ +import { Widget, Bluetooth, Utils } from "../../imports.js"; +const { execAsync } = Utils +const { Box } = Widget; + +export const BluetoothWidget = () => + Widget.Button({ + onClicked: () => Bluetooth.toggle(), + onSecondaryClickRelease: () => { + execAsync(['bash', '-c', 'blueman-manager', '&']); + App.closeWindow('dashboard'); + }, + child: Box({ + className: "bluetooth", + vpack: "center", + vexpand: true, + setup: (self) => { + self.hook(Bluetooth, (self) => { + if (Bluetooth.enabled) { + self.toggleClassName("off", false); + } else { + self.toggleClassName("off", true); + } + }); + }, + children: [ + Widget.Label({ + className: "bluetoothIcon", + label: "󰂲", + setup: (self) => { + self.hook(Bluetooth, (self) => { + if (Bluetooth.enabled) { + self.label = "󰂯"; + } else { + self.label = "󰂲"; + } + }); + }, + }), + Box({ + vertical: true, + vpack: "center", + children: [ + Widget.Label({ + className: "bluetoothLabel", + label: "Bluetooth", + hpack: "start", + }), + ], + }), + ], + }), + }); diff --git a/modules/rice/ags/cfg/modules/dashboard/brightnessSlider.js b/modules/rice/ags/cfg/modules/dashboard/brightnessSlider.js new file mode 100644 index 0000000..babd0c3 --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/brightnessSlider.js @@ -0,0 +1,42 @@ +import { Widget } from "../../imports.js"; +import Brightness from "../../services/brightness.js"; +const { Box } = Widget; + +const Icon = () => + Widget.Label({ + className: "sldIcon", + setup: (self) => { + self.hook(Brightness, (self) => { + const icons = ["󰃚", "󰃛", "󰃜", "󰃝", "󰃞", "󰃟", "󰃠"]; + + self.label = + icons[Math.floor((Brightness.screen * 100) / 14)].toString(); + }); + }, + }); + +const Slider = () => + Widget.Slider({ + className: "sldSlider", + drawValue: false, + onChange: ({ value }) => (Brightness.screen = value), + setup: (self) => { + self.hook(Brightness, (self) => (self.value = Brightness.screen)); + }, + }); + +export const BrightnessSlider = () => + Box({ + className: "Slider", + vertical: true, + children: [ + Widget.Label({ + className: "sldLabel", + label: "Brightness", + hpack: "start", + }), + Box({ + children: [Icon(), Slider()], + }), + ], + }); diff --git a/modules/rice/ags/cfg/modules/dashboard/calendar.js b/modules/rice/ags/cfg/modules/dashboard/calendar.js new file mode 100644 index 0000000..1c893fa --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/calendar.js @@ -0,0 +1,16 @@ +import Gtk from 'gi://Gtk'; +import { Widget } from "../../imports.js"; +const { Box } = Widget; + +export const CalendarWidget = () => Box({ + className: "calendar", + vpack: 'end', + vertical: true, + children: [ + Widget.subclass(Gtk.Calendar)({ + showDayNames: true, + showHeading: true, + className: 'calendarWidget', + }) + ] +}) diff --git a/modules/rice/ags/cfg/modules/dashboard/dashboard.js b/modules/rice/ags/cfg/modules/dashboard/dashboard.js new file mode 100644 index 0000000..27cd035 --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/dashboard.js @@ -0,0 +1,62 @@ +import { Widget, Utils } from "../../imports.js"; +const { Box } = Widget; +const { execAsync } = Utils; +import PopupWindow from "../../utils/popupWindow.js"; + +import { PowerIcon, TerminalIcon } from "./iconButtons.js" +import { WiFi } from "./wifi.js"; +import { BluetoothWidget } from "./bluetooth.js"; +import { VolumeSlider } from "./volumeSlider.js" +import { BrightnessSlider } from "./brightnessSlider.js"; +import { NotificationList } from "./notificationList.js"; +import { CalendarWidget } from "./calendar.js"; + +const uptime = Box({ + children: [ + Widget.Label({ + setup: (self) => self + .poll(5000, label => { + execAsync(['bash', '-c', `w | sed -n '1p' | cut -d, -f1 | cut -d' ' -f4-`]) + .then(upTimeString => { + label.label = `Uptime: ${upTimeString}`; + }).catch(print); + }) + , + }), + Box({ hexpand: true }), + TerminalIcon({ hpack: 'end' }), + PowerIcon({ hpack: 'end' }), + ] +}); +export const Dashboard = () => PopupWindow({ + name: "dashboard", + anchor: ["top","bottom", "right"], + margins: [12, 12, 15], + transition: "slide_left", + transitionDuration: 150, + child: + Box({ + vertical:true, + children: [ + Box({ + className: "quicktoggles", + vertical: true, + vexpand: false, + children: [ + uptime, + Box({ + className: "buttons", + children: [ + WiFi(), + BluetoothWidget(), + ] + }), + ] + }), + VolumeSlider(), + // BrightnessSlider(), + NotificationList(), + CalendarWidget(), + ] + }) +}); diff --git a/modules/rice/ags/cfg/modules/dashboard/iconButtons.js b/modules/rice/ags/cfg/modules/dashboard/iconButtons.js new file mode 100644 index 0000000..b0de8d4 --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/iconButtons.js @@ -0,0 +1,21 @@ +import { Widget, Utils } from "../../imports.js" +const { execAsync } = Utils; + +export const PowerIcon = () => Widget.Button({ + className: 'Icon', + child: Widget.Label({ label:"⏻" }), + onClicked: () => { + App.closeWindow('dashboard'); + execAsync(['bash', '-c', '~/.config/hypr/scripts/powermenu.sh', '&']); + }, +}) +export const TerminalIcon = () => Widget.Button({ + className: 'Icon', + child: Widget.Label({ label:"󰄛" }), + onClicked: () => { + execAsync(['bash', '-c', 'kitty', '&']); + App.closeWindow('dashboard'); + + }, + +}) diff --git a/modules/rice/ags/cfg/modules/dashboard/notificationList.js b/modules/rice/ags/cfg/modules/dashboard/notificationList.js new file mode 100644 index 0000000..3bdf4b9 --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/notificationList.js @@ -0,0 +1,117 @@ +import { Widget, Notifications, Utils } from "../../imports.js"; +const { Box } = Widget; + +const Notifs = Widget.Box({ + class_name: "panel-notifs", + spacing: 20, + vertical: true, + vexpand: true, + setup: (self) => { + self.hook(Notifications, (self) => { + self.children = Notifications.notifications.map(n => Widget.Box({ + class_name: "notification", + vertical: true, + children: [ + + Widget.Button({ + on_clicked: () => { + n.close() + }, + child: Box({ + class_name: "notificationBody", + spacing: 20, + children: [ + Widget.Label({ + label: "󰍡", + class_name: "notificationImage" + }), + Box({ + vertical: true, + children: [ + Widget.Label({ + label: `${n.summary}`, + class_name: "notificationTitle", + xalign: 0, + wrap: true + }), + Widget.Label({ + vpack: "start", + hpack: "start", + class_name: "notificationDescription", + xalign: 0, + wrap: true, + label: n.body + }) + ] + }) + ] + }) + }) + ], + }) + ) + }) + } +}) +const NotifBox = Widget.Scrollable({ + vscroll: 'always', + hscroll: 'never', + vexpand: true, + class_name: 'notificationBox', + child: Notifs, +}) + +const Empty = Widget.Box({ + class_name: "notificationEmpty", + spacing: 20, + hpack: "center", + vpack: "center", + vertical: true, + children: [ + Widget.Label({ + label: ` 󱙎 `, + vpack: "center", + vexpand: true, + }) + ] +}) + +export const NotificationList = () => Widget.Box({ + class_name: "notificationList", + spacing: 20, + vertical: true, + children: [ + Widget.CenterBox({ + start_widget: Widget.Label({ + label: "Notifications", + hpack: 'start', + class_name: "nt" + }), + end_widget: Widget.Button({ + label: "  ", + hpack: 'end', + class_name: "icon ni", + on_clicked: () => { + const list = Array.from(Notifications.notifications); + for (let i = 0; i < list.length; i++) { + Utils.timeout(50 * i, () => list[i]?.close()); + } + } + }) + }), + + Widget.Stack({ + transition: 'crossfade', + transitionDuration: 150, + items: [ + ['empty', Empty], + ['list', NotifBox] + ], + setup: (self) => { + self.hook(Notifications, (self) => { + self.shown = (Notifications.notifications.length == 0 ? 'empty' : 'list') + }) + } + }), + ], +}) diff --git a/modules/rice/ags/cfg/modules/dashboard/volumeSlider.js b/modules/rice/ags/cfg/modules/dashboard/volumeSlider.js new file mode 100644 index 0000000..3ea07ab --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/volumeSlider.js @@ -0,0 +1,60 @@ +import { Widget, Audio } from "../../imports.js"; +const { Box } = Widget; + +const Icon = () => Widget.Label({ + className: "sldIcon", + setup: (self) => { + self.hook( + Audio, + (self) => { + if (!Audio.speaker) return; + + const icons = ["󰝟", "󰕿", "󰖀", "󰕾"]; + + self.label = + icons[ + Audio.speaker.stream.isMuted + ? 0 + : Math.floor((Audio.speaker.volume * 100) / 26) + ].toString(); + }, + "speaker-changed", + ); + }, +}); + +const Slider = () => Widget.Slider({ + className: "sldSlider", + drawValue: false, + onChange: ({ value }) => (Audio.speaker.volume = value), + setup: (self) => { + self.hook( + Audio, + (self) => { + if (!Audio.speaker) return; + + self.value = Audio.speaker.volume; + }, + "speaker-changed", + ); + }, + }); + +export const VolumeSlider = () => Box({ + className: "Slider", + vertical: true, + children: [ + Widget.Label({ + className: "sldLabel", + label: "Volume", + hpack: "start", + }), + Box({ + children: [ + Icon(), + Slider() + ], + + }), + ], +}); diff --git a/modules/rice/ags/cfg/modules/dashboard/wifi.js b/modules/rice/ags/cfg/modules/dashboard/wifi.js new file mode 100644 index 0000000..ace7f8b --- /dev/null +++ b/modules/rice/ags/cfg/modules/dashboard/wifi.js @@ -0,0 +1,52 @@ +import { Widget, Network, Utils } from "../../imports.js"; +const { execAsync } = Utils +const { Box } = Widget; + +export const WiFi = () => + Widget.Button({ + onClicked: () => Network.toggleWifi(), + onSecondaryClickRelease: () => { + execAsync(['bash', '-c', 'XDG_CURRENT_DESKTOP="gnome" gnome-control-center wifi', '&']); + App.closeWindow('dashboard'); + }, + child: Box({ + className: "wifi", + vpack: "center", + vexpand: true, + setup: (self) => { + self.hook(Network, (self) => { + if (Network.wifi.internet === "disconnected") { + self.toggleClassName("off", true); + } else { + self.toggleClassName("off", false); + } + }); + }, + children: [ + Widget.Label({ + className: "wifiIcon", + label: "󰤭", + setup: (self) => { + self.hook(Network, (self) => { + if (Network.wifi.internet === "disconnected") { + self.label = "󰤭"; + } else { + self.label = "󰤨"; + } + }); + }, + }), + Box({ + vertical: true, + vpack: "center", + children: [ + Widget.Label({ + className: "wifiLabel", + label: "Wi-Fi", + hpack: "start", + }), + ], + }), + ], + }), + }); diff --git a/modules/rice/ags/cfg/scss/_colors.scss b/modules/rice/ags/cfg/scss/_colors.scss new file mode 100644 index 0000000..8b93bb4 --- /dev/null +++ b/modules/rice/ags/cfg/scss/_colors.scss @@ -0,0 +1 @@ +$accent: #74C7EC; diff --git a/modules/rice/ags/cfg/scss/bar/_bar.scss b/modules/rice/ags/cfg/scss/bar/_bar.scss new file mode 100644 index 0000000..ff03e75 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_bar.scss @@ -0,0 +1,11 @@ +@import "clock"; +@import "media"; +@import "notification"; +@import "sysinfo"; +@import "title"; +@import "tray"; +@import "workspaces"; + +.bar { + font-family: $font; +} diff --git a/modules/rice/ags/cfg/scss/bar/_clock.scss b/modules/rice/ags/cfg/scss/bar/_clock.scss new file mode 100644 index 0000000..f1e2216 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_clock.scss @@ -0,0 +1,8 @@ +.clock { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; +} diff --git a/modules/rice/ags/cfg/scss/bar/_media.scss b/modules/rice/ags/cfg/scss/bar/_media.scss new file mode 100644 index 0000000..b2fc9b9 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_media.scss @@ -0,0 +1,12 @@ +.media { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; + &:hover { + color: $accent; + border: 3px solid $accent; + } +} diff --git a/modules/rice/ags/cfg/scss/bar/_notification.scss b/modules/rice/ags/cfg/scss/bar/_notification.scss new file mode 100644 index 0000000..7837547 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_notification.scss @@ -0,0 +1,9 @@ +.barNotification { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; +} diff --git a/modules/rice/ags/cfg/scss/bar/_sysinfo.scss b/modules/rice/ags/cfg/scss/bar/_sysinfo.scss new file mode 100644 index 0000000..d3ac173 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_sysinfo.scss @@ -0,0 +1,39 @@ +@keyframes lowBlink { + 0% { + color: $accent; + } + 50% { + color: #cdd6f4; + } + 100% { + color: $accent; + } +} +.sysinfo { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; + &:hover { + color: $accent; + border: 3px solid $accent; + } + +} +.volume { + margin-left: 8px; +} + +.bluetoothindicator { + margin-left: 8px; +} +.batIcon { + margin-left: 8px; + margin-right: 4px; + &.low { + animation: lowBlink 2s infinite; + } +} diff --git a/modules/rice/ags/cfg/scss/bar/_title.scss b/modules/rice/ags/cfg/scss/bar/_title.scss new file mode 100644 index 0000000..cf401e8 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_title.scss @@ -0,0 +1,13 @@ +.title { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-left: 10px; + padding: 1px 15px; + &:hover { + color: $accent; + border: 3px solid $accent; + } +} diff --git a/modules/rice/ags/cfg/scss/bar/_tray.scss b/modules/rice/ags/cfg/scss/bar/_tray.scss new file mode 100644 index 0000000..9c8bf1d --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_tray.scss @@ -0,0 +1,26 @@ +.tray{ + > * { + margin: 0 4px; + } + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 11px; +} +menu { + menuitem { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + margin: 1px; + padding: 5px; + &:hover { + color: $accent; + border: 3px solid $accent; + } + } +} diff --git a/modules/rice/ags/cfg/scss/bar/_workspaces.scss b/modules/rice/ags/cfg/scss/bar/_workspaces.scss new file mode 100644 index 0000000..613eec8 --- /dev/null +++ b/modules/rice/ags/cfg/scss/bar/_workspaces.scss @@ -0,0 +1,27 @@ +.workspaces_pill { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + padding: 1px 15px; +} + +.workspaces { + margin: 3px 0; + & button { + background: #cdd6f4; + border-radius: 24px; + margin: 0 3px; + min-height: 16px; + min-width: 16px; + transition: all 0.3s $materialStandard; + + &:hover { + min-width: 24px; + } + + &.focused { + background: $accent; + min-width: 32px; + } + } +} diff --git a/modules/rice/ags/cfg/scss/dashboard/_Slider.scss b/modules/rice/ags/cfg/scss/dashboard/_Slider.scss new file mode 100644 index 0000000..29c180d --- /dev/null +++ b/modules/rice/ags/cfg/scss/dashboard/_Slider.scss @@ -0,0 +1,31 @@ +.Slider { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 12px; +} +.sld { + &Label { + margin-bottom: 6px; + } + &Icon { + margin-right: 6px; + } + &Slider { + min-width: 300px; + & slider { + background: none; + } + & trough { + background: #313244; + border-radius: 24px; + min-height: 16px; + } + & highlight { + background: $accent; + border-radius: 24px; + min-width: 16px; + } + } +} diff --git a/modules/rice/ags/cfg/scss/dashboard/_calendar.scss b/modules/rice/ags/cfg/scss/dashboard/_calendar.scss new file mode 100644 index 0000000..5868e27 --- /dev/null +++ b/modules/rice/ags/cfg/scss/dashboard/_calendar.scss @@ -0,0 +1,13 @@ +.calendar { + background-color: #1e1e2e; + border-radius: 16px; + border: 3px solid #11111b; + color: #cdd6f4; + padding: 10px; +} +.calendarWidget { + padding: 3px; + &:selected { + color: $accent; + } +} diff --git a/modules/rice/ags/cfg/scss/dashboard/_dashboard.scss b/modules/rice/ags/cfg/scss/dashboard/_dashboard.scss new file mode 100644 index 0000000..d407bef --- /dev/null +++ b/modules/rice/ags/cfg/scss/dashboard/_dashboard.scss @@ -0,0 +1,9 @@ +@import "Slider"; +@import "calendar"; +@import "notifications"; +@import "quicktoggles"; + +.dashboard { + font-weight: bold; +} + diff --git a/modules/rice/ags/cfg/scss/dashboard/_notifications.scss b/modules/rice/ags/cfg/scss/dashboard/_notifications.scss new file mode 100644 index 0000000..f100e2f --- /dev/null +++ b/modules/rice/ags/cfg/scss/dashboard/_notifications.scss @@ -0,0 +1,26 @@ +.notificationList { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 10px; +} +.notificationEmpty { + color: #313244; + font-size: 80px; +} +.notificationImage { + color: #cdd6f4; + font-size: 40px; +} +.notification { + background-color: #313244; + border-radius: 15px; + padding:10px; +} +.notificationTitle { + color: #cdd6f4; +} +.notificationDescription { + color: #bac2de; +} diff --git a/modules/rice/ags/cfg/scss/dashboard/_quicktoggles.scss b/modules/rice/ags/cfg/scss/dashboard/_quicktoggles.scss new file mode 100644 index 0000000..68e83b9 --- /dev/null +++ b/modules/rice/ags/cfg/scss/dashboard/_quicktoggles.scss @@ -0,0 +1,37 @@ +.quicktoggles { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + min-width: 300px; + padding: 20px 20px; +} + +.buttons { + margin-top: 10px; +} + +.bluetooth, .wifi { + background: $accent; + border-radius: 24px; + min-width: 125px; + padding: 9px; + &.off { + background: #313244; + } +} +.wifi { + margin-right: 10px; +} +.wifi, .bluetooth, { + &Icon { + margin-right: 6px; + } +} +.Icon { + background: #313244; + border-radius: 50%; + margin-left: 5px; + min-height: 32px; + min-width: 32px; +} diff --git a/modules/rice/ags/cfg/scss/main.scss b/modules/rice/ags/cfg/scss/main.scss new file mode 100644 index 0000000..cab327b --- /dev/null +++ b/modules/rice/ags/cfg/scss/main.scss @@ -0,0 +1,14 @@ +*:not(selection):not(tooltip) { + all: unset; +} + +// Vars +$font: JetBrains Mono Nerd Font; +$materialStandard: cubic-bezier(0.2, 0, 0, 1); +$materialAccel: cubic-bezier(0.3, 0, 1, 1); +$materialDecel: cubic-bezier(0, 0, 0, 1); + +// Components +@import "./colors"; +@import "bar/bar"; +@import "dashboard/dashboard"; diff --git a/modules/rice/ags/cfg/services/brightness.js b/modules/rice/ags/cfg/services/brightness.js new file mode 100644 index 0000000..3774319 --- /dev/null +++ b/modules/rice/ags/cfg/services/brightness.js @@ -0,0 +1,49 @@ +import { Service, Utils } from "../imports.js"; + +class Brightness extends Service { + static { + Service.register( + this, + {}, + { + screen: ["float", "rw"], + }, + ); + } + + _screen = 0; + + get screen() { + return this._screen; + } + + set screen(percent) { + if (percent < 0) percent = 0; + + if (percent > 1) percent = 1; + + Utils.execAsync(`brightnessctl s ${percent * 100}% -q`) + .then(() => { + this._screen = percent; + this.changed("screen"); + }) + .catch(console.error); + } + + constructor() { + super(); + try { + this._screen = + Number(Utils.exec("brightnessctl g")) / + Number(Utils.exec("brightnessctl m")); + } catch (error) { + console.error("missing dependancy: brightnessctl"); + } + } +} + +const service = new Brightness(); + +globalThis.brightness = service; + +export default service; diff --git a/modules/rice/ags/cfg/style.css b/modules/rice/ags/cfg/style.css new file mode 100644 index 0000000..c372b1a --- /dev/null +++ b/modules/rice/ags/cfg/style.css @@ -0,0 +1,219 @@ +*:not(selection):not(tooltip) { + all: unset; } + +.clock { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; } + +.media { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; } + .media:hover { + color: #74C7EC; + border: 3px solid #74C7EC; } + +.barNotification { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; } + +@keyframes lowBlink { + 0% { + color: #74C7EC; } + 50% { + color: #cdd6f4; } + 100% { + color: #74C7EC; } } + +.sysinfo { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; } + .sysinfo:hover { + color: #74C7EC; + border: 3px solid #74C7EC; } + +.volume { + margin-left: 8px; } + +.bluetoothindicator { + margin-left: 8px; } + +.batIcon { + margin-left: 8px; + margin-right: 4px; } + .batIcon.low { + animation: lowBlink 2s infinite; } + +.title { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-left: 10px; + padding: 1px 15px; } + .title:hover { + color: #74C7EC; + border: 3px solid #74C7EC; } + +.tray { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 11px; } + .tray > * { + margin: 0 4px; } + +menu menuitem { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + margin: 1px; + padding: 5px; } + menu menuitem:hover { + color: #74C7EC; + border: 3px solid #74C7EC; } + +.workspaces_pill { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + padding: 1px 15px; } + +.workspaces { + margin: 3px 0; } + .workspaces button { + background: #cdd6f4; + border-radius: 24px; + margin: 0 3px; + min-height: 16px; + min-width: 16px; + transition: all 0.3s cubic-bezier(0.2, 0, 0, 1); } + .workspaces button:hover { + min-width: 24px; } + .workspaces button.focused { + background: #74C7EC; + min-width: 32px; } + +.bar { + font-family: JetBrains Mono Nerd Font; } + +.Slider { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 12px; } + +.sldLabel { + margin-bottom: 6px; } + +.sldIcon { + margin-right: 6px; } + +.sldSlider { + min-width: 300px; } + .sldSlider slider { + background: none; } + .sldSlider trough { + background: #313244; + border-radius: 24px; + min-height: 16px; } + .sldSlider highlight { + background: #74C7EC; + border-radius: 24px; + min-width: 16px; } + +.calendar { + background-color: #1e1e2e; + border-radius: 16px; + border: 3px solid #11111b; + color: #cdd6f4; + padding: 10px; } + +.calendarWidget { + padding: 3px; } + .calendarWidget:selected { + color: #74C7EC; } + +.notificationList { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 10px; } + +.notificationEmpty { + color: #313244; + font-size: 80px; } + +.notificationImage { + color: #cdd6f4; + font-size: 40px; } + +.notification { + background-color: #313244; + border-radius: 15px; + padding: 10px; } + +.notificationTitle { + color: #cdd6f4; } + +.notificationDescription { + color: #bac2de; } + +.quicktoggles { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + min-width: 300px; + padding: 20px 20px; } + +.buttons { + margin-top: 10px; } + +.bluetooth, .wifi { + background: #74C7EC; + border-radius: 24px; + min-width: 125px; + padding: 9px; } + .bluetooth.off, .wifi.off { + background: #313244; } + +.wifi { + margin-right: 10px; } + +.wifiIcon, .bluetoothIcon { + margin-right: 6px; } + +.Icon { + background: #313244; + border-radius: 50%; + margin-left: 5px; + min-height: 32px; + min-width: 32px; } + +.dashboard { + font-weight: bold; } diff --git a/modules/rice/ags/cfg/style.cssyazicd b/modules/rice/ags/cfg/style.cssyazicd new file mode 100644 index 0000000..a23b29e --- /dev/null +++ b/modules/rice/ags/cfg/style.cssyazicd @@ -0,0 +1,219 @@ +*:not(selection):not(tooltip) { + all: unset; } + +.clock { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; } + +.media { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + padding: 1px 15px; } + .media:hover { + color: #f5c2e7; + border: 3px solid #f5c2e7; } + +.barNotification { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; } + +@keyframes lowBlink { + 0% { + color: #f5c2e7; } + 50% { + color: #cdd6f4; } + 100% { + color: #f5c2e7; } } + +.sysinfo { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 15px; } + .sysinfo:hover { + color: #f5c2e7; + border: 3px solid #f5c2e7; } + +.volume { + margin-left: 8px; } + +.bluetoothindicator { + margin-left: 8px; } + +.batIcon { + margin-left: 8px; + margin-right: 4px; } + .batIcon.low { + animation: lowBlink 2s infinite; } + +.title { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-left: 10px; + padding: 1px 15px; } + .title:hover { + color: #f5c2e7; + border: 3px solid #f5c2e7; } + +.tray { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + font-weight: bold; + margin-right: 10px; + padding: 1px 11px; } + .tray > * { + margin: 0 4px; } + +menu menuitem { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + color: #cdd6f4; + margin: 1px; + padding: 5px; } + menu menuitem:hover { + color: #f5c2e7; + border: 3px solid #f5c2e7; } + +.workspaces_pill { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + padding: 1px 15px; } + +.workspaces { + margin: 3px 0; } + .workspaces button { + background: #cdd6f4; + border-radius: 24px; + margin: 0 3px; + min-height: 16px; + min-width: 16px; + transition: all 0.3s cubic-bezier(0.2, 0, 0, 1); } + .workspaces button:hover { + min-width: 24px; } + .workspaces button.focused { + background: #f5c2e7; + min-width: 32px; } + +.bar { + font-family: JetBrains Mono Nerd Font; } + +.Slider { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 12px; } + +.sldLabel { + margin-bottom: 6px; } + +.sldIcon { + margin-right: 6px; } + +.sldSlider { + min-width: 300px; } + .sldSlider slider { + background: none; } + .sldSlider trough { + background: #313244; + border-radius: 24px; + min-height: 16px; } + .sldSlider highlight { + background: #f5c2e7; + border-radius: 24px; + min-width: 16px; } + +.calendar { + background-color: #1e1e2e; + border-radius: 16px; + border: 3px solid #11111b; + color: #cdd6f4; + padding: 10px; } + +.calendarWidget { + padding: 3px; } + .calendarWidget:selected { + color: #74c7ec; } + +.notificationList { + background-color: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + padding: 10px; } + +.notificationEmpty { + color: #313244; + font-size: 80px; } + +.notificationImage { + color: #cdd6f4; + font-size: 40px; } + +.notification { + background-color: #313244; + border-radius: 15px; + padding: 10px; } + +.notificationTitle { + color: #cdd6f4; } + +.notificationDescription { + color: #bac2de; } + +.quicktoggles { + background: #1e1e2e; + border-radius: 15px; + border: 3px solid #11111b; + margin-bottom: 15px; + min-width: 300px; + padding: 20px 20px; } + +.buttons { + margin-top: 10px; } + +.bluetooth, .wifi { + background: #f5c2e7; + border-radius: 24px; + min-width: 125px; + padding: 9px; } + .bluetooth.off, .wifi.off { + background: #313244; } + +.wifi { + margin-right: 10px; } + +.wifiIcon, .bluetoothIcon { + margin-right: 6px; } + +.Icon { + background: #313244; + border-radius: 50%; + margin-left: 5px; + min-height: 32px; + min-width: 32px; } + +.dashboard { + font-weight: bold; } diff --git a/modules/rice/ags/cfg/utils/popupWindow.js b/modules/rice/ags/cfg/utils/popupWindow.js new file mode 100644 index 0000000..d3f2c8b --- /dev/null +++ b/modules/rice/ags/cfg/utils/popupWindow.js @@ -0,0 +1,52 @@ +import { App, Widget, Utils } from "../imports.js"; +const { Box, Revealer, Window } = Widget; + +export default ({ + onOpen = () => {}, + onClose = () => {}, + + name, + child, + transition = "slide_up", + transitionDuration = 250, + ...props +}) => { + const window = Window({ + name, + visible: false, + ...props, + + child: Box({ + css: `min-height: 2px; + min-width: 2px;`, + child: Revealer({ + transition, + transitionDuration, + hexpand: true, + vexpand: true, + child: child || Box(), + setup: (self) => { + self.hook(App, (rev, currentName, isOpen) => { + if (currentName === name) { + rev.revealChild = isOpen; + + if (isOpen) { + onOpen(window); + } else { + Utils.timeout(transitionDuration, () => { + onClose(window); + }); + } + } + }); + }, + }), + }), + }); + window.getChild = () => window.child.children[0].child; + window.setChild = (newChild) => { + window.child.children[0].child = newChild; + window.child.children[0].show_all(); }; + + return window; +}; diff --git a/modules/rice/ags/default.nix b/modules/rice/ags/default.nix new file mode 100644 index 0000000..acd63f6 --- /dev/null +++ b/modules/rice/ags/default.nix @@ -0,0 +1,61 @@ +{ + inputs, + pkgs, + config, + lib, + ... +}: let + requiredDeps = with pkgs; [ + config.wayland.windowManager.hyprland.package + bash + coreutils + gawk + sassc + imagemagick + procps + ripgrep + util-linux + gtksourceview + webkitgtk + brightnessctl + gvfs + accountsservice + ]; + + guiDeps = with pkgs; [ + gnome.gnome-control-center + mission-center + overskride + wlogout + ]; + + dependencies = requiredDeps ++ guiDeps; + + cfg = config.programs.ags; +in { + imports = [inputs.ags.homeManagerModules.default]; + + programs.ags = { + enable = true; + + configDir = ./cfg; + + extraPackages = dependencies; + }; + + systemd.user.services.ags = { + Unit = { + Description = "Aylur's Gtk Shell"; + PartOf = [ + "tray.target" + "graphical-session.target" + ]; + }; + Service = { + Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath dependencies}"; + ExecStart = "${cfg.package}/bin/ags"; + Restart = "on-failure"; + }; + Install.WantedBy = ["graphical-session.target"]; + }; +} diff --git a/modules/rice/hyprland/binds.nix b/modules/rice/hyprland/binds.nix index 49451f7..df36b3e 100644 --- a/modules/rice/hyprland/binds.nix +++ b/modules/rice/hyprland/binds.nix @@ -43,6 +43,7 @@ in { "${mod},mouse_down,workspace,e+1" # move to the next ws "${mod},mouse_up,workspace,e-1" # move to the previous ws + "${mod},X,exec, ags --toggle-window \"dashboard\"" "${mod},Print,exec, hyprshot -m region --clipboard-only" ",Print,exec, grim - | wl-copy" "${modshift},O,exec,wl-ocr"