diff --git a/README.md b/README.md index d3481942..e35dfb96 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,10 @@ Or install from the `packages` output. For example: ## 💻 Desktop preview +Currently, my widgets are created using [Ags](https://github.com/Aylur/ags/). If +you're looking for the [Eww](https://github.com/elkowar/eww) version, you can +find it [here](https://github.com/fufexan/dotfiles/tree/eww). +
Dark diff --git a/flake.lock b/flake.lock index d82dd3b5..bffa7278 100644 --- a/flake.lock +++ b/flake.lock @@ -66,7 +66,7 @@ }, "crane": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": [ "helix", @@ -131,47 +131,7 @@ "type": "github" } }, - "eww": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1703102678, - "narHash": "sha256-MR91Ytt9Jf63dshn7LX64LWAVygbZgQYkcTIKhfVNXI=", - "owner": "elkowar", - "repo": "eww", - "rev": "65d622c81f2e753f462d23121fa1939b0a84a3e0", - "type": "github" - }, - "original": { - "owner": "elkowar", - "repo": "eww", - "type": "github" - } - }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -187,7 +147,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -203,7 +163,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -645,7 +605,7 @@ "lanzaboote": { "inputs": { "crane": "crane_2", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_3", "flake-utils": "flake-utils_3", "nixpkgs": "nixpkgs_7", @@ -942,7 +902,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", "flake-utils": [ "fu" ], @@ -1002,7 +962,6 @@ "agenix": "agenix", "ags": "ags", "anyrun": "anyrun", - "eww": "eww", "flake-parts": "flake-parts_2", "fu": "fu", "gross": "gross", @@ -1021,7 +980,6 @@ "nixpkgs": "nixpkgs_9", "nixpkgs-howdy": "nixpkgs-howdy", "pre-commit-hooks": "pre-commit-hooks", - "rust-overlay": "rust-overlay_4", "spicetify-nix": "spicetify-nix" } }, @@ -1102,29 +1060,6 @@ "type": "github" } }, - "rust-overlay_4": { - "inputs": { - "flake-utils": [ - "fu" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1704075545, - "narHash": "sha256-L3zgOuVKhPjKsVLc3yTm2YJ6+BATyZBury7wnhyc8QU=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a0df72e106322b67e9c6e591fe870380bd0da0d5", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "spicetify-nix": { "inputs": { "flake-utils": "flake-utils_4", diff --git a/flake.nix b/flake.nix index b666ba70..49dbe5ee 100644 --- a/flake.nix +++ b/flake.nix @@ -59,12 +59,6 @@ anyrun.url = "github:fufexan/anyrun"; - eww = { - url = "github:elkowar/eww"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.rust-overlay.follows = "rust-overlay"; - }; - fu.url = "github:numtide/flake-utils"; gross = { @@ -127,12 +121,6 @@ inputs.flake-utils.follows = "fu"; }; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "fu"; - }; - spicetify-nix = { url = "github:the-argus/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/README.md b/home/README.md index 96c3fac0..71823fc8 100644 --- a/home/README.md +++ b/home/README.md @@ -8,7 +8,7 @@ Home-Manager configurations for different hosts. | `editors` | Helix & Neovim | | `profiles` | Per-device/user profiles, entry point of the configs | | `programs` | Programs, games, media, etc | -| `services` | Services like `ags`, `eww`, etc | +| `services` | Services like `ags`, etc | | `shell` | Zsh, Nix options, etc. | | `terminals` | Terminal configs | | `wayland` | Wayland-specific options, including Hyprland | diff --git a/home/profiles/default.nix b/home/profiles/default.nix index 15765d4d..77eda4c2 100644 --- a/home/profiles/default.nix +++ b/home/profiles/default.nix @@ -47,7 +47,5 @@ in { inherit pkgs; }; }); - - homeManagerModules.eww-hyprland = import ../services/eww; }; } diff --git a/home/services/ags/README.md b/home/services/ags/README.md index 4982c814..9ce9372f 100644 --- a/home/services/ags/README.md +++ b/home/services/ags/README.md @@ -3,7 +3,8 @@ This configuration aims to provide a shell replacement for compositors/window managers. Features constantly get added and existing ones get improved. -This builds upon my [previous work on Eww](../eww). +This builds upon my +[previous work on Eww](https://github.com/fufexan/dotfiles/tree/eww/home/services/eww). ## 🗃️ Components diff --git a/home/services/eww/README.md b/home/services/eww/README.md deleted file mode 100644 index d4e21491..00000000 --- a/home/services/eww/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Eww configuration - -This configuration aims to provide a shell replacement for compositors/window -managers. Features constantly get added and existing ones get improved. - -## 🗃️ Components - -The same daemon runs multiple windows which interact with each other: - -### bar - -![bar](https://github.com/fufexan/dotfiles/assets/36706276/c3339908-029c-4e56-88c5-e620dc8ce00d) - -### music window - -![music](https://github.com/fufexan/dotfiles/assets/36706276/4260362b-8c69-417e-94c0-1436dc9febf9) - -### calendar - -![calendar](https://github.com/fufexan/dotfiles/assets/36706276/ddf2a40d-f758-4072-ac14-2c254cb9393a) - -### system info - -![system](https://github.com/fufexan/dotfiles/assets/36706276/723fd8fe-538c-41a5-bcbf-218304dc3bdf) - -NOTE: Looks best with font-size set to 9pt. - -## ❔ Usage - -### Home Manager - -If you use Home Manager, installing is as simple as adding my flake to your -inputs, passing `inputs` to `extraSpecialArgs` and importing the relevant -module: - -```nix -{inputs, pkgs, ...}: { - imports = [inputs.fufexan.homeManagerModules.eww-hyprland]; - - programs.eww-hyprland = { - enable = true; - - # default package - package = pkgs.eww-wayland; - - # if you want to change colors - colors = builtins.readFile ./latte.scss; - - # set to true to reload on change - autoReload = false; - }; -} -``` - -Make sure to also add the fonts listed below. You can simply search where they -are in my config. - -### Other distros - -To quickly install this config, grab all the files in this directory and put -them in `~/.config/eww`. Then run `eww daemon` and `eww open bar`. Enjoy! - -Dependencies: - -- Icon fonts: - [Material Symbols Outlined](https://github.com/google/material-design-icons/tree/master/variablefont) - (any variation can be used as long as you change the `font-family` property of - `.icon`) -- Text font: Inter or Roboto -- Script deps: everything in `default.nix`'s `dependencies` list. -- [gross](https://github.com/fufexan/gross) - -## 🎨 Theme - -The theme colors can be changed in `css/colors.scss`. There are dark/light -variants which can be symlinked to `colors.scss` to change the theme. diff --git a/home/services/eww/css/bar.scss b/home/services/eww/css/bar.scss deleted file mode 100644 index 4caacd55..00000000 --- a/home/services/eww/css/bar.scss +++ /dev/null @@ -1,34 +0,0 @@ -.bar { - background: $bar-bg; -} -.module { - margin: 0 0.5rem; -} - -/* workspaces */ -.focused { - background-color: $focused; - border-radius: 1rem; - margin: 0.3rem; - padding: 0.3rem; -} - -.ws { - background: $surface; - border-radius: 2rem; - margin: 0.8rem 0.2rem; - padding: 0.1rem; -} - -.ws-red { - background: $red; -} -.ws-yellow { - background: $yellow; -} -.ws-green { - background: $green; -} -.ws-blue { - background: $blue; -} diff --git a/home/services/eww/css/calendar.scss b/home/services/eww/css/calendar.scss deleted file mode 100644 index 23abcbc1..00000000 --- a/home/services/eww/css/calendar.scss +++ /dev/null @@ -1,31 +0,0 @@ -.calendar-window { - @include window; -} - -calendar { - margin: 0.3rem; - padding: 0.2rem; - - :selected { - background: $surface; - border-radius: 100%; - padding: 0.3rem 0.5rem; - } - - .header { - color: $subtext; - } - - .highlight { - color: $red; - font-weight: bold; - } - - .button { - padding: 0.5rem 0.3rem; - } - - :indeterminate { - color: $subtext; - } -} diff --git a/home/services/eww/css/colors-dark.scss b/home/services/eww/css/colors-dark.scss deleted file mode 100644 index 12665d31..00000000 --- a/home/services/eww/css/colors-dark.scss +++ /dev/null @@ -1,35 +0,0 @@ -$red: #f38ba8; -$yellow: #f9e2af; -$green: #a6e3a1; -$blue: #89b4fa; - -$tooltip-bg: #000000; - -$accent: rgb(46, 63, 147); - -$bar-bg: rgba(0, 0, 0, 0.2); -$bg: rgba(0, 0, 0, 0.5); -$fg: #ffffff; -$surface: rgba(255, 255, 255, 0.15); -$overlay: rgba(255, 255, 255, 0.7); - -$button: $surface; -$hover: adjust_color($button, $alpha: +0.1); - -$button-active: $accent; -$button-active-hover: adjust_color($accent, $lightness: +20%); - -$text: $fg; -$subtext: #cccccc; - -$focused: $bg; - -* { - text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2); -} - -@mixin border { - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 0 0 1px rgba(0, 0, 0, 0.5); -} diff --git a/home/services/eww/css/colors-light.scss b/home/services/eww/css/colors-light.scss deleted file mode 100644 index 5859da79..00000000 --- a/home/services/eww/css/colors-light.scss +++ /dev/null @@ -1,31 +0,0 @@ -$red: #d20f39; -$yellow: #df8e1d; -$green: #40a02b; -$blue: #1e66f5; - -$tooltip-bg: #ffffff; - -$accent: rgb(186, 195, 255); - -$bar-bg: rgba(255, 255, 255, 0.3); -$bg: rgba(255, 255, 255, 0.5); -$fg: #000000; -$surface: rgba(255, 255, 255, 0.3); -$overlay: rgba(0, 0, 0, 0.5); - -$button: rgba(0, 0, 0, 0.1); -$hover: adjust_color($button, $alpha: +0.1); - -$button-active: $accent; -$button-active-hover: adjust_color($accent, $lightness: -20%); - -$text: $fg; -$subtext: rgba(0, 0, 0, 0.5); - -$focused: $surface; - -@mixin border { - box-shadow: - 0 0 0 1px rgba(0, 0, 0, 0.1), - inset 0 0 0 1px rgba(255, 255, 255, 0.1); -} diff --git a/home/services/eww/css/general.scss b/home/services/eww/css/general.scss deleted file mode 100644 index 1663a5d4..00000000 --- a/home/services/eww/css/general.scss +++ /dev/null @@ -1,96 +0,0 @@ -/* general css styles */ - -$round: 8px; -$margin: 0.4rem; -$padding: 0.4rem; -$border-width: 2px; - -* { - color: $fg; -} - -/* mixins */ -@mixin window-rounding { - border-radius: calc($round * 2); -} - -@mixin rounding { - border-radius: calc($round * 2 - $padding - $border-width); -} - -@mixin window-box { - @include rounding; - - background: $surface; - box-shadow: 0 1px 5px -5px rgba(0, 0, 0, 0.5); - margin: $margin; - padding: $padding; -} - -@mixin window { - @include border; - @include window-rounding; - - background: $bg; - margin: 5px 5px 10px; - padding: $padding; -} - -tooltip { - background: $tooltip-bg; - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.1), - 0 0 rgba(0, 0, 0, 0.4); - border-radius: $round; -} - -/* icon font */ -.icon, -.icon label { - font-family: Material Symbols Outlined; -} - -/* scales */ -$scaleh: 0.5rem; - -scale { - trough { - background-color: $surface; - border-radius: $scaleh; - min-width: calc($scaleh * 10); - padding: 0 calc($scaleh / 2); - } - - highlight { - background: $overlay; - border-radius: $scaleh; - margin: 0 calc(0px - $scaleh / 2); - min-height: $scaleh; - } -} - -.button { - background: $button; - border-radius: 100%; - padding: 0.2rem 0.4rem; /* general for icons */ - - &:hover { - background: $hover; - } -} - -/* modules */ -.enabled, -.connected { - label { - color: $fg; - } - - button { - background: $button-active; - - &:hover { - background: $button-active-hover; - } - } -} diff --git a/home/services/eww/css/indicators.scss b/home/services/eww/css/indicators.scss deleted file mode 100644 index 413ea36c..00000000 --- a/home/services/eww/css/indicators.scss +++ /dev/null @@ -1,31 +0,0 @@ -/* screenshare & mic share indicators */ -.indicators { - margin: 0.5rem 0; - - :first-child { - border-radius: 1rem 0 0 1rem; - } - - :last-child { - border-radius: 0 1rem 1rem 0; - } - - :only-child { - border-radius: 1rem; - } -} - -.indicator { - color: $bg; - padding: 0 0.4rem; -} - -.screenshare { - background: $red; -} -.micshare { - background: $green; -} -.camerashare { - background: $blue; -} diff --git a/home/services/eww/css/music.scss b/home/services/eww/css/music.scss deleted file mode 100644 index 61b8d36b..00000000 --- a/home/services/eww/css/music.scss +++ /dev/null @@ -1,59 +0,0 @@ -/* module cover art */ -.song-cover-art { - background-position: center; - background-size: cover; - border-radius: 2rem; - margin: 4px 5px 4px 0; - min-height: 2rem; - min-width: 2rem; -} - -/* music window */ -.music-window { - @include window; - - & > box { - @include window-box; - background-position: center; - background-size: cover; - box-shadow: none; - } - - background-position: center; - background-size: cover; - - .cover { - box-shadow: 0 1px 2px -1px $bg; - min-height: 12rem; - min-width: 12rem; - } -} - -.music-box { - .title { - font-size: 1.5rem; - font-weight: bold; - margin: 0.5rem; - } - - .artist { - margin: 0.7rem; - } - - .buttons { - margin: 1rem 0 0.5rem; - - .icon { - font-size: 2rem; - } - } - - trough { - min-width: 12rem; - margin: 0 calc($scaleh / 2); - } -} - -.music-time { - margin: 0 calc($scaleh / 2); -} diff --git a/home/services/eww/css/osd.scss b/home/services/eww/css/osd.scss deleted file mode 100644 index 7eec2940..00000000 --- a/home/services/eww/css/osd.scss +++ /dev/null @@ -1,14 +0,0 @@ -.osd-part { - @include window; - margin: 0.2rem; - - .icon { - color: $overlay; - font-size: 2rem; - } - - trough { - margin: 0 0.5rem; - min-width: 8rem; - } -} diff --git a/home/services/eww/css/prelude.scss b/home/services/eww/css/prelude.scss deleted file mode 100644 index 7970ce33..00000000 --- a/home/services/eww/css/prelude.scss +++ /dev/null @@ -1,6 +0,0 @@ -/* get rid of GTK theme's styles and set defaults */ -* { - all: unset; - font-family: Inter, Roboto, sans-serif; - transition: 200ms ease; -} diff --git a/home/services/eww/css/system-menu.scss b/home/services/eww/css/system-menu.scss deleted file mode 100644 index 883450ff..00000000 --- a/home/services/eww/css/system-menu.scss +++ /dev/null @@ -1,63 +0,0 @@ -/* system menu */ - -.system-menu-window { - @include window; - - .text { - font-size: 0.8rem; - } - - & > box { - @include window-box; - } -} - -/* wifi/bt/airplane buttons */ -.toggle { - margin: 0.2rem; - - button { - margin-right: 0.5rem; - } -} - -/* volume & brightness sliders */ -.sliders { - scale { - min-width: 15rem; - } - - trough { - margin-left: 0; - margin: 0 0.45rem 0 0.3rem; - } - - .icon { - margin: 0 0.3rem; - } -} - -/* battery & power button */ -.system-menu .battery { - .icon { - font-size: 1.5rem; - - &.low { - color: $red; - } - } - - * { - transition: none; - } - .rate { - color: $subtext; - } - .status { - margin: 0 0.5rem; - } -} - -.button.power { - margin: 0.1rem; -} diff --git a/home/services/eww/css/system.scss b/home/services/eww/css/system.scss deleted file mode 100644 index 2407891a..00000000 --- a/home/services/eww/css/system.scss +++ /dev/null @@ -1,22 +0,0 @@ -/* CPU & RAM */ -.sys-indicator { - .property { - font-size: 0.5rem; - font-weight: 300; - margin-bottom: -0.2rem; - margin-top: 0.4rem; - } - - .value { - font-size: 0.8rem; - } - - margin: 0.35rem; -} - -.bar .battery .icon { - font-size: 1.2rem; - .low { - color: $red; - } -} diff --git a/home/services/eww/default.nix b/home/services/eww/default.nix deleted file mode 100644 index 9b7c550b..00000000 --- a/home/services/eww/default.nix +++ /dev/null @@ -1,125 +0,0 @@ -{ - config, - pkgs, - lib, - inputs, - ... -}: let - dependencies = with pkgs; [ - cfg.package - - inputs.gross.packages.${pkgs.system}.gross - config.wayland.windowManager.hyprland.package - - bash - blueberry - bluez - brillo - coreutils - dbus - findutils - gawk - gnome.gnome-control-center - gnused - imagemagick - jaq - jc - libnotify - networkmanager - pavucontrol - playerctl - procps - pulseaudio - ripgrep - socat - udev - upower - util-linux - wget - wireplumber - wlogout - ]; - - reload_script = pkgs.writeShellScript "reload_eww" '' - windows=$(eww windows | rg '\*' | tr -d '*') - - systemctl --user restart eww.service - - echo $windows | while read -r w; do - eww open $w - done - ''; - - cfg = config.programs.eww-hyprland; -in { - options.programs.eww-hyprland = { - enable = lib.mkEnableOption "eww Hyprland config"; - - package = lib.mkOption { - type = with lib.types; nullOr package; - default = pkgs.eww-wayland; - defaultText = lib.literalExpression "pkgs.eww-wayland"; - description = "Eww package to use."; - }; - - autoReload = lib.mkOption { - type = lib.types.bool; - default = false; - defaultText = lib.literalExpression "false"; - description = "Whether to restart the eww daemon and windows on change."; - }; - - colors = lib.mkOption { - type = with lib.types; nullOr lines; - default = null; - defaultText = lib.literalExpression "null"; - description = '' - SCSS file with colors (defaults to dark mode). - ''; - }; - }; - - config = lib.mkIf cfg.enable { - home.packages = [cfg.package]; - - # remove nix files - xdg.configFile."eww" = { - source = lib.cleanSourceWith { - filter = name: _type: let - baseName = baseNameOf (toString name); - in - !(lib.hasSuffix ".nix" baseName) && (baseName != "colors-dark.scss") && (baseName != "colors-light.scss"); - src = lib.cleanSource ./.; - }; - - # links each file individually, which lets us insert the colors file separately - recursive = true; - - onChange = - if cfg.autoReload - then reload_script.outPath - else ""; - }; - - # colors file - xdg.configFile."eww/css/colors.scss".text = - if cfg.colors != null - then cfg.colors - else (builtins.readFile ./css/colors-dark.scss); - - systemd.user.services.eww = { - Unit = { - Description = "Eww Daemon"; - # not yet implemented - # PartOf = ["tray.target"]; - PartOf = ["graphical-session.target"]; - }; - Service = { - Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath dependencies}"; - ExecStart = "${cfg.package}/bin/eww daemon --no-daemonize"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; - }; -} diff --git a/home/services/eww/eww.scss b/home/services/eww/eww.scss deleted file mode 100644 index d943ffb3..00000000 --- a/home/services/eww/eww.scss +++ /dev/null @@ -1,15 +0,0 @@ -/* style aggregator */ - -/* setup */ -@import "css/prelude"; -@import "css/colors"; -@import "css/general"; - -/* modules & windows */ -@import "css/bar"; -@import "css/calendar"; -@import "css/indicators"; -@import "css/music"; -@import "css/osd"; -@import "css/system-menu"; -@import "css/system"; diff --git a/home/services/eww/eww.yuck b/home/services/eww/eww.yuck deleted file mode 100644 index 5108c2ae..00000000 --- a/home/services/eww/eww.yuck +++ /dev/null @@ -1,19 +0,0 @@ -; all variables and listeners -(include "./variables.yuck") - -; various bar modules -(include "./modules/bluetooth.yuck") -(include "./modules/clock.yuck") -(include "./modules/indicators.yuck") -(include "./modules/music.yuck") -(include "./modules/net.yuck") -(include "./modules/sys.yuck") -(include "./modules/volume.yuck") -(include "./modules/workspaces.yuck") - -; individual windows -(include "./windows/bar.yuck") -(include "./windows/calendar.yuck") -(include "./windows/music.yuck") -(include "./windows/osd.yuck") -(include "./windows/system-menu.yuck") diff --git a/home/services/eww/modules/bluetooth.yuck b/home/services/eww/modules/bluetooth.yuck deleted file mode 100644 index 2c56525a..00000000 --- a/home/services/eww/modules/bluetooth.yuck +++ /dev/null @@ -1,5 +0,0 @@ -(defwidget bluetooth [] - (label - :class "module icon ${bluetooth.state}" - :tooltip "${bluetooth.text} ${bluetooth.battery}" - :text {bluetooth.state == "connected" ? "" : bluetooth.state == "enabled" ? "" : ""})) diff --git a/home/services/eww/modules/bright.yuck b/home/services/eww/modules/bright.yuck deleted file mode 100644 index 892ef08d..00000000 --- a/home/services/eww/modules/bright.yuck +++ /dev/null @@ -1,10 +0,0 @@ -(defwidget bright [] - (box - :class "module" - (eventbox - ; scroll to change the brightness level - :onscroll "echo {} | sed -e 's/up/-U 1/g' -e 's/down/-A 1/g' | xargs brillo -S" - (label - :text {brightness.icon} - :class "bright-icon icon" - :tooltip "brightness ${round(brightness.percent, 0)}%")))) diff --git a/home/services/eww/modules/clock.yuck b/home/services/eww/modules/clock.yuck deleted file mode 100644 index 46f3cae7..00000000 --- a/home/services/eww/modules/clock.yuck +++ /dev/null @@ -1,6 +0,0 @@ -(defwidget clock_module [] - (eventbox - :onclick "eww open --toggle calendar" - (label - :class "text module" - :text {formattime(EWW_TIME, "%a %b %d %H:%M")}))) diff --git a/home/services/eww/modules/indicators.yuck b/home/services/eww/modules/indicators.yuck deleted file mode 100644 index d2b45f76..00000000 --- a/home/services/eww/modules/indicators.yuck +++ /dev/null @@ -1,10 +0,0 @@ -; screenshare & mic share indicators -(defwidget indicators [] - (box - :space-evenly false - :class "indicators" - (for i in indicators - (label - :class "icon indicator ${i.class}" - :tooltip "${i.name} is being shared" - :text {i.icon})))) diff --git a/home/services/eww/modules/music.yuck b/home/services/eww/modules/music.yuck deleted file mode 100644 index 1567bcad..00000000 --- a/home/services/eww/modules/music.yuck +++ /dev/null @@ -1,25 +0,0 @@ -(defwidget music-module [] - (eventbox - :onhover "${EWW_CMD} update music_reveal=true" - :onhoverlost "${EWW_CMD} update music_reveal=false" - (box - :class "module" - :space-evenly false - (box - :class "song-cover-art" - :valign "center" - :style "background-image: url(\"${music.cover}\");") - (button - :class "module text" - :onclick "${EWW_CMD} open --toggle music" - {music.title}) - ; show buttons when hovering - (revealer - :transition "slideright" - :reveal music_reveal - :duration "350ms" - (box - :class "icon text" - (button :class "song-button" :onclick "playerctl previous" "") - (button :class "song-button" :onclick "playerctl play-pause" {music.status == "Playing" ? "" : ""}) - (button :class "song-button" :onclick "playerctl next" "")))))) diff --git a/home/services/eww/modules/net.yuck b/home/services/eww/modules/net.yuck deleted file mode 100644 index b615261f..00000000 --- a/home/services/eww/modules/net.yuck +++ /dev/null @@ -1,5 +0,0 @@ -(defwidget net [] - (label - :class "module icon ${net.state}" - :tooltip {net.text} - :text {net.icon})) diff --git a/home/services/eww/modules/sys.yuck b/home/services/eww/modules/sys.yuck deleted file mode 100644 index 8c374e53..00000000 --- a/home/services/eww/modules/sys.yuck +++ /dev/null @@ -1,26 +0,0 @@ -(defwidget sys-indicator [property value tooltip] - (eventbox - :tooltip tooltip - (box - :orientation "v" - :space-evenly false - :class "sys-indicator module" - (label - :class "text property" - :text property) - (label - :class "text value" - :text "${value}%")))) - - -(defvar GB 1024000000) -(defvar MB 1024000) - -(defwidget battery-module [] - (box - :class "module battery" - (label - :value {EWW_BATTERY.total_avg} - :class "icon ${EWW_BATTERY.total_avg > 20 ? '' : 'low'}" - :tooltip "battery on ${round(EWW_BATTERY.total_avg,0)}%" - :text {battery_icons[round(EWW_BATTERY.total_avg / (100 / arraylength(battery_icons)) - 1,0)]}))) diff --git a/home/services/eww/modules/volume.yuck b/home/services/eww/modules/volume.yuck deleted file mode 100644 index 89fa47ba..00000000 --- a/home/services/eww/modules/volume.yuck +++ /dev/null @@ -1,13 +0,0 @@ -(defwidget volume-module [] - (box - :class "module icon" - (eventbox - ; scroll over the icon to change volume - ; low increment so that scrolling with a touchpad doesn't shatter your eardrums - :onscroll "echo {} | sed -e 's/up/-/g' -e 's/down/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.005%" - :onclick "pavucontrol &" ; open pavucontrol on click - :onrightclick "scripts/volume mute SINK" ; toggle mute on right click - (label - :class "vol-icon" - :tooltip "volume ${volume.percent}%" - :text {volume.icon})))) diff --git a/home/services/eww/modules/workspaces.yuck b/home/services/eww/modules/workspaces.yuck deleted file mode 100644 index b5ce5f3b..00000000 --- a/home/services/eww/modules/workspaces.yuck +++ /dev/null @@ -1,15 +0,0 @@ -(defvar monitor_colors `["ws-red", "ws-yellow", "ws-green", "ws-blue"]`) - -(defwidget workspaces [] - (eventbox - ; scroll to change workspace - :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" - (box - :class "module workspaces" - (for ws in {hyprland.workspaces} - (button - :onclick "hyprctl dispatch workspace ${ws.name}" - :class `ws icon ${ws.state == "Active" ? monitor_colors[ws.monitor] : ""}` - (box - :class `${ws.name == hyprland.focused ? "focused" : ""}` - :height 3)))))) diff --git a/home/services/eww/scripts/airplane b/home/services/eww/scripts/airplane deleted file mode 100755 index 903655ba..00000000 --- a/home/services/eww/scripts/airplane +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -source "$(dirname "$0")"/utils - -STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - -gen_output() { - if [ "$STATUS" = "no" ]; then - icon="" - state="disabled" - else - icon="" - state="enabled" - fi - text="Airplane Mode" - - echo '{"text": "'"$text"'", "icon": "'"$icon"'", "state": "'"$state"'"}' -} - -toggle() { - if [ "$STATUS" = "no" ]; then - rfkill block all - notify-send --urgency=normal -i airplane-mode-symbolic "Airplane Mode" "Airplane mode has been turned on!" - else - rfkill unblock all - notify-send --urgency=normal -i airplane-mode-disabled-symbolic "Airplane Mode" "Airplane mode has been turned off!" - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - last_time=$(get_time_ms) - STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - gen_output - - rfkill event | while read -r _; do - current_time=$(get_time_ms) - delta=$((current_time - last_time)) - # 50ms debounce - if [[ $delta -gt 50 ]]; then - STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - gen_output - # reset debounce timer - last_time=$(get_time_ms) - fi - done -fi diff --git a/home/services/eww/scripts/bluetooth b/home/services/eww/scripts/bluetooth deleted file mode 100755 index c02c4cac..00000000 --- a/home/services/eww/scripts/bluetooth +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -source "$(dirname "$0")"/utils - -toggle() { - status=$(rfkill -J | jaq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block bluetooth - else - rfkill unblock bluetooth - fi -} - -gen_output() { - powered=$(bluetoothctl show | rg Powered | cut -f 2- -d ' ') - status=$(bluetoothctl info) - name=$(echo "$status" | rg Name | cut -f 2- -d ' ') - mac=$(echo "$status" | head -1 | awk '{print $2}' | tr ':' '_') - - if [[ "$(echo "$status" | rg Percentage)" != "" ]]; then - battery="$(upower -i /org/freedesktop/UPower/devices/headset_dev_"$mac" | rg percentage | awk '{print $2}' | cut -f 1 -d '%')%" - else - battery="" - fi - - if [ "$powered" = "yes" ]; then - if [ "$status" != "Missing device address argument" ]; then - text="$name" - state="connected" - else - text="Disconnected" - state="enabled" - fi - else - text="Bluetooth off" - state="disabled" - fi - - echo '{ "state": "'"$state"'", "battery": "'"$battery"'", "text": "'"$text"'" }' -} - -if [ "$1" = "toggle" ]; then - toggle -else - gen_output - last_time=$(get_time_ms) - - udevadm monitor | while read -r _; do - current_time=$(get_time_ms) - delta=$((current_time - last_time)) - # 50ms debounce - if [[ $delta -gt 50 ]]; then - gen_output - # reset debounce timer - last_time=$(get_time_ms) - fi - done -fi diff --git a/home/services/eww/scripts/brightness b/home/services/eww/scripts/brightness deleted file mode 100755 index 2dae1987..00000000 --- a/home/services/eww/scripts/brightness +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -source "$(dirname "$0")"/utils - -icons=("" "" "") -date="$XDG_CACHE_HOME/eww/osd_brightness.date" - -gen_output() { - percent="$(brillo)" - icon="${icons[$(awk -v n="$percent" 'BEGIN{print int(n/34)}')]}" - - echo '{"percent": "'"$percent"'", "icon": "'"$icon"'"}' -} - -if [ "$1" = "osd" ]; then - osd "$date" -else - # initial - last_time=$(get_time_ms) - gen_output - osd_handler "osd-brightness" & - - udevadm monitor | rg --line-buffered "backlight" | while read -r _; do - current_time=$(get_time_ms) - delta=$((current_time - last_time)) - if [[ $delta -gt 50 ]]; then - gen_output - # reset debounce timer - last_time=$(get_time_ms) - fi - done -fi diff --git a/home/services/eww/scripts/indicators b/home/services/eww/scripts/indicators deleted file mode 100755 index 9f6416d3..00000000 --- a/home/services/eww/scripts/indicators +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -prevMic="" -prevScreen="" - -gen_output() { - mic=$(eww get volume) - # no standard way of getting camera info - # camerareveal=$(eww get camerareveal) - screen=$(eww get hyprland) - - if [ "$screen" != "$prevScreen" ] || [ "$mic" != "$prevMic" ]; then - micreveal=$(echo "$mic" | jaq -r '.in_use') - screenreveal=$(echo "$screen" | jaq -r '.screenshare') - - json='[' - - if [ "$micreveal" -ge 1 ]; then - json+='{"name": "Microphone", "icon": "", "class": "micshare"}' - fi - if [ "$screenreveal" = "true" ]; then - json+="$([ "$json" == "[" ] || echo ',')"'{"name": "Screen", "icon": "", "class": "screenshare"}' - fi - # if [ "$camerareveal" = "true" ]; then - # json+='{"name": "Camera", "icon": "", "class": "camerashare"}' - # fi - - json+=']' - - echo "$json" - prevMic="$mic" - prevScreen="$screen" - fi -} - -gen_output -sleep 1 -while true; do - gen_output - sleep 1 -done diff --git a/home/services/eww/scripts/net b/home/services/eww/scripts/net deleted file mode 100755 index 6a5485ba..00000000 --- a/home/services/eww/scripts/net +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash - -# Script to listen for networkmanager updates and return an appriopriate icon and tooltip. -# This script runs until it's manually terminated. - -# Requires: NetworkManager, gawk -# Usage: networkmanager - -# shellcheck source=/dev/null -source "$(dirname "$0")"/utils - -# get initialize network device info and states -nm="$(nmcli d | jc --nmcli | jaq -r '.[] | select(.type | test("^(wifi|ethernet)$", "ix"))')" -icons=("" "" "" "" "") - -function sanitize() { - echo "${1//\"/\\\"}" -} - -function toggle() { - status=$(rfkill -J | jaq -r '.rfkilldevices[] | select(.type == "wlan") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block wlan - else - rfkill unblock wlan - fi -} - -function gen_wifi() { - signal=$(nmcli -t -f in-use,ssid,signal dev wifi | rg '\*' | sed 's/\"/\\"/g' | awk -F: '{print $3}') - level=$(awk -v n="$signal" 'BEGIN{print int((n-1)/20)}') - if [ "$level" -gt 4 ]; then - level=4 - fi - - icon=${icons[$level]} - text=$(echo "$nm" | jaq -r 'select(.type == "wifi") .connection') -} - -function gen_ethernet() { - icon="" - text=$(echo "$nm" | jaq -r 'select(.type == "ethernet") .connection') -} - -function make_content() { - local ethernet wifi - ethernet=$(echo "$nm" | jaq -r 'select(.type == "ethernet") .state') - wifi=$(echo "$nm" | jaq -r 'select(.type == "wifi") .state') - - # test ethernet first - if [[ $ethernet == "connected" ]]; then - gen_ethernet - state="enabled" - elif [[ $wifi == "connected" ]]; then - gen_wifi - state="enabled" - else - icon="" - text="Disconnected" - state="disabled" - fi - - echo '{"icon": "'"$icon"'", "text": "'"$(sanitize "$text")"'", "state": "'"$state"'"}' -} - -# first run -make_content -last_time=$(get_time_ms) - -nmcli monitor | while read -r _; do - current_time=$(get_time_ms) - delta=$((current_time - last_time)) - # 50ms debounce - if [[ $delta -gt 50 ]]; then - sleep 0.5 - nm="$(nmcli d | jc --nmcli | jaq -r '.[] | select(.type | test("^(wifi|ethernet)$", "ix"))')" - make_content - # reset debounce timer - last_time=$(get_time_ms) - fi -done diff --git a/home/services/eww/scripts/theme-switcher b/home/services/eww/scripts/theme-switcher deleted file mode 100755 index ad68437d..00000000 --- a/home/services/eww/scripts/theme-switcher +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -if [[ $1 != "light" ]] && [[ $1 != "dark" ]]; then - echo "Theme can be either 'light' or 'dark'" - exit 1 -fi - -HMPATH=$(rg ExecStart /run/current-system/etc/systemd/system/home-manager-mihai.service | cut -d' ' -f2) -HMPATH+="/specialisation/$1/activate" - -$HMPATH diff --git a/home/services/eww/scripts/utils b/home/services/eww/scripts/utils deleted file mode 100644 index bdf4e157..00000000 --- a/home/services/eww/scripts/utils +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -if [ ! "$XDG_CACHE_HOME" ]; then - XDG_CACHE_HOME="/home/mihai/.local/cache" -fi - -function get_time_ms { - date -u +%s%3N -} - -function osd { - date="$1" - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - fi - date +%s >"$date" -} - -function osd_handler { - lock=0 - rundate=0 - OBJ="$1" - - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - echo 0 >"$date" - fi - - while true; do - # get dates - rundate=$(cat "$date") - currentdate=$(date +%s) - - # handle showing - if [ "$rundate" = "$currentdate" ] && [ "$lock" -eq 0 ]; then - eww update "$OBJ"=true >/dev/null 2>&1 - lock=1 - elif [ "$((currentdate - rundate))" = "2" ] && [ "$lock" -eq 1 ]; then - eww update "$OBJ"=false >/dev/null 2>&1 - lock=0 - fi - - sleep 0.1 - done -} diff --git a/home/services/eww/scripts/volume b/home/services/eww/scripts/volume deleted file mode 100755 index 196198b9..00000000 --- a/home/services/eww/scripts/volume +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck source=/dev/null -source "$(dirname "$0")"/utils - -volicons=("" "" "") -date="$XDG_CACHE_HOME/eww/osd_vol.date" - -vol() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | awk '{print int($2*100)}' -} -ismuted() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | rg -qi muted - echo -n $? -} -setvol() { - wpctl set-volume @DEFAULT_AUDIO_"$1"@ "$(awk -v n="$2" 'BEGIN{print (n / 100)}')" -} -setmute() { - wpctl set-mute @DEFAULT_AUDIO_"$1"@ toggle -} - -gen_output() { - percent="$(vol "SINK")" - if [[ "$event" == *source* ]]; then - pactl list sources | rg -q RUNNING - [ $? -eq 1 ] && in_use=0 || in_use=1 - else - lvl=$(awk -v n="$percent" 'BEGIN{print int(n/34)}') - ismuted=$(ismuted "SINK") - - if [ "$ismuted" = 1 ]; then - icon="${volicons[$lvl]}" - else - icon="" - fi - fi - - echo '{"icon": "'"$icon"'", "percent": "'"$percent"'", "microphone": "'"$(vol "SOURCE")"'", "in_use": "'"$in_use"'"}' -} - -case "$1" in -"mute") - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only mute SINK or SOURCE" - exit 1 - fi - setmute "$2" - ;; - -"setvol") - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only set volume for SINK or SOURCE" - exit 1 - elif [ "$3" -lt 0 ] || [ "$3" -gt 100 ]; then - echo "Volume must be between 0 and 100" - exit 1 - fi - setvol "$2" "$3" - ;; - -"osd") - osd "$date" - ;; - -"") - # initial values - in_use=0 - last_time=$(get_time_ms) - gen_output - osd_handler "osd-volume" & - - # event loop - pactl subscribe | rg --line-buffered ".*(source|sink).*" | while read -r event; do - current_time=$(get_time_ms) - delta=$((current_time - last_time)) - # 50ms debounce - if [[ $delta -gt 50 ]]; then - gen_output - # reset debounce timer - last_time=$(get_time_ms) - fi - done - ;; - -*) echo "wrong usage" ;; -esac diff --git a/home/services/eww/variables.yuck b/home/services/eww/variables.yuck deleted file mode 100644 index d05b8937..00000000 --- a/home/services/eww/variables.yuck +++ /dev/null @@ -1,20 +0,0 @@ -(defvar bright_reveal false) -(defvar bt_rev false) -(defvar music_reveal false) -(defvar net_rev false) -(defvar time_rev false) -(defvar vol_reveal false) -(defvar osd-brightness false) -(defvar osd-volume false) -(defvar battery_icons `["","","","","","","",""]`) - -(deflisten airplane "scripts/airplane") -(deflisten battery "gross battery") -(deflisten bluetooth "scripts/bluetooth") -(deflisten brightness "scripts/brightness") -(deflisten indicators "scripts/indicators") -(deflisten music "gross music") -(deflisten music_time "gross music-time") -(deflisten net "scripts/net") -(deflisten volume "scripts/volume") -(deflisten hyprland "gross hyprland") diff --git a/home/services/eww/windows/bar.yuck b/home/services/eww/windows/bar.yuck deleted file mode 100644 index 0849317b..00000000 --- a/home/services/eww/windows/bar.yuck +++ /dev/null @@ -1,56 +0,0 @@ -; bar modules alignment -(defwidget left [] - (box - :space-evenly false - :halign "start" - (workspaces) - (indicators))) - -(defwidget center [] - (box - :space-evenly false - :halign "center" - (music-module))) - -(defwidget sysbox [] - (eventbox - :onclick "eww open --toggle system-menu" - (box - (net) - (bluetooth) - (battery-module)))) - -(defwidget right [] - (box - :space-evenly false - :halign "end" - (sys-indicator - :property "CPU" - :value {round(EWW_CPU.avg,0)} - :tooltip "${round(EWW_CPU.cores[0].freq/1000,2)} GHz") - (sys-indicator - :property "MEM" - :value {round(EWW_RAM.used_mem_perc,0)} - :tooltip {EWW_RAM.used_mem / GB < 1 ? "${round(EWW_RAM.used_mem / MB, 1)} M used" : "${round(EWW_RAM.used_mem / GB, 1)} G used"}) - (sysbox) - (clock_module))) - -(defwidget bar-box [] - (centerbox - (left) - (center) - (right))) - -(defwindow bar - :monitor 0 - :geometry - (geometry - :x "0%" - :y "0%" - :width "100%" - :height "32px" - :anchor "top center") - :stacking "fg" - :exclusive true - :namespace "bar" - (bar-box)) diff --git a/home/services/eww/windows/calendar.yuck b/home/services/eww/windows/calendar.yuck deleted file mode 100644 index e087b0f5..00000000 --- a/home/services/eww/windows/calendar.yuck +++ /dev/null @@ -1,15 +0,0 @@ -(defwidget calendar-window [] - (box - :class "text calendar-window" - (calendar))) - -(defwindow calendar - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "top right" - :width "0px" - :height "0px") - :namespace "eww-calendar" - (calendar-window)) diff --git a/home/services/eww/windows/music.yuck b/home/services/eww/windows/music.yuck deleted file mode 100644 index 3e9e2763..00000000 --- a/home/services/eww/windows/music.yuck +++ /dev/null @@ -1,93 +0,0 @@ -(defwidget music [] - (box - :class "music-window" - :space-evenly false - ; force background position/size, otherwise it is overridden - :style " - background-image: url('${music.background}'); - background-position: center; - background-size: cover; - " - - (box ; cover art, first child - :class "cover" - :style "background-image: url('${music.cover}');") - - (box ; music info, second child - :orientation "v" - :space-evenly false - :class "music-box" - :style "background: none;" - (scroll - :hscroll true - :vscroll false - (label ; title - :class "title text" - :style "color: ${music.foreground};" - :justify "center" - :text {music.title})) - (scroll - :hscroll true - :vscroll false - (label ; artist - :class "artist text" - :style "color: ${music.foreground};" - :justify "center" - :text {music.artist})) - - (centerbox ; buttons - :halign "center" - :class "buttons" - (button - :onclick "playerctl previous" - (label - :style "color: ${music.foreground};" - :class "icon" - :text "")) - (button - :onclick "playerctl play-pause" - (label - :style "color: ${music.foreground};" - :class "icon" - :text {music.status == "Playing" ? "" : "" })) - (button - :onclick "playerctl next" - (label - :style "color: ${music.foreground};" - :class "icon" - :text ""))) - - (box ; time info - :orientation "v" - (box - :class "text" - (label - :xalign 0 - :class "music-time" - :style "color: ${music.foreground};" - :text {music_time.position}) - (label - :xalign 1 - :class "music-time" - :style "color: ${music.foreground};" - :text {music.duration})) - (box ; clickable progress bar - :class "music-bar" - (scale - ; transform scale position percentage into song position - :onchange "playerctl position `awk -v len=$(playerctl metadata mpris:length) 'BEGIN{print {} * len / 1000000 / 100}'`" - :css ".top { background: ${music.foreground}; }" - :value {music_time.position_percent})))))) - -(defwindow music - :stacking "fg" - :focusable false - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :width "0%" - :height "0%" - :anchor "top center") - :namespace "eww-music" - (music)) diff --git a/home/services/eww/windows/osd.yuck b/home/services/eww/windows/osd.yuck deleted file mode 100644 index 9c9623dd..00000000 --- a/home/services/eww/windows/osd.yuck +++ /dev/null @@ -1,46 +0,0 @@ -; shared OSD code for volume/brightnes -(defwidget osd-part [icon value class] - (box - :class "osd-part osd-${class}" - :space-evenly false - (label - :class "icon" - :text icon) - (scale - :value value))) - -; osd window widget -(defwidget osd [] - (box - :class "osd-container" - :orientation "v" - :space-evenly false - ; use revealers for both volume and brightness - (revealer - :reveal {osd-brightness} - :transition "none" - (osd-part - :class "brightness" - :icon {brightness.icon} - :value {brightness.percent})) - (revealer - :reveal {osd-volume} - :transition "none" - (osd-part - :class "volume" - :icon {volume.icon} - :value {volume.percent}))) -) - -(defwindow osd - :stacking "fg" - :focusable false - :monitor 0 - :geometry (geometry - :x "0%" - :y "20%" - :width "0%" - :height "0%" - :anchor "center bottom") - :namespace "eww-osd" - (osd)) diff --git a/home/services/eww/windows/system-menu.yuck b/home/services/eww/windows/system-menu.yuck deleted file mode 100644 index 4862b423..00000000 --- a/home/services/eww/windows/system-menu.yuck +++ /dev/null @@ -1,103 +0,0 @@ -(defwidget toggle [name var command icon] - (eventbox - :onclick "eww close system-menu; ${command} &" - (box - :space-evenly false - :class "toggle ${var.state}" - (button - :class "button" - :onclick "scripts/${name} toggle" - (label - :class "icon" - :text {icon})) - (label - :class "text" - :wrap true - :text `${var.text} ${var.battery ?: ""}`)))) - -(defwidget system-menu [] - (box - :class "system-menu-window" - :orientation "v" - :space-evenly false - (box ; wifi/bluetooth/airplane buttons - :orientation "v" - :class "toggles" - (toggle - :name "net" - :var net - :command "XDG_CURRENT_DESKTOP=GNOME gnome-control-center" - :icon {net.icon}) - (toggle - :name "bluetooth" - :var bluetooth - :command "blueberry" - :icon {bluetooth.state == "connected" ? "" : bluetooth.state == "enabled" ? "" : ""}) - (toggle - :name "airplane" - :var airplane - :command "" - :icon {airplane.icon})) - - (box ; brightness & volume sliders - :class "sliders" - :orientation "v" - (box - :class "volume" - :space-evenly false - (label - :class "icon" - :text {volume.icon}) - (scale - :value {volume.percent} - :tooltip "volume on ${volume.percent}%" - :onchange "scripts/volume setvol SINK {}")) - (box - :class "brightness" - :space-evenly false - (label - :class "icon" - :text {brightness.icon}) - (scale - :value {brightness.percent} - :tooltip "brightness on ${brightness.percent}%" - :onchange "brillo -S {}"))) - - (box ; battery info & power button - :space-evenly false - (box - :class "battery" - :space-evenly false - (label - :class "icon ${EWW_BATTERY.total_avg > 20 ? '' : 'low'}" - :text {battery_icons[round(EWW_BATTERY.total_avg / (100 / arraylength(battery_icons)) - 1,0)]}) - (label - :class "text" - :text {round(EWW_BATTERY.total_avg,0)}) - (label - :class "status text" - :text {battery.status}) - (label - :class "rate text" - :text {battery.rate})) - - (box - :hexpand true) - (button - :class "button power" - :onclick "wlogout -p layer-shell & eww close system-menu" - (label - :class "icon" - :text ""))))) - -(defwindow system-menu - :stacking "fg" - :monitor 0 - :geometry (geometry - :x "0" - :y "0" - :width "0%" - :height "0%" - :anchor "right top") - :namespace "system-menu" - (system-menu)) diff --git a/home/wayland/default.nix b/home/wayland/default.nix index e00fc058..cd1d36f1 100644 --- a/home/wayland/default.nix +++ b/home/wayland/default.nix @@ -1,9 +1,6 @@ { pkgs, lib, - self, - inputs, - config, ... }: # Wayland config @@ -23,18 +20,11 @@ in { ./hyprland ./swaylock.nix ../services/ags - ../services/eww ../services/hyprpaper.nix ../services/polkit-agent.nix ../services/swayidle.nix ]; - programs.eww-hyprland = { - enable = false; - package = inputs.eww.packages.${pkgs.system}.eww-wayland; - colors = builtins.readFile "${self}/home/services/eww/css/colors-${config.programs.matugen.variant}.scss"; - }; - home.packages = with pkgs; [ # screenshot grim diff --git a/home/wayland/hyprland/rules.nix b/home/wayland/hyprland/rules.nix index fce2a1bf..503cd843 100644 --- a/home/wayland/hyprland/rules.nix +++ b/home/wayland/hyprland/rules.nix @@ -4,12 +4,12 @@ in { wayland.windowManager.hyprland.settings = { # layer rules layerrule = let - layers = "^(eww-.+|bar|system-menu|anyrun|gtk-layer-shell|osd)$"; + layers = "^(bar|system-menu|anyrun|gtk-layer-shell|osd)$"; in [ "blur, ${layers}" "xray 1, ^(bar|gtk-layer-shell)$" "ignorealpha 0.2, ${layers}" - "ignorealpha 0.5, ^((eww-)?music|calendar|system-menu|anyrun)$" + "ignorealpha 0.5, ^(music|calendar|system-menu|anyrun)$" # "ignorealpha 0${ # if variant == "dark" # then ".5"