From 78d0f94f1ed7285af66fe81a08133a7702e35425 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sat, 19 Aug 2023 22:31:22 +0300 Subject: [PATCH] Merged anyrun styles --- README.md | 3 +- common/themes/default.nix | 17 ++--- home/features/wayland/anyrun/default.nix | 65 +++++++++++++++++--- home/features/wayland/default.nix | 1 - home/features/wayland/hyprland/hyprland.conf | 2 +- home/features/wayland/wofi/default.nix | 13 ---- home/features/wayland/wofi/wofi.css | 56 ----------------- modules/common/theming.nix | 13 ++++ pkgs/default.nix | 1 - pkgs/wofi-pass.nix | 18 ------ 10 files changed, 79 insertions(+), 110 deletions(-) delete mode 100644 home/features/wayland/wofi/default.nix delete mode 100644 home/features/wayland/wofi/wofi.css delete mode 100644 pkgs/wofi-pass.nix diff --git a/README.md b/README.md index cc29965..6de6352 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ Here's some things you might want to check out: - [Rosepine](https://rosepinetheme.com/) — another theme I use - [Hyprland](https://hyprland.org/) — wayland compositor - [Wlogout](https://github.com/ArtsyMacaw/wlogout) — wayland logout menu - - [Wofi](https://sr.ht/~scoopta/wofi/) — program launcher - [Hyprpicker](https://github.com/hyprwm/hyprpicker) — hyprland color picker - [Grimblast](https://github.com/hyprwm/contrib/tree/main/grimblast) — screenshot tool - [Dunst](https://dunst-project.org/) — notification daemon - [Wlsunset](https://sr.ht/~kennylevinsen/wlsunset/) — day/night screen gamma adjustements + - [Anyrun](https://github.com/Kirottu/anyrun) — program launcher - [Wezterm](https://wezfurlong.org/wezterm/) — terminal emulator - [Zathura](https://pwmt.org/projects/zathura/) — pdf viewer - [Firefox](https://www.mozilla.org/en-US/firefox/) — web browser @@ -97,6 +97,7 @@ Here's some things you might want to check out: Includes links to stuff which used to be in the previous section but is not used anymore. Only created this section in June 2023, so stuff I used earlier might not be here. +- [Wofi](https://sr.ht/~scoopta/wofi/) — program launcher - [Alacritty](https://github.com/alacritty/alacritty) — terminal emulator - [Xmonad](https://xmonad.org/) — xorg window manager - [Polybar](https://github.com/polybar/polybar) — desktop bar diff --git a/common/themes/default.nix b/common/themes/default.nix index 6ee385e..e3f28bc 100644 --- a/common/themes/default.nix +++ b/common/themes/default.nix @@ -8,9 +8,7 @@ let base16Scheme = "${inputs.catppuccin-base16}/base16/mocha.yaml"; polarity = "dark"; }; - satellite = { - transparency.value = 1.0; - }; + satellite = { }; }; catppuccin-latte = { @@ -22,6 +20,7 @@ let }; satellite = { transparency.value = 0.6; + rounding.radius = 8; }; }; # }}} @@ -32,9 +31,7 @@ let base16Scheme = "${inputs.rosepine-base16}/rose-pine-dawn.yaml"; polarity = "light"; }; - satellite = { - transparency.value = 1.0; - }; + satellite = { }; }; # }}} # {{{ Experiment: AI generated themes @@ -45,9 +42,7 @@ let base16Scheme = ./gpt-themes/monopurple-light.yaml; polarity = "light"; }; - satellite = { - transparency.value = 1.0; - }; + satellite = { }; }; purplepink-light = { @@ -56,9 +51,7 @@ let base16Scheme = ./gpt-themes/purplepink-light.yaml; polarity = "light"; }; - satellite = { - transparency.value = 1.0; - }; + satellite = { }; }; }; # }}} diff --git a/home/features/wayland/anyrun/default.nix b/home/features/wayland/anyrun/default.nix index ab944ca..e911602 100644 --- a/home/features/wayland/anyrun/default.nix +++ b/home/features/wayland/anyrun/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: { +{ inputs, pkgs, config, ... }: { programs.anyrun = { enable = true; config = { @@ -25,7 +25,63 @@ maxEntries = 7; }; - extraCss = null; + extraCss = '' + /* {{{ Global overrides */ + #window, + #entry, + #main, + #plugin, + #match { + background: transparent; + } + + * { + font-size: 2rem; + outline: none; + } + /* }}} */ + /* {{{ Transparent & raised surfaces */ + #entry, + list#main, + row#match:selected { + box-shadow: 0.5px 0.5px 1.5px 1.5px rgba(0, 0, 0, 0.5); + border-radius: ${config.theming.rounding.radius}px; + } + + #entry, + list#main { + margin: 1rem; + background: rgba(${config.theming.colors.rgba "base00"}); + min-height: 1rem; + } + /* }}} */ + /* {{{ Input */ + #entry { + font-size: 2rem; + padding: 1rem; + border: none; + } + /* }}} */ + /* {{{ Matches */ + row#match { + margin: 0.7rem; + margin-bottom: 0.3rem; + color: ${config.lib.stylix.scheme.withHashtag.base05}; + padding: 0.5rem; + transition: none; + } + + row#match:last-child { + margin-bottom: 0.7rem; + } + + #match:selected { + padding: 0.5rem; + color: ${config.lib.stylix.scheme.withHashtag.base05}; + background: rgba(${config.satellite.theming.colors.rgb "base03"}, 0.2); + } + /* }}} */ + ''; }; # # See [the readme](https://github.com/n3oney/anyrun-nixos-options) for anyrun-nixos-options. @@ -34,9 +90,4 @@ # options_path: "${config.system.build.manual.optionsJSON}/share/doc/nixos/options.json" # ) # ''; - - # home.packages = - # let anyrunScript = name: plugin: pkgs.writeShellScriptBin "anyrun-${plugin}"; - # in - # [ (anyrunScript "launch" "applications") ]; } diff --git a/home/features/wayland/default.nix b/home/features/wayland/default.nix index a629d5c..0b8d121 100644 --- a/home/features/wayland/default.nix +++ b/home/features/wayland/default.nix @@ -4,7 +4,6 @@ ./dunst.nix ./wlsunset.nix ./wlogout.nix - ./wofi ./anyrun ../desktop/wezterm # Default hyprland terminal ../desktop/batsignal.nix diff --git a/home/features/wayland/hyprland/hyprland.conf b/home/features/wayland/hyprland/hyprland.conf index 93159ad..b5018db 100644 --- a/home/features/wayland/hyprland/hyprland.conf +++ b/home/features/wayland/hyprland/hyprland.conf @@ -9,7 +9,7 @@ general { } decoration { - rounding = 10 # Rounded corners of 10px + rounding = 8 # TODO: inject from nix active_opacity = 1 inactive_opacity = 1 diff --git a/home/features/wayland/wofi/default.nix b/home/features/wayland/wofi/default.nix deleted file mode 100644 index 129a205..0000000 --- a/home/features/wayland/wofi/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, ... }: -{ - programs.wofi = { - enable = true; - settings = { - allow_markup = true; - allow_images = true; - }; - }; - - xdg.configFile."wofi/style.css".source = config.satellite.dev.path "home/features/wayland/wofi/wofi.css"; -} - diff --git a/home/features/wayland/wofi/wofi.css b/home/features/wayland/wofi/wofi.css deleted file mode 100644 index c79ba72..0000000 --- a/home/features/wayland/wofi/wofi.css +++ /dev/null @@ -1,56 +0,0 @@ -/* Styling guide: https://cloudninja.pw/docs/wofi.html */ -window { - background: none; -} - -#outer-box { - margin: 3px; - border-radius: 8px; - /* box-shadow: .5px .5px 1.5px 1.5px rgba(0, 0, 0, .5); */ - /* background-color: rgba(256, 256, 256, 0.6); */ -} - -#input { - margin: 1rem; - padding: 1rem; - font-size: 2em; - border-radius: 8px; - box-shadow: 0.5px 0.5px 1.5px 1.5px rgba(0, 0, 0, 0.5); - /* background: none; */ - background-color: rgba(256, 256, 256, 0.6); -} - -#scroll { - margin: 1rem; - border-radius: 8px; - box-shadow: 0.5px 0.5px 1.5px 1.5px rgba(0, 0, 0, 0.5); - /* background: none; */ - background-color: rgba(256, 256, 256, 0.6); -} - -#entry { - margin: 0.7rem; - margin-bottom: 0; - color: #4c4f69; - border-radius: 8px; -} - -#text { - margin: 0.5rem; - font-size: 1.5em; -} - -#img { - margin-left: 0.5rem; -} - -#entry:selected { - outline: none; - color: #4c4f69; - background: rgba(188, 192, 204, 0.2); - box-shadow: 0.5px 0.5px 1.5px 1.5px rgba(0, 0, 0, 0.5); -} - -#text:selected { - color: #4c4f69; -} diff --git a/modules/common/theming.nix b/modules/common/theming.nix index e848a82..3978268 100644 --- a/modules/common/theming.nix +++ b/modules/common/theming.nix @@ -8,11 +8,23 @@ in enable = lib.mkEnableOption "transparency for desktop apps"; value = lib.mkOption { description = "How transparent windows should be by default"; + default = 1.0; example = 0.6; type = lib.types.float; }; }; + rounding = { + enable = lib.mkEnableOption "rounded corners for desktop apps"; + radius = lib.mkOption { + description = "How much to round corners by deafault"; + default = 0; + example = 10; + type = lib.types.float; + }; + }; + + get = lib.mkOption { # No generics:( # The type of this is essentially (written in pseudocode): @@ -43,6 +55,7 @@ in config.satellite.theming = { transparency.enable = cfg.transparency.value < 1.0; + rounding.enable = cfg.rounding.radius > 0.0; get = themeMap: themeMap.${config.lib.stylix.scheme.scheme} diff --git a/pkgs/default.nix b/pkgs/default.nix index bc0c55b..5deb8fd 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,7 +6,6 @@ let plymouthThemes = pkgs.callPackage (import ./plymouth-themes.nix) { }; in { # example = pkgs.callPackage (import ./example.nix) {}; vimclip = pkgs.callPackage (import ./vimclip.nix) { }; - wofi-pass = pkgs.callPackage (import ./wofi-pass.nix) { }; plymouthThemeCutsAlt = plymouthThemes.cuts_alt; } diff --git a/pkgs/wofi-pass.nix b/pkgs/wofi-pass.nix deleted file mode 100644 index 2d20d47..0000000 --- a/pkgs/wofi-pass.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: -pkgs.stdenv.mkDerivation { - name = "wofi-pass"; - version = "unstable-2023-05-12"; - - src = pkgs.fetchFromGitHub { - rev = "4468bbedf55ae1de47d178d39b60249d390b1d62"; - owner = "schmidtandreas"; - repo = "wofi-pass"; - sha256 = "01sdz5iq9rqgd54d27qqq7f8b5ck64b0908lj9c4nkyw3vcplzar"; - }; - - installPhase = '' - mkdir -p $out/bin - cp ./wofi-pass $out/bin/wofi-pass - chmod +x $out/bin/wofi-pass - ''; -}