From 70a1c8ba61133dbdde902d8ce40f38a15db3a172 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Sat, 30 Mar 2024 21:23:52 +0100 Subject: [PATCH] rofi and stuff --- flake.lock | 6 +- home/config-files/hyprland.conf | 6 +- home/config-files/rofi/catppuccin-mocha.rasi | 111 +++++++++++++++++++ home/config-files/rofi/config.rasi | 18 +++ home/default.nix | 1 + home/modules/home-pkgs.nix | 2 + home/modules/nixvim.nix | 4 +- home/modules/rofi.nix | 103 +++++++++++++++++ hosts/x86_64-linux/lilith/default.nix | 7 +- 9 files changed, 246 insertions(+), 12 deletions(-) create mode 100644 home/config-files/rofi/catppuccin-mocha.rasi create mode 100644 home/config-files/rofi/config.rasi create mode 100644 home/modules/rofi.nix diff --git a/flake.lock b/flake.lock index c1fe159..3c15f87 100644 --- a/flake.lock +++ b/flake.lock @@ -317,11 +317,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1711629990, - "narHash": "sha256-GrFpJqyudEkhg4wPIX5iDvjE9W7s4nrg330zf7L0BAE=", + "lastModified": 1711651867, + "narHash": "sha256-QR1P5wE+K+P86HsTcA1vK7zPVIibrEfykETUGE8aZ9A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3e603e788171c64c4f1a0a7901c860fbcd13f0c", + "rev": "7cdbfcbbd2b142800ef6ca2d53ce86b24b1c5f1f", "type": "github" }, "original": { diff --git a/home/config-files/hyprland.conf b/home/config-files/hyprland.conf index f32638d..3db6aa4 100644 --- a/home/config-files/hyprland.conf +++ b/home/config-files/hyprland.conf @@ -114,14 +114,14 @@ windowrulev2 = float,class:^(wezterm)$,title:^(wezterm)$ $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod SHIFT, return, exec, wezterm +bind = $mainMod SHIFT, return, exec, wezterm-gui bind = $mainMod SHIFT, Q, killactive, bind = $mainMod SHIFT, X, exit, bind = $mainMod, L, exec, swaylock --indicator --clock --effect-blur 7x5 -e -f -i "~/dotfiles_new/walls/walls/1543142967600.jpg" bind = $mainMod SHIFT, SPACE, togglefloating, -bind = $mainMod, P, exec, tofi-drun --drun-launch=true -bind = $mainMod SHIFT, P, exec, tofi-run --drun-launch=true +bind = $mainMod, P, exec, rofi -show drun +bind = $mainMod SHIFT, P, exec, rofi -show drun bind = $mainMod SHIFT, P, exec, tofi, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod SHIFT, I, exec, grimshot copy area diff --git a/home/config-files/rofi/catppuccin-mocha.rasi b/home/config-files/rofi/catppuccin-mocha.rasi new file mode 100644 index 0000000..38c0b80 --- /dev/null +++ b/home/config-files/rofi/catppuccin-mocha.rasi @@ -0,0 +1,111 @@ +* { + bg-col: #1e1e2e; + bg-col-light: #1e1e2e; + border-col: #1e1e2e; + selected-col: #1e1e2e; + blue: #89b4fa; + fg-col: #cdd6f4; + fg-col2: #f38ba8; + grey: #6c7086; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 360px; + border: 3px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 0px 0px 20px; + columns: 2; + lines: 5; + background-color: @bg-col; +} + +element { + padding: 5px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} diff --git a/home/config-files/rofi/config.rasi b/home/config-files/rofi/config.rasi new file mode 100644 index 0000000..4f0c514 --- /dev/null +++ b/home/config-files/rofi/config.rasi @@ -0,0 +1,18 @@ +configuration{ + modi: "run,drun,window"; + icon-theme: "Oranchelo"; + show-icons: true; + terminal: "wezterm"; + drun-display-format: "{icon} {name}"; + location: 0; + disable-history: false; + hide-scrollbar: true; + display-drun: "  Apps "; + display-run: "  Run "; + display-window: " 﩯 Window"; + display-Network: " 󰤨 Network"; + sidebar-mode: true; +} + +@theme "catppuccin-mocha" + diff --git a/home/default.nix b/home/default.nix index ce6b44b..97e2db3 100644 --- a/home/default.nix +++ b/home/default.nix @@ -13,6 +13,7 @@ ./modules/gtk.nix ./modules/home-pkgs.nix ./modules/git.nix + ./modules/rofi.nix #./modules/ssh.nix ]; home.username = "xqtc"; diff --git a/home/modules/home-pkgs.nix b/home/modules/home-pkgs.nix index 32f1748..d75a5cc 100644 --- a/home/modules/home-pkgs.nix +++ b/home/modules/home-pkgs.nix @@ -68,6 +68,8 @@ in { pkgs.jellyfin-media-player #pkgs.feishin + pkgs.nix-tree + pkgs.nixos-icons pkgs.swww ] diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index 97c36c9..23813b8 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -32,9 +32,9 @@ copilot-lua = { enable = true; suggestion = { - enabled = false; + enabled = false; }; - panel.enabled = false; + panel.enabled = false; }; copilot-cmp.enable = true; lsp = { diff --git a/home/modules/rofi.nix b/home/modules/rofi.nix new file mode 100644 index 0000000..3e89629 --- /dev/null +++ b/home/modules/rofi.nix @@ -0,0 +1,103 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: { + programs.rofi = { + enable = true; + extraConfig = { + terminal = "wezterm"; + disable-history = false; + show-icons = true; + sidebar-mode = true; + sort = true; + drun-display-format = "{icon} {name}"; + display-drun = "  Run "; + modi = lib.strings.concatStringsSep "," [ + "run" + "drun" + "filebrowser" + ]; + font = "Hack Nerd Font Mono 13"; + }; + theme = let mkLiteral = config.lib.formats.rasi.mkLiteral; + in { + "*" = { + bg = mkLiteral "#303446FF"; + fg = mkLiteral "#D9E0EEFF"; + ac = mkLiteral "#8CAAEEFF"; + }; + + "#window" = { + location = mkLiteral "center"; + width = mkLiteral "50%"; + }; + + "#prompt" = { + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + }; + + "#textbox-prompt-colon" = { + text-color = mkLiteral "@fg"; + }; + + "#entry" = { + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + blink = mkLiteral "true"; + }; + + "#inputbar" = { + children = mkLiteral "[ prompt, entry ]"; + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + padding = mkLiteral "5px"; + }; + + "#listview" = { + background-color = mkLiteral "@bg"; + columns = mkLiteral "1"; + lines = mkLiteral "5"; + cycle = mkLiteral "false"; + dynamic = mkLiteral "true"; + }; + + "#mainbox" = { + background-color = mkLiteral "@bg"; + border = mkLiteral "3px"; + border-color = mkLiteral "@ac"; + children = mkLiteral "[ inputbar, listview ]"; + padding = mkLiteral "10px"; + }; + + "#element" = { + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + padding = mkLiteral "5px"; + }; + + "#element-icon" = { + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + size = mkLiteral "32px"; + }; + + "#element-text" = { + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@fg"; + padding = mkLiteral "5px"; + }; + + "#element selected" = { + border = mkLiteral "3px"; + border-color = mkLiteral "@ac"; + }; + }; + }; + #home.file.".config/rofi/config.rasi".text = builtins.readFile ../config-files/rofi/config.rasi; + #home.file.".local/share/rofi/themes/catppuccin-mocha.rasi".text = builtins.readFile ../config-files/rofi/catppuccin-mocha.rasi; +} + diff --git a/hosts/x86_64-linux/lilith/default.nix b/hosts/x86_64-linux/lilith/default.nix index e16a56f..d3e8025 100644 --- a/hosts/x86_64-linux/lilith/default.nix +++ b/hosts/x86_64-linux/lilith/default.nix @@ -75,10 +75,9 @@ # }; # Enable the X11 windowing system. - # services.xserver.enable = true; - # services.xserver.displayManager.gdm.enable = true; - #services.xserver.displayManager.ly.enable = true; - # services.xserver.desktopManager.gnome.enable = true; + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; #services.xserver.displayManager.defaultSession = "plasmawayland"; # services.xserver.videoDrivers = ["intel"];