From 31099da0250e8a240239ba0a89894310b78d39e9 Mon Sep 17 00:00:00 2001 From: Ceres Date: Tue, 6 Jan 2026 16:58:34 +0000 Subject: [PATCH] Begin transition to niri --- fish/conf.d/fish_frozen_key_bindings.fish | 14 ++ fish/config.fish | 2 +- fish/functions/fish_greeting.fish | 4 +- foot/colours.ini | 21 +++ foot/foot.ini | 3 + hypr/hyprland/keybinds.conf | 1 + niri/colours.kdl | 7 + niri/config.kdl | 94 ++++++---- niri/random-wallpaper.sh | 6 + quickshell/pass/shell.qml | 198 ++++++++++++++++++++++ quickshell/{ => shell}/Wallpaper.qml | 5 +- quickshell/{ => shell}/shell.qml | 0 wallpapers/current | 2 +- wallust/templates/foot | 21 +++ wallust/templates/niri | 7 + wallust/wallust.toml | 16 ++ 16 files changed, 361 insertions(+), 40 deletions(-) create mode 100644 fish/conf.d/fish_frozen_key_bindings.fish create mode 100644 foot/colours.ini create mode 100644 niri/colours.kdl create mode 100755 niri/random-wallpaper.sh create mode 100644 quickshell/pass/shell.qml rename quickshell/{ => shell}/Wallpaper.qml (69%) rename quickshell/{ => shell}/shell.qml (100%) create mode 100644 wallust/templates/foot create mode 100644 wallust/templates/niri create mode 100644 wallust/wallust.toml diff --git a/fish/conf.d/fish_frozen_key_bindings.fish b/fish/conf.d/fish_frozen_key_bindings.fish new file mode 100644 index 0000000..495aee9 --- /dev/null +++ b/fish/conf.d/fish_frozen_key_bindings.fish @@ -0,0 +1,14 @@ +# This file was created by fish when upgrading to version 4.3, to migrate +# the 'fish_key_bindings' variable from its old default scope (universal) +# to its new default scope (global). We recommend you delete this file +# and configure key bindings in ~/.config/fish/config.fish if needed. + +# set --global fish_key_bindings fish_default_key_bindings + +# Prior to version 4.3, fish shipped an event handler that runs +# `set --universal fish_key_bindings fish_default_key_bindings` +# whenever the fish_key_bindings variable is erased. +# This means that as long as any fish < 4.3 is still running on this system, +# we cannot complete the migration. +# As a workaround, erase the universal variable at every shell startup. +set --erase --universal fish_key_bindings diff --git a/fish/config.fish b/fish/config.fish index cf0aed7..93563d2 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -42,7 +42,7 @@ if status is-interactive abbr lla 'ls -la' # Custom colours - cat ~/.local/state/caelestia/sequences.txt 2>/dev/null + #cat ~/.local/state/caelestia/sequences.txt 2>/dev/null # For jumping between prompts in foot terminal function mark_prompt_start --on-event fish_prompt diff --git a/fish/functions/fish_greeting.fish b/fish/functions/fish_greeting.fish index 4b0b084..1cf3aa3 100644 --- a/fish/functions/fish_greeting.fish +++ b/fish/functions/fish_greeting.fish @@ -1,10 +1,10 @@ function fish_greeting set num $(random 1 4) - echo -ne '\x1b[38;5;16m' # Set colour to primary + echo -ne '\x1b[36;16m' # Set colour to primary echo '▄▖ ▄▖ ▄▖▜ ▜ ' echo '▌ █▌▛▘█▌▛▘▄▖▚ █▌█▌▛▘▄▖▌▌▐ ▐ ' echo '▙▖▙▖▌ ▙▖▄▌ ▄▌▙▖▙▖▄▌ ▛▌▐▖▐▖' echo '' - echo "$(cat ~/caelestia/fish/functions/$num)" + echo "$(cat ~/.caelestia/fish/functions/$num)" glafetch end diff --git a/foot/colours.ini b/foot/colours.ini new file mode 100644 index 0000000..0f7d739 --- /dev/null +++ b/foot/colours.ini @@ -0,0 +1,21 @@ +[colors] +foreground=F8E7D8 +background=0C0E0E + +regular0=373939 +regular1=3F4849 +regular2=6D7779 +regular3=89756A +regular4=AF7A5D +regular5=959C9E +regular6=EBBC8F +regular7=EDD5BF + +bright0=A69585 +bright1=3F4849 +bright2=6D7779 +bright3=89756A +bright4=AF7A5D +bright5=959C9E +bright6=EBBC8F +bright7=EDD5BF diff --git a/foot/foot.ini b/foot/foot.ini index a3cfd09..c31bb51 100644 --- a/foot/foot.ini +++ b/foot/foot.ini @@ -17,6 +17,9 @@ beam-thickness=1.5 [colors] alpha=0.78 +[main] +include=/home/ceres/.caelestia/foot/colours.ini + [key-bindings] scrollback-up-page=Page_Up scrollback-down-page=Page_Down diff --git a/hypr/hyprland/keybinds.conf b/hypr/hyprland/keybinds.conf index 14ed1b6..4343725 100644 --- a/hypr/hyprland/keybinds.conf +++ b/hypr/hyprland/keybinds.conf @@ -162,6 +162,7 @@ bind = $kbFileExplorer, exec, app2unit -- $fileExplorer bind = Super+Alt, E, exec, app2unit -- nemo bind = Ctrl+Alt, Escape, exec, app2unit -- qps bind = Ctrl+Alt, V, exec, app2unit -- pavucontrol +bind = Super, P, exec, qs -c pass # Utilities bindl = , Print, exec, caelestia screenshot # Full screen capture > clipboard diff --git a/niri/colours.kdl b/niri/colours.kdl new file mode 100644 index 0000000..c7f9ad1 --- /dev/null +++ b/niri/colours.kdl @@ -0,0 +1,7 @@ +layout { + border { + active-color "#3F4849" + inactive-color "#191D1D" + urgent-color "#6D7779" + } +} diff --git a/niri/config.kdl b/niri/config.kdl index cf9479f..32a5491 100644 --- a/niri/config.kdl +++ b/niri/config.kdl @@ -1,11 +1,5 @@ -// This config is in the KDL format: https://kdl.dev -// "/-" comments out the following node. -// Check the wiki for a full description of the configuration: -// https://yalter.github.io/niri/Configuration:-Introduction +include "colours.kdl" -// Input device configuration. -// Find the full list of options on the wiki: -// https://yalter.github.io/niri/Configuration:-Input input { keyboard { xkb { @@ -62,11 +56,11 @@ input { } // Uncomment this to make the mouse warp to the center of newly focused windows. - // warp-mouse-to-focus + warp-mouse-to-focus // Focus windows and outputs automatically when moving the mouse into them. // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - // focus-follows-mouse max-scroll-amount="0%" + focus-follows-mouse max-scroll-amount="100%" } // You can configure outputs by their name, which you can find @@ -113,6 +107,21 @@ layout { // Set gaps around windows in logical pixels. gaps 16 + // These set global defaults for blur, however it needs to be enabled + // individually on a per-window or per-layer basis as well for it to have + // any effect. + // + // Certain apps that support the KDE blur protocol may blur themselves as well. + blur { + noise 0.1 + passes 2 + radius 6 + + // Sensible default, gets applied to blurred layer surfaces, as most of the + // time, the actual surface is bigger than what is rendered on screen. + ignore-alpha 0.8 + } + // When to center a column when changing focus, options are: // - "never", default behavior, focusing an off-screen column will keep at the left // or right edge of the screen. @@ -191,25 +200,9 @@ layout { // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" } - // You can also add a border. It's similar to the focus ring, but always visible. border { - // The settings are the same as for the focus ring. - // If you enable the border, you probably want to disable the focus ring. on - width 4 - active-color "#ffc87f" - inactive-color "#505050" - - // Color of the border around windows that request your attention. - urgent-color "#9b0000" - - // Gradients can use a few different interpolation color spaces. - // For example, this is a pastel rainbow gradient via in="oklch longer hue". - // - // active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue" - - // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" } // You can enable drop shadows for windows. @@ -268,14 +261,15 @@ layout { // See the binds section below for more spawn examples. // This line starts waybar, a commonly used bar for Wayland compositors. -spawn-at-startup "qs" +spawn-sh-at-startup "/home/ceres/.caelestia/niri/random-wallpaper.sh" +spawn-sh-at-startup "qs -c shell" // To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: // spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" hotkey-overlay { // Uncomment this line to disable the "Important Hotkeys" pop-up at startup. - // skip-at-startup + skip-at-startup } // Uncomment this line to ask the clients to omit their client-side decorations if possible. @@ -283,7 +277,7 @@ hotkey-overlay { // Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. // This option will also fix border/focus ring drawing behind some semitransparent windows. // After enabling or disabling this, you need to restart the apps for this to take effect. -// prefer-no-csd +prefer-no-csd // You can change the path where screenshots are saved. // A ~ at the front will be expanded to the home directory. @@ -327,6 +321,22 @@ window-rule { open-floating true } +window-rule { + // This app-id regular expression will work for both: + // - host Firefox (app-id is "firefox") + // - Flatpak Firefox (app-id is "org.mozilla.firefox") + match title="^qs-pass$" + open-floating true +} + +window-rule { + // This app-id regular expression will work for both: + // - host Firefox (app-id is "firefox") + // - Flatpak Firefox (app-id is "org.mozilla.firefox") + match title="^wallpaper-selector$" + open-floating true +} + // Example: block out two password managers from screen capture. // (This example rule is commented out with a "/-" in front.) /-window-rule { @@ -345,7 +355,18 @@ window-rule { geometry-corner-radius 12 clip-to-geometry true draw-border-with-background false - opacity 0.95 + blur { + on + } +} + +layer-rule { + match namespace="^quickshell$" + place-within-backdrop true +} + +overview { + backdrop-color "#1e1e2e" } binds { @@ -366,8 +387,9 @@ binds { // Suggested binds for running programs: terminal, app launcher, screen locker. Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "foot"; } Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } - Mod+B { spawn "zen"; } Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } + Mod+B { spawn "zen"; } + Mod+P { spawn-sh "qs -c pass"; } // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. // Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`. @@ -589,10 +611,14 @@ binds { Mod+V { toggle-window-floating; } Mod+Shift+V { switch-focus-between-floating-and-tiling; } - // Toggle tabbed column display mode. - // Windows in this column will appear as vertical tabs, - // rather than stacked on top of each other. - Mod+W { toggle-column-tabbed-display; } + // Toggle tabbed tile display mode. + // Windows can be moved into or out of this tile using the + // `move-window-into-or-out-of-group` action; example: + Mod+W { toggle-group; } + Mod+Alt+H { move-window-into-or-out-of-group "left"; } + Mod+Alt+L { move-window-into-or-out-of-group "right"; } + Mod+Alt+K { move-window-into-or-out-of-group "up"; } + Mod+Alt+J { move-window-into-or-out-of-group "down"; } // Actions to switch layouts. // Note: if you uncomment these, make sure you do NOT have diff --git a/niri/random-wallpaper.sh b/niri/random-wallpaper.sh new file mode 100755 index 0000000..00a0929 --- /dev/null +++ b/niri/random-wallpaper.sh @@ -0,0 +1,6 @@ +#!/bin/bash +wallpaper_path="$(find ~/.caelestia/wallpapers -type f | shuf -n 1)" + +ln -sf ${wallpaper_path} "/home/ceres/.local/state/niri/wallpaper" + +wallust run "${wallpaper_path}" diff --git a/quickshell/pass/shell.qml b/quickshell/pass/shell.qml new file mode 100644 index 0000000..92b1baa --- /dev/null +++ b/quickshell/pass/shell.qml @@ -0,0 +1,198 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.LocalStorage +import Quickshell +import Quickshell.Widgets +import Quickshell.Io +import Qt.labs.folderlistmodel + +Window { + id: launcher + title: "qs-pass" + visible: true + flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint + color: Qt.rgba(0.117, 0.118, 0.180, 0.5) + width: 560 + height: 360 + + property string query: "" + property string passLocation: "" + + Process { + id: passCopy + running: false + command: ["pass", "-c", passLocation] + stdout: StdioCollector { + onStreamFinished: Qt.quit() + } + } + + Process { + id: userCopy + running: false + command: ["pass", "-c2", passLocation] + } + + function copyPass() { + if(list.currentItem.fileIsDir==true) { + folderModel.folder = folderModel.folder+"/"+list.currentItem.fileBaseName + } + else { + passLocation = list.currentItem.filePath + passLocation = passLocation.replace("/home/ceres/.password-store/", "") + passLocation = passLocation.replace(".gpg", "") + passCopy.running = true + } + } + + function copyUser() { + if(list.currentItem.fileIsDir==true) { + folderModel.folder = folderModel.folder+"/"+list.currentItem.fileBaseName + } + else { + passLocation = list.currentItem.filePath + passLocation = passLocation.replace("/home/ceres/.password-store/", "") + passLocation = passLocation.replace(".gpg", "") + userCopy.running = true + } + } + + ColumnLayout { + anchors.fill: parent + spacing: 8 + + RowLayout { + IconImage { + Layout.leftMargin: 10 + source: Quickshell.iconPath("password-copy", true) + Layout.preferredWidth: 25 + Layout.preferredHeight: 25 + } + + TextField { + id: input + Layout.fillWidth: true + font.pixelSize: 18 + color: "white" + focus: true + + padding: 15 + + onTextChanged: { + launcher.query = text; + // reset selection to first item of the filtered list + list.currentIndex = folderModel.length > 0 ? 0 : -1; + } + + background: Rectangle { + border.width: 0 + color: "transparent" + } + + // Quit + Keys.onEscapePressed: Qt.quit() + Keys.onPressed: event => { + const ctrl = event.modifiers & Qt.ControlModifier; + if (event.key == Qt.Key_Up || event.key == Qt.Key_P && ctrl) { + event.accepted = true; + if (list.currentIndex > 0) + list.currentIndex--; + } else if (event.key == Qt.Key_Down || event.key == Qt.Key_N && ctrl) { + event.accepted = true; + if (list.currentIndex < list.count - 1) + list.currentIndex++; + } else if (event.key == Qt.Key_U && ctrl) { + event.accepted = true; + launcher.copyUser(); + } else if ([Qt.Key_Return, Qt.Key_Enter].includes(event.key)) { + event.accepted = true; + launcher.copyPass(); + } else if (event.key == Qt.Key_C && ctrl) { + event.accepted = true; + Qt.quit(); + } + } + } + } + + FolderListModel { + function getQuery() { + return "*"+launcher.query+"*" + } + id: folderModel + folder: "file:///home/ceres/.password-store/" + showDirsFirst: true + caseSensitive: false + showDirs: launcher.query === "" ? true : false + nameFilters: [ getQuery() ] + } + + ListView { + id: list + Layout.fillWidth: true + Layout.fillHeight: true + clip: true + model: folderModel + currentIndex: folderModel.length > 0 ? 0 : -1 + keyNavigationWraps: true + preferredHighlightBegin: 0 + preferredHighlightEnd: height + highlightRangeMode: ListView.ApplyRange + highlightMoveDuration: 80 + highlight: Rectangle { + radius: 4 + opacity: 0.45 + color: input.palette.highlight + } + + + delegate: Item { + id: entry + required property string fileBaseName + required property string filePath + required property int index + required property bool fileIsDir + width: ListView.view.width + height: 36 + + MouseArea { + anchors.fill: parent + onClicked: list.currentIndex = entry.index + onDoubleClicked: launcher.launchSelected() + } + + Row { + anchors.fill: parent + anchors.margins: 8 + spacing: 10 + + // IconImage { + // source: Quickshell.iconPath(modelData.icon, true) + // width: 23 + // height: 23 + // } + Text { + function genText() { + if(fileIsDir==true) { + return fileBaseName+"/" + } + else { + return fileBaseName + } + } + id: label + color: "white" + text: genText() + font.pointSize: 13 + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + } + } + + // Enter also works while ListView has focus + Keys.onReturnPressed: launcher.copyUser() + } + } +} diff --git a/quickshell/Wallpaper.qml b/quickshell/shell/Wallpaper.qml similarity index 69% rename from quickshell/Wallpaper.qml rename to quickshell/shell/Wallpaper.qml index 0ae0841..b7c8ea0 100644 --- a/quickshell/Wallpaper.qml +++ b/quickshell/shell/Wallpaper.qml @@ -1,5 +1,6 @@ import Quickshell import QtQuick +import Quickshell.Wayland PanelWindow { id: background @@ -9,12 +10,12 @@ PanelWindow { bottom: true top: true } - aboveWindows: false + WlrLayershell.layer: WlrLayer.Background Image { width: background.width height: background.height - source: "/home/ceres/Pictures/Wallpapers/current" + source: "/home/ceres/.local/state/niri/wallpaper" fillMode: Image.PreserveAspectCrop } diff --git a/quickshell/shell.qml b/quickshell/shell/shell.qml similarity index 100% rename from quickshell/shell.qml rename to quickshell/shell/shell.qml diff --git a/wallpapers/current b/wallpapers/current index 51184df..080307c 120000 --- a/wallpapers/current +++ b/wallpapers/current @@ -1 +1 @@ -/home/ceres/Pictures/Wallpapers/arcade.jpg \ No newline at end of file +/home/ceres/Pictures/Wallpapers/eclipse.jpg \ No newline at end of file diff --git a/wallust/templates/foot b/wallust/templates/foot new file mode 100644 index 0000000..395e1da --- /dev/null +++ b/wallust/templates/foot @@ -0,0 +1,21 @@ +[colors] +foreground={{ foreground | strip }} +background={{ background | strip }} + +regular0={{ color0 | strip }} +regular1={{ color1 | strip }} +regular2={{ color2 | strip }} +regular3={{ color3 | strip }} +regular4={{ color4 | strip }} +regular5={{ color5 | strip }} +regular6={{ color6 | strip }} +regular7={{ color7 | strip }} + +bright0={{ color8 | strip }} +bright1={{ color9 | strip }} +bright2={{ color10 | strip }} +bright3={{ color11 | strip }} +bright4={{ color12 | strip }} +bright5={{ color13 | strip }} +bright6={{ color14 | strip }} +bright7={{ color15 | strip }} diff --git a/wallust/templates/niri b/wallust/templates/niri new file mode 100644 index 0000000..a423bc3 --- /dev/null +++ b/wallust/templates/niri @@ -0,0 +1,7 @@ +layout { + border { + active-color "{{ color1 }}" + inactive-color "{{ color1 | darken(0.6) }}" + urgent-color "{{ color2 }}" + } +} diff --git a/wallust/wallust.toml b/wallust/wallust.toml new file mode 100644 index 0000000..7613147 --- /dev/null +++ b/wallust/wallust.toml @@ -0,0 +1,16 @@ +backend = "full" + +color_space = "lab-mixed" + +palette = "dark" + +check_contrast = true + +[templates] +# NOTE: prefer '' over "" for paths, avoids escaping. +# template: A RELATIVE path that points to `~/.config/wallust/template` (depends on platform) +# target: ABSOLUTE path in which to place a file with generated templated values. +# ¡ If either one is a directory, then both SHOULD be one. ! +# zathura = { template = 'zathura', target = '~/.config/zathura/zathurarc' } +niri = { template = 'niri', target = '~/.caelestia/niri/colours.kdl' } +foot = { template = 'foot', target = '~/.caelestia/foot/colours.ini' }