Compare commits

..

3 Commits

5 changed files with 34 additions and 56 deletions

View File

@ -7,6 +7,7 @@ background {
monitor = monitor =
{% if hostname == "sputnik" %} {% if hostname == "sputnik" %}
# make background transparent, used in combination with screenlock-video
color = rgba(00000000) color = rgba(00000000)
{% else %} {% else %}
path = ~/.config/wallpapers/6000x3376/akira.jpg path = ~/.config/wallpapers/6000x3376/akira.jpg
@ -49,6 +50,7 @@ input-field {
shadow_boost = 1.2 shadow_boost = 1.2
} }
# ferris image in the center
image { image {
monitor = monitor =
path = ~/.config/wallpapers/ferris-stamp.png path = ~/.config/wallpapers/ferris-stamp.png
@ -64,6 +66,7 @@ image {
shadow_boost = 1.2 shadow_boost = 1.2
} }
# clock
label { label {
monitor = monitor =
text = <b>$TIME</b> text = <b>$TIME</b>
@ -82,16 +85,36 @@ label {
shadow_boost = 1.3 shadow_boost = 1.3
} }
# battery
label { label {
monitor = monitor =
text = <b>$LAYOUT</b> text = cmd[update:5000] wmutils battery
text_align = left
color = rgba(200, 200, 200, 1.0)
font_size = 20
font_family = Noto Sans
rotate = 0 # degrees, counter-clockwise
position = 24, -20
halign = left
valign = top
shadow_passes = 2
shadow_size = 1
shadow_boost = 1.1
}
# keyboard layout
label {
monitor =
text = $LAYOUT
text_align = right text_align = right
color = rgba(200, 200, 200, 1.0) color = rgba(200, 200, 200, 1.0)
font_size = 20 font_size = 20
font_family = Noto Sans font_family = Noto Sans
rotate = 0 # degrees, counter-clockwise rotate = 0 # degrees, counter-clockwise
position = -12, -12 position = -24, -20
halign = right halign = right
valign = top valign = top
@ -100,6 +123,7 @@ label {
shadow_boost = 1.1 shadow_boost = 1.1
} }
# greeting text
label { label {
monitor = monitor =
text = GREET_ $user text = GREET_ $user
@ -118,6 +142,7 @@ label {
shadow_boost = 1.3 shadow_boost = 1.3
} }
# number of login attempts
label { label {
monitor = monitor =
text = $ATTEMPTS[0]x $FAIL text = $ATTEMPTS[0]x $FAIL

View File

@ -267,7 +267,7 @@ binds {
Mod+Return { spawn "alacritty"; } Mod+Return { spawn "alacritty"; }
Mod+D { spawn "fuzzel"; } Mod+D { spawn "fuzzel"; }
Mod+Plus { spawn "/home/hulthe/.local/bin/screenlock"; } Mod+Plus { spawn "loginctl lock-session"; }
// You can also use a shell: // You can also use a shell:
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
@ -297,17 +297,10 @@ binds {
Mod+Ctrl+Up { move-window-up; } Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; } Mod+Ctrl+Right { move-column-right; }
Mod+Ctrl+H { move-column-left; } Mod+Ctrl+H { move-column-left; }
Mod+Ctrl+J { move-window-down; } Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
Mod+Ctrl+K { move-window-up; } Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Ctrl+L { move-column-right; } Mod+Ctrl+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
// Mod+J { focus-window-or-workspace-down; }
// Mod+K { focus-window-or-workspace-up; }
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; } Mod+Home { focus-column-first; }
Mod+End { focus-column-last; } Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; } Mod+Ctrl+Home { move-column-to-first; }

View File

@ -1,7 +1,5 @@
{% if hostname == "sputnik" %} {% if hostname == "sputnik" %}
lock '$HOME/.local/bin/screenlock-video' lock '$HOME/.local/bin/screenlock-video'
{% elif hostname == "buran" %}
lock 'hyprlock'
{% else %} {% else %}
lock '$HOME/.local/bin/screenlock' lock '$HOME/.local/bin/screenlock'
{% end %} {% end %}

View File

@ -1,11 +1,7 @@
#!/usr/bin/fish #!/usr/bin/fish
# configured for wayland # configured for wayland
set LOCKPROG swaylock set LOCKPROG hyprlock
set OPTIONAL_CMDS rg sed grim lockscreen-blur jq
set CONFIG "$HOME/.config/sway/swaylock.config"
set DEFAULT_ARGS --daemonize --ignore-empty-password --show-failed-attempts --color 302f3b --config $CONFIG
set BLUR_FACTOR 40
# check if lock program is running # check if lock program is running
if ps -e | grep " $LOCKPROG\$" if ps -e | grep " $LOCKPROG\$"
@ -13,38 +9,4 @@ if ps -e | grep " $LOCKPROG\$"
exit 1 exit 1
end end
# check if we have programs required to take a screenshot and do cool stuff with it $LOCKPROG $argv
for cmd in $OPTIONAL_CMDS
if not command -v $cmd &>/dev/null
echo "$cmd could not be found, falling back to basic mode."
$LOCKPROG $DEFAULT_ARGS
exit 0
end
end
# get a list of outputs/monitors
switch $XDG_CURRENT_DESKTOP
case Hyprland
set outputs (hyprctl monitors | rg Monitor | sed 's/Monitor //' | sed 's/ (ID.*$//')
case sway
set outputs (swaymsg -t get_outputs -r | rg "name" | sed 's/^.*"name": "//' | sed 's/",$//')
case niri
set outputs (niri msg --json outputs | jq -r 'keys | join("\n")')
case '*'
echo "unsupported compositor, falling back to basic mode."
$LOCKPROG $DEFAULT_ARGS
exit 0
end
# take one screenshot of each output
for output in $outputs
set img "/tmp/lock-$output.png"
grim -o $output -t ppm - | lockscreen-blur -o $img -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png &
set -a images --image
set -a images "$output:$img"
end
# wait for all screenshot jobs to complete
wait
$LOCKPROG $DEFAULT_ARGS $images

View File

@ -2,7 +2,7 @@ def gitfixremote [
--name: string = "origin", --name: string = "origin",
] { ] {
let url = (git remote get-url $name) let url = (git remote get-url $name)
let parsed = ($url | parse --regex '(https://)?(\w*@)?(?P<host>[^/]+)(/|:)(?P<owner>[^/]+)/(?P<repo>[^/\.]+)') let parsed = ($url | parse --regex '^(\w+://)?(\w*@)?(?P<host>[^/:]+)(:(?P<port>\d+))?(:|/)(?P<owner>\w+)/(?P<repo>[\w_-]+)')
if ($parsed | is-empty) { if ($parsed | is-empty) {
print "Unparseable remote" print "Unparseable remote"
@ -13,7 +13,7 @@ def gitfixremote [
if ($parsed.host in ["github.com" "git.nubo.sh"]) { if ($parsed.host in ["github.com" "git.nubo.sh"]) {
git remote set-url $name $"https://($parsed.host)/($parsed.owner)/($parsed.repo).git" git remote set-url $name $"https://($parsed.host)/($parsed.owner)/($parsed.repo).git"
git remote set-url --push $name $"($parsed.host):($parsed.owner)/($parsed.repo).git" git remote set-url --push $name $"ssh://($parsed.host)/($parsed.owner)/($parsed.repo).git"
} else { } else {
print $"Unknown host: ($parsed.host)" print $"Unknown host: ($parsed.host)"
} }