Compare commits
3 Commits
1850aa1e8c
...
307c598252
| Author | SHA1 | Date | |
|---|---|---|---|
|
307c598252
|
|||
|
3af519cdfc
|
|||
|
4879638bdd
|
@ -62,6 +62,8 @@ if status is-login
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
{% elif hostname == "buran" %}
|
{% elif hostname == "buran" %}
|
||||||
|
set -x DEFMT_LOG info # default logging level for defmt
|
||||||
|
|
||||||
# start sway if logging in on tty 1
|
# start sway if logging in on tty 1
|
||||||
if status is-login
|
if status is-login
|
||||||
if test $XDG_SESSION_TYPE = "tty" -a $XDG_VTNR = "1"
|
if test $XDG_SESSION_TYPE = "tty" -a $XDG_VTNR = "1"
|
||||||
|
|||||||
@ -305,11 +305,11 @@ bar {
|
|||||||
|
|
||||||
|
|
||||||
# Window settings
|
# Window settings
|
||||||
|
# use `swaymsg -t get_tree | grep "app_id"` to list window ids. can also grep for "name"
|
||||||
for_window [app_id=".*"] border pixel 2
|
for_window [app_id=".*"] border pixel 2
|
||||||
#for_window [title="^volume_indicator$"] border pixel 0; floating enable; move down 600; move right 600
|
|
||||||
for_window [app_id="^volume_indicator$"] border pixel 0; floating enable; resize set 300 80; position center
|
for_window [app_id="^volume_indicator$"] border pixel 0; floating enable; resize set 300 80; position center
|
||||||
#for_window [title="^Volume$"] border pixel 0; floating enable; position center
|
|
||||||
#for_window [title="^Volume$"] floating enable; position center; resize set 300 80
|
|
||||||
for_window [app_id="zoom"] floating enable
|
for_window [app_id="zoom"] floating enable
|
||||||
|
#for_window [name="Firefox - Delningsindikator"] floating enable
|
||||||
|
for_window [app_id="com.nextcloud.desktopclient.nextcloud"] floating enable
|
||||||
|
|
||||||
include /etc/sway/config.d/*
|
include /etc/sway/config.d/*
|
||||||
|
|||||||
@ -1,60 +1,37 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/fish
|
||||||
|
|
||||||
TMP_IMG="/tmp/lock.png"
|
|
||||||
|
|
||||||
{% if hostname == "sputnik" %}
|
|
||||||
|
|
||||||
# rendered for sputnik
|
|
||||||
LOCKPROG=i3lock
|
|
||||||
LOCKARGS="-nef --image=$TMP_IMG"
|
|
||||||
LOCKARGS_NOCOOL="-c 302f3b"
|
|
||||||
OPTIONAL_CMDS="scrot lockscreen-blur"
|
|
||||||
SCREENCAP="scrot -"
|
|
||||||
BLUR_FACTOR=20
|
|
||||||
|
|
||||||
{% elif hostname == "vostok" %}
|
|
||||||
|
|
||||||
# rendered for vostok
|
|
||||||
LOCKPROG=swaylock
|
|
||||||
LOCKARGS="--config $HOME/.config/sway/swaylock.config --image $TMP_IMG"
|
|
||||||
LOCKARGS_NOCOOL="--config $HOME/.config/sway/swaylock.config --color 302f3b"
|
|
||||||
OPTIONAL_CMDS="grim lockscreen-blur"
|
|
||||||
SCREENCAP="grim -t ppm -"
|
|
||||||
BLUR_FACTOR=40
|
|
||||||
|
|
||||||
{% elif hostname == "buran" %}
|
|
||||||
|
|
||||||
# rendered for buran
|
|
||||||
LOCKPROG=swaylock
|
|
||||||
LOCKARGS="--config $HOME/.config/sway/swaylock.config --image $TMP_IMG"
|
|
||||||
LOCKARGS_NOCOOL="--config $HOME/.config/sway/swaylock.config --color 302f3b"
|
|
||||||
OPTIONAL_CMDS="grim lockscreen-blur"
|
|
||||||
SCREENCAP="grim -t ppm -"
|
|
||||||
BLUR_FACTOR=40
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
echo "screenlock not configured for this system"
|
|
||||||
exit 1
|
|
||||||
{% end %}
|
|
||||||
|
|
||||||
|
# configured for wayland
|
||||||
|
set LOCKPROG swaylock
|
||||||
|
set OPTIONAL_CMDS grep sed grim lockscreen-blur
|
||||||
|
set CONFIG "$HOME/.config/sway/swaylock.config"
|
||||||
|
set FALLBACK_ARGS --config $CONFIG --color "302f3b"
|
||||||
|
set BLUR_FACTOR 40
|
||||||
|
|
||||||
# check if lock program is running
|
# check if lock program is running
|
||||||
if ps -e | grep " $LOCKPROG$"; then
|
if ps -e | grep " $LOCKPROG\$"
|
||||||
echo "$LOCKPROG is already running!"
|
echo "$LOCKPROG is already running"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
end
|
||||||
|
|
||||||
for CMD in $OPTIONAL_CMDS; do
|
|
||||||
if ! command -v "$CMD" &> /dev/null
|
|
||||||
then
|
|
||||||
echo "$CMD could not be found, falling back to basic mode."
|
|
||||||
|
|
||||||
$LOCKPROG $LOCKARGS_NOCOOL "$@"
|
|
||||||
|
|
||||||
|
for cmd in $OPTIONAL_CMDS
|
||||||
|
if not command -v $cmd &>/dev/null
|
||||||
|
echo "$cmd could not be found, falling back to basic mode."
|
||||||
|
$LOCKPROG $FALLBACK_ARGS
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
end
|
||||||
done
|
end
|
||||||
|
|
||||||
$SCREENCAP | lockscreen-blur -o $TMP_IMG -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png
|
set outputs (swaymsg -t get_outputs -r | grep "name" | sed 's/^.*"name": "//' | sed 's/",$//')
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
$LOCKPROG --config $HOME/.config/sway/swaylock.config $images
|
||||||
|
|
||||||
$LOCKPROG $LOCKARGS "$@"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user