From 9988ba37198b916b30871104028289a6565bfaf2 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 27 Aug 2023 10:31:41 -0400 Subject: [PATCH] feat: start switch to ags --- config/ags/colors.scss | 32 +++++++++++++++++++++++++ config/ags/config.js | 15 ++++++++++++ config/ags/powermenu/powermenu.js | 37 +++++++++++++++++++++++++++++ config/ags/powermenu/powermenu.scss | 36 ++++++++++++++++++++++++++++ config/ags/style.scss | 6 +++++ nixos/home/dotfiles.nix | 3 +++ nixos/home/hyprland.nix | 2 ++ 7 files changed, 131 insertions(+) create mode 100644 config/ags/colors.scss create mode 100644 config/ags/config.js create mode 100644 config/ags/powermenu/powermenu.js create mode 100644 config/ags/powermenu/powermenu.scss create mode 100644 config/ags/style.scss diff --git a/config/ags/colors.scss b/config/ags/colors.scss new file mode 100644 index 00000000..d5666856 --- /dev/null +++ b/config/ags/colors.scss @@ -0,0 +1,32 @@ +$darkbg: #0b0d16; +$bg: rgba(40, 42, 54, 0.8); //rgba(69, 71, 90, 0.3); #0d0f18; +$bgfull: rgb(40, 42, 54); +$contrastbg: rgba(189, 147, 249, 0.8); +$bgSecondary: #11131c; +$bgSecondaryAlt: #a5b6cf; +$fg: #a5b6cf; +$fgDim: #a5b6cf; +$watermelon: #dd6777; + +// Aliases +$background: $bg; +$backgroundSecondary: $bgSecondary; +$backgroundSecondaryAlt: $bgSecondaryAlt; +$foreground: $fg; +$foregroundDim: $fgDim; + +$black: #151720; +$dimblack: #1a1c25; +$lightblack: #262831; +$red: #dd6777; +$blue: #86aaec; +$cyan: #93cee9; +$blue-desaturated: #93cee9; +$magenta: #c296eb; +$purple: #c296eb; +$green: #90ceaa; +$aquamarine: #90ceaa; +$yellow: #ecd3a0; +$accent: $blue; +$javacafeMagenta: #c296eb; +$javacafeBlue: #86aaec; diff --git a/config/ags/config.js b/config/ags/config.js new file mode 100644 index 00000000..35e76539 --- /dev/null +++ b/config/ags/config.js @@ -0,0 +1,15 @@ +import { execAsync, writeFile } from 'resource:///com/github/Aylur/ags/utils.js'; +import { Powermenu } from 'file:///home/matt/.nix/config/ags/powermenu/powermenu.js'; + +const scss = ags.App.configDir + '/style.scss'; +const css = ags.App.configDir + '/style.css'; + +ags.Utils.exec(`touch ${css}`); +ags.Utils.exec(`sassc ${scss} ${css}`); + +export default { + style: css, + windows: [ + Powermenu + ] +} diff --git a/config/ags/powermenu/powermenu.js b/config/ags/powermenu/powermenu.js new file mode 100644 index 00000000..b9c2db32 --- /dev/null +++ b/config/ags/powermenu/powermenu.js @@ -0,0 +1,37 @@ +export const Powermenu = ags.Widget.Window({ + name: 'powermenu', + popup: true, + layer: 'overlay', + + child: ags.Widget.CenterBox({ + className: 'powermenu', + vertical: false, + + startWidget: ags.Widget.Button({ + className: 'shutdown', + onPrimaryClickRelease: 'echo shutdown', + + child: ags.Widget.Label({ + label: '襤', + }), + }), + + centerWidget: ags.Widget.Button({ + className: 'reboot', + onPrimaryClickRelease: 'echo reboot', + + child: ags.Widget.Label({ + label: '勒', + }), + }), + + endWidget: ags.Widget.Button({ + className: 'logout', + onPrimaryClickRelease: 'echo logout', + + child: ags.Widget.Label({ + label: '', + }), + }), + }), +}); diff --git a/config/ags/powermenu/powermenu.scss b/config/ags/powermenu/powermenu.scss new file mode 100644 index 00000000..9d875edd --- /dev/null +++ b/config/ags/powermenu/powermenu.scss @@ -0,0 +1,36 @@ +.powermenu { + background-color: $bg; + color: $fg; + padding: 10px; + font-family: MesloLGS NF; + /*font-family: Iosevka Nerd Font;*/ + font-size: 70px; + border-radius: 30px; + border: 2px solid $contrastbg; + label { + min-width: 140px; + min-height: 130px; + } + button { + margin-right: 10px; + margin-left: 10px; + margin-top: 5px; + margin-bottom: 5px; + border-radius: 12px; + min-width: 80px; + transition: all ease .2s; + &:hover { background-color: $bgSecondary; } + &:active { background-color: $bgSecondary; } + .content { + border-radius: 4px; + padding: 0px 15px 0px 15px; + } + } + .shutdown { color: $red; } + .reboot { color: $magenta; } + .logout { color: $yellow; } +} + +.powermenu-clickhandler { + background-color: black; +} diff --git a/config/ags/style.scss b/config/ags/style.scss new file mode 100644 index 00000000..1c93cce7 --- /dev/null +++ b/config/ags/style.scss @@ -0,0 +1,6 @@ +* { + all: unset; +} + +@import "/home/matt/.nix/config/ags/colors.scss"; +@import "/home/matt/.nix/config/ags/powermenu/powermenu.scss"; diff --git a/nixos/home/dotfiles.nix b/nixos/home/dotfiles.nix index 6213abf9..5eb5c6c3 100644 --- a/nixos/home/dotfiles.nix +++ b/nixos/home/dotfiles.nix @@ -13,6 +13,9 @@ in "gtklock/config.ini".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/config.ini"; "gtklock/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/style.css"; + + "ags/config.js".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/ags/config.js"; + "ags/style.scss".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/ags/style.scss"; }; programs = { diff --git a/nixos/home/hyprland.nix b/nixos/home/hyprland.nix index 3a3069f3..4bd5e461 100644 --- a/nixos/home/hyprland.nix +++ b/nixos/home/hyprland.nix @@ -13,6 +13,8 @@ in home.packages = [ (builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default (builtins.getFlake "path:/home/matt/git/hyprland-touch-gestures").packages.x86_64-linux.default + (builtins.getFlake "github:Aylur/ags").packages.x86_64-linux.default + pkgs.sassc pkgs.kora-icon-theme pkgs.coloryou ];