3 Commits

4 changed files with 68 additions and 3 deletions
+2 -2
View File
@@ -11,7 +11,7 @@
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hakase-hyprlock";
before_sleep_cmd = "loginctl lock-session"; # lock before suspend
before_sleep_cmd = "hakase-hyprlock"; # lock before suspend
};
listener = [
@@ -21,7 +21,7 @@
# }
{
timeout = 300; # 5min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
on-timeout = "hakase-hyprlock"; # lock screen when timeout has passed
}
{
timeout = 330; # 5.5min
+8
View File
@@ -4,6 +4,14 @@
];
windowrulev2 = [
"suppressevent maximize, class:.*"
# --- YAZI FILE PICKER ---
"float, class:^(yazi-picker)$"
"center, class:^(yazi-picker)$"
"size 60% 60%, class:^(yazi-picker)$"
"dimaround, class:^(yazi-picker)$"
];
};
}
+46 -1
View File
@@ -1,4 +1,40 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: let
yazi-picker = pkgs.writeShellScriptBin "yazi-picker" ''
echo "--- $(date) ---" >> /tmp/yazi-picker.log
echo "Args: $@" >> /tmp/yazi-picker.log
path="$1"
[ -z "$path" ] && path="."
if [ "$2" = "true" ]; then
echo "Mode: Save" >> /tmp/yazi-picker.log
# Future: handle save mode better (maybe prompts?)
else
echo "Mode: Open" >> /tmp/yazi-picker.log
fi
out="$HOME/.cache/yazi-chooser"
rm -f "$out"
echo "Launching ghostty..." >> /tmp/yazi-picker.log
${pkgs.ghostty}/bin/ghostty --class="yazi-picker" --title="File Picker" -e ${pkgs.yazi}/bin/yazi "$path" --chooser-file="$out"
ret=$?
echo "Ghostty exited with $ret" >> /tmp/yazi-picker.log
if [ -f "$out" ]; then
selected=$(cat "$out")
echo "Selected: $selected" >> /tmp/yazi-picker.log
echo "$selected"
rm "$out"
else
echo "No selection" >> /tmp/yazi-picker.log
fi
'';
in {
programs.yazi = {
enable = true;
enableFishIntegration = true;
@@ -11,4 +47,13 @@
};
};
};
home.packages = [
yazi-picker
];
xdg.configFile."xdg-desktop-portal-termfilechooser/config".text = ''
[filechooser]
cmd=${yazi-picker}/bin/yazi-picker
'';
}
+12
View File
@@ -24,4 +24,16 @@
default = ["${myConfig.terminal.default}"];
};
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-termfilechooser
];
config.common = {
default = ["hyprland"];
"org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
};
};
}