aurora2d6af20
hypr: hyprlock styled like aurora
+109 −30
2 files changed
- M .config/hypr/hyprlock.conf +90 −30
- M .config/quickshell/aurora/Theme.qml +19 −0
| @@ -1,60 +1,120 @@ | |||
| 1 | − | # -- pywal colors -- | |
| 1 | + | # hyprlock, styled like aurora (flat, square, accent borders, JetBrains Mono). | |
| 2 | + | # Colours: pywal first as a fallback, then aurora's resolved palette (incl. the accent picked in its settings), | |
| 3 | + | # written by aurora's Theme.qml to ~/.config/aurora/hyprlock-colors.conf. | |
| 2 | 4 | source = $HOME/.cache/wal/colors-hyprland.conf | |
| 5 | + | $bg = $background | |
| 6 | + | $fg = $foreground | |
| 7 | + | $accent = $color14 | |
| 8 | + | $accentDim = $color6 | |
| 9 | + | $surface = $color0 | |
| 10 | + | $surfaceHi = $color8 | |
| 11 | + | $line = $color8 | |
| 12 | + | $dim = $color8 | |
| 13 | + | $err = $color1 | |
| 14 | + | $font = JetBrainsMono Nerd Font | |
| 15 | + | source = $HOME/.config/aurora/hyprlock-colors.conf | |
| 3 | 16 | ||
| 4 | 17 | general { | |
| 5 | 18 | hide_cursor = true | |
| 6 | − | no_fade_in = false | |
| 7 | − | grace = 0 | |
| 8 | − | disable_loading_bar = true | |
| 19 | + | ignore_empty_input = true | |
| 9 | 20 | } | |
| 10 | 21 | ||
| 11 | − | ||
| 12 | 22 | background { | |
| 13 | − | monitor = | |
| 14 | − | blur_passes = 0 | |
| 15 | − | color = $background | |
| 23 | + | monitor = | |
| 24 | + | color = $bg | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | # -- frame -- | |
| 28 | + | shape { | |
| 29 | + | monitor = | |
| 30 | + | size = 420, 300 | |
| 31 | + | color = $surface | |
| 32 | + | rounding = 0 | |
| 33 | + | border_size = 1 | |
| 34 | + | border_color = $line | |
| 35 | + | position = 0, 20 | |
| 36 | + | halign = center | |
| 37 | + | valign = center | |
| 16 | 38 | } | |
| 17 | 39 | ||
| 18 | − | # -- time -- | |
| 19 | 40 | label { | |
| 20 | 41 | monitor = | |
| 21 | − | text = cmd[update:1000] echo "$(date +"%H:%M")" | |
| 22 | − | color = $color7 | |
| 23 | − | font_size = 80 | |
| 24 | − | font_family = JetBrainsMono Nerd Font | |
| 25 | − | position = 0, 100 | |
| 42 | + | text = <b>LOCKED</b> | |
| 43 | + | color = $accent | |
| 44 | + | font_size = 11 | |
| 45 | + | font_family = $font | |
| 46 | + | position = 0, 135 | |
| 26 | 47 | halign = center | |
| 27 | 48 | valign = center | |
| 28 | 49 | } | |
| 29 | 50 | ||
| 51 | + | # -- time / date -- | |
| 52 | + | label { | |
| 53 | + | monitor = | |
| 54 | + | text = cmd[update:1000] echo "<b>$(date +%H:%M)</b>" | |
| 55 | + | color = $fg | |
| 56 | + | font_size = 64 | |
| 57 | + | font_family = $font | |
| 58 | + | position = 0, 70 | |
| 59 | + | halign = center | |
| 60 | + | valign = center | |
| 61 | + | } | |
| 30 | 62 | ||
| 31 | − | # -- greeting -- | |
| 32 | 63 | label { | |
| 33 | 64 | monitor = | |
| 34 | − | text = Hello $USER | |
| 35 | − | color = $foreground | |
| 36 | − | font_size = 20 | |
| 37 | − | font_family = JetBrainsMono Nerd Font | |
| 38 | − | position = 0, 0 | |
| 65 | + | text = cmd[update:60000] date '+%A %d %B' | tr a-z A-Z | |
| 66 | + | color = $accent | |
| 67 | + | font_size = 12 | |
| 68 | + | font_family = $font | |
| 69 | + | position = 0, 10 | |
| 39 | 70 | halign = center | |
| 40 | 71 | valign = center | |
| 41 | 72 | } | |
| 42 | 73 | ||
| 43 | − | # -- password input -- | |
| 74 | + | # -- password -- | |
| 44 | 75 | input-field { | |
| 45 | 76 | monitor = | |
| 46 | − | size = 230, 40 | |
| 47 | − | outline_thickness = 0 | |
| 48 | − | dots_size = 0.2 | |
| 77 | + | size = 340, 42 | |
| 78 | + | rounding = 0 | |
| 79 | + | outline_thickness = 2 | |
| 80 | + | outer_color = $accent | |
| 81 | + | inner_color = $bg | |
| 82 | + | font_color = $fg | |
| 83 | + | font_family = $font | |
| 84 | + | check_color = $accentDim | |
| 85 | + | fail_color = $err | |
| 86 | + | capslock_color = $accentDim | |
| 87 | + | dots_size = 0.22 | |
| 49 | 88 | dots_spacing = 0.4 | |
| 89 | + | dots_rounding = 0 | |
| 50 | 90 | dots_center = true | |
| 51 | − | inner_color = $color1 | |
| 52 | − | font_color = $color7 | |
| 53 | 91 | fade_on_empty = false | |
| 54 | − | placeholder_text = <span foreground='white'><i>Escape the Matrix</i></span> | |
| 55 | − | fail_color = $color7 | |
| 56 | − | hide_input = false | |
| 57 | − | position = 0, -50 | |
| 92 | + | placeholder_text = PASSWORD | |
| 93 | + | fail_text = $FAIL ($ATTEMPTS) | |
| 94 | + | position = 0, -60 | |
| 58 | 95 | halign = center | |
| 59 | 96 | valign = center | |
| 60 | 97 | } | |
| 98 | + | ||
| 99 | + | # -- status line -- | |
| 100 | + | label { | |
| 101 | + | monitor = | |
| 102 | + | text = cmd[update:0] echo "$USER@$(cat /etc/hostname)" | |
| 103 | + | color = $dim | |
| 104 | + | font_size = 11 | |
| 105 | + | font_family = $font | |
| 106 | + | position = 20, 16 | |
| 107 | + | halign = left | |
| 108 | + | valign = bottom | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | label { | |
| 112 | + | monitor = | |
| 113 | + | text = cmd[update:5000] echo "$(mpc current 2>/dev/null | sed 's/&/\&/g; s/</\</g') BAT $(cat /sys/class/power_supply/BAT0/capacity)%" | |
| 114 | + | color = $dim | |
| 115 | + | font_size = 11 | |
| 116 | + | font_family = $font | |
| 117 | + | position = -20, 16 | |
| 118 | + | halign = right | |
| 119 | + | valign = bottom | |
| 120 | + | } | |
| @@ -87,6 +87,25 @@ Singleton { | |||
| 87 | 87 | readonly property color cursorC: wal.special.cursor | |
| 88 | 88 | readonly property color bgA: Qt.rgba(bg.r, bg.g, bg.b, panelAlpha) | |
| 89 | 89 | ||
| 90 | + | // ---- hyprlock ----------------------------------------------------- | |
| 91 | + | // hyprlock stays a separate process (crash safety); it sources ~/.config/aurora/hyprlock-colors.conf, | |
| 92 | + | // written here so the lock uses the resolved palette (incl. the settings-picked accent). | |
| 93 | + | readonly property string lockFile: Quickshell.env("HOME") + "/.config/aurora/hyprlock-colors.conf" | |
| 94 | + | readonly property string lockConf: { | |
| 95 | + | function c(v) { | |
| 96 | + | var h = n => ("0" + Math.round(n * 255).toString(16)).slice(-2) | |
| 97 | + | return "rgba(" + h(v.r) + h(v.g) + h(v.b) + h(v.a) + ")" | |
| 98 | + | } | |
| 99 | + | return ["# generated by aurora (Theme.qml); edit the palette there, not here", | |
| 100 | + | "$bg = " + c(bg), "$fg = " + c(fg), "$accent = " + c(accent), "$accentDim = " + c(accentDim), | |
| 101 | + | "$surface = " + c(surface), "$surfaceHi = " + c(surfaceHi), "$line = " + c(line), | |
| 102 | + | "$dim = " + c(dim), "$err = " + c(err), "$font = " + font, ""].join("\n") | |
| 103 | + | } | |
| 104 | + | onLockConfChanged: lockTimer.restart() | |
| 105 | + | Timer { id: lockTimer; interval: 500; onTriggered: lockFv.setText(root.lockConf) } | |
| 106 | + | FileView { id: lockFv; path: root.lockFile; printErrors: false } | |
| 107 | + | Component.onCompleted: lockTimer.restart() | |
| 108 | + | ||
| 90 | 109 | // ---- Nerd Font (Material Design) glyphs --------------------------- | |
| 91 | 110 | function cp(c) { | |
| 92 | 111 | c -= 0x10000 | |