feat: tuigreet
This commit is contained in:
parent
fbd0bb139a
commit
e8cda9b27f
2 changed files with 28 additions and 7 deletions
|
|
@ -5,6 +5,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
tuigreet = lib.getExe pkgs.greetd.tuigreet;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
@ -105,7 +108,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
vt = 1;
|
vt = 1;
|
||||||
settings.default_session = {
|
settings.default_session = {
|
||||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --cmd Hyprland";
|
command = "${tuigreet} --time --asterisks --theme 'border=dark-gray;text=white;prompt=blue;time=dark-gray;action=dark-gray;button=blue;container=black;input=white'";
|
||||||
user = "greeter";
|
user = "greeter";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
30
scripts/ctl
30
scripts/ctl
|
|
@ -192,24 +192,35 @@ media)
|
||||||
notify-send -a ctl -t 2500 "Recording saved to ~${file#"$HOME"}"
|
notify-send -a ctl -t 2500 "Recording saved to ~${file#"$HOME"}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
require fuzzel grim slurp wl-copy wf-recorder
|
if pgrep -x fuzzel >/dev/null 2>&1; then
|
||||||
|
pkill -x fuzzel
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
require fuzzel grim slurp wl-copy wf-recorder hyprctl jq
|
||||||
ss_dir="${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots"
|
ss_dir="${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots"
|
||||||
rec_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
|
rec_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
|
||||||
mkdir -p "$ss_dir" "$rec_dir"
|
mkdir -p "$ss_dir" "$rec_dir"
|
||||||
desktop=" Capture Desktop"
|
cap_desktop=" Capture Desktop"
|
||||||
area=" Capture Area"
|
cap_area=" Capture Area"
|
||||||
|
cap_window=" Capture Window"
|
||||||
rec_desktop=" Record Desktop"
|
rec_desktop=" Record Desktop"
|
||||||
rec_area=" Record Area"
|
rec_area=" Record Area"
|
||||||
chosen="$(printf '%s\n' "$desktop" "$area" "$rec_desktop" "$rec_area" | fuzzel --dmenu --hide-prompt --lines=4 --width=25 --no-icons)"
|
rec_window=" Record Window"
|
||||||
|
chosen="$(printf '%s\n' "$cap_desktop" "$cap_area" "$cap_window" "$rec_desktop" "$rec_area" "$rec_window" | fuzzel --dmenu --hide-prompt --lines=6 --width=25 --no-icons)"
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
"$desktop")
|
"$cap_desktop")
|
||||||
file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png"
|
file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||||
grim "$file" && wl-copy < "$file" && echo "$file" && notify-send -a ctl -t 2500 "Screenshot saved to ~${file#"$HOME"}"
|
grim "$file" && wl-copy < "$file" && echo "$file" && notify-send -a ctl -t 2500 "Screenshot saved to ~${file#"$HOME"}"
|
||||||
;;
|
;;
|
||||||
"$area")
|
"$cap_area")
|
||||||
file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png"
|
file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||||
grim -g "$(slurp)" "$file" && wl-copy < "$file" && echo "$file" && notify-send -a ctl -t 2500 "Screenshot saved to ~${file#"$HOME"}"
|
grim -g "$(slurp)" "$file" && wl-copy < "$file" && echo "$file" && notify-send -a ctl -t 2500 "Screenshot saved to ~${file#"$HOME"}"
|
||||||
;;
|
;;
|
||||||
|
"$cap_window")
|
||||||
|
geom=$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||||
|
file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||||
|
grim -g "$geom" "$file" && wl-copy < "$file" && echo "$file" && notify-send -a ctl -t 2500 "Screenshot saved to ~${file#"$HOME"}"
|
||||||
|
;;
|
||||||
"$rec_desktop")
|
"$rec_desktop")
|
||||||
file="$rec_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
file="$rec_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||||
echo "$file" > "${XDG_RUNTIME_DIR:-/tmp}/ctl-recording"
|
echo "$file" > "${XDG_RUNTIME_DIR:-/tmp}/ctl-recording"
|
||||||
|
|
@ -222,6 +233,13 @@ media)
|
||||||
notify-send -a ctl -t 2500 "Recording started"
|
notify-send -a ctl -t 2500 "Recording started"
|
||||||
wf-recorder -g "$(slurp)" -f "$file" &
|
wf-recorder -g "$(slurp)" -f "$file" &
|
||||||
;;
|
;;
|
||||||
|
"$rec_window")
|
||||||
|
geom=$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||||
|
file="$rec_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||||
|
echo "$file" > "${XDG_RUNTIME_DIR:-/tmp}/ctl-recording"
|
||||||
|
notify-send -a ctl -t 2500 "Recording started"
|
||||||
|
wf-recorder -g "$geom" -f "$file" &
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
power)
|
power)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue