oh hey thats nice

This commit is contained in:
Reid 2025-01-02 16:19:49 -06:00
parent 542d57342e
commit c4fa167aaa
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
3 changed files with 15 additions and 1 deletions

View file

@ -92,6 +92,8 @@ in {
];
bind = let
screenshotScript = pkgs.writeShellScript "screenshot" ''
set -euo pipefail
temp_file=$(mktemp)
trap 'rm -f "$temp_file"' EXIT
@ -112,7 +114,7 @@ in {
;;
esac
${lib.getExe pkgs.grimblast} --freeze save "$mode" - > "$temp_file" || exit 0 # exit successful, highly unlikely that grimblast failed, and it is more likely that the user cancelled the screenshot
${lib.getExe pkgs.grimblast} --freeze save "$mode" - > "$temp_file"
cat "$temp_file" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t image/png
@ -130,6 +132,8 @@ in {
esac
'';
pickerScript = pkgs.writeShellScript "picker" ''
set -euo pipefail
${lib.getExe pkgs.hyprpicker} --render-inactive --format hex | sed -z 's/\n//g' | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain
${pkgs.libnotify}/bin/notify-send "Color Captured" \
@ -138,6 +142,8 @@ in {
"Color copied to clipboard"
'';
ocrScript = pkgs.writeShellScript "ocr" ''
set -euo pipefail
output=$(${lib.getExe pkgs.grimblast} --freeze save area - | ${lib.getExe pkgs.tesseract5} - -)
echo "$output" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain

View file

@ -17,6 +17,8 @@ in {
setScript = mkOption {
type = types.package;
default = pkgs.writeShellScript "swww-set" ''
set -euo pipefail
if [ ! -f "${lastWallpaper}" ]; then
echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
fi
@ -27,6 +29,8 @@ in {
swapScript = mkOption {
type = types.package;
default = pkgs.writeShellScript "swww-swap" ''
set -euo pipefail
file=$(ls ${wallpapersFolder} | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -sep '\n' -i -p "select a wallpaper")
wallpaper="${wallpapersFolder}/$file"

View file

@ -76,6 +76,8 @@ in {
};
"custom/power" = let
powerMenuScript = pkgs.writeShellScript "power-menu" ''
set -euo pipefail
cmd=$(echo ' shutdown| reboot| lock| exit desktop environment' | ${lib.getExe pkgs.rofi-wayland} -dmenu -sep '|' -i -p 'what to do ?' -theme-str 'window { height: 132px; }')
case "$cmd" in
" shutdown")
@ -263,6 +265,8 @@ in {
# https://github.com/chubin/wttr.in/issues/795
# i was NOT going to let ip-based location be a thing. i was suprisingly medicated when i wrote this
locationScript = pkgs.writeShellScript "location" ''
set -euo pipefail
lon=""
lat=""