From e871ce10c71d78b64b638f7e7bec2bef33d8e084 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 14 Apr 2023 18:00:03 +0100 Subject: [PATCH] add scripts --- home.nix | 55 ++++++++++++++++++++++++++++++++++++------ hyprland/hyprland.conf | 3 +-- scripts/screenshot | 9 +++++++ 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100755 scripts/screenshot diff --git a/home.nix b/home.nix index 0307bc9..160dfb1 100644 --- a/home.nix +++ b/home.nix @@ -9,13 +9,37 @@ home.homeDirectory = "/home/tristan"; xdg.userDirs.enable = true; + xdg.mimeApps = { + enable = true; + associations.added = { + "inode/directory" = "lf.desktop;vscodium.desktop;pcmanfm.desktop"; + }; + defaultApplications = { + "inode/directory" = "lf.desktop"; + "text/html" = "brave-browser.desktop"; + "x-scheme-handler/http" = "brave-browser.desktop"; + "x-scheme-handler/https" = "brave-browser.desktop"; + }; + }; home.packages = with pkgs; [ - exa + # script requirements libnotify - du-dust playerctl + grim + wl-clipboard + slurp + chafa + wofi + # utils + exa + du-dust + htop + imv + libsixel + + # apps gimp logseq quickemu @@ -96,10 +120,26 @@ ]; }; - services.mako.enable = true; + services.fnott = { + enable = true; + # https://codeberg.org/dnkl/fnott/src/branch/master/fnott.ini + settings = { + main = { + selection-helper = "wofi --show dmenu"; + }; + }; + }; - programs.ncmpcpp.enable = true; - programs.ncmpcpp.settings.mpd_host = "music.local"; + programs.ncmpcpp = { + enable = true; + settings.mpd_host = "music.local"; + bindings = [ + { key = "j"; command = "scroll_down"; } + { key = "k"; command = "scroll_up"; } + { key = "J"; command = [ "select_item" "scroll_down" ]; } + { key = "K"; command = [ "select_item" "scroll_up" ]; } + ]; + }; services.mpd-mpris.enable = true; services.mpd-mpris.mpd = { host = "music.local"; @@ -225,15 +265,16 @@ "$HOME/.local/scripts" ]; home.file.".local/scripts" = { - enable = true; source = ./scripts; executable = true; recursive = true; }; home.file.".config/hypr" = { - enable = true; source = ./hyprland; recursive = true; }; + home.file.".config/wofi/config".text = '' + term=foot + ''; } diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf index 5159fe1..d026615 100644 --- a/hyprland/hyprland.conf +++ b/hyprland/hyprland.conf @@ -81,8 +81,7 @@ bind=SUPER,O,exec,pcmanfm bind=SUPER,y,exec,foot -e ytui bind=SUPER,Z,exec,swaylock -f bind=SUPER,T,exec,notify-send "$(date)" -bind=SUPER,s,exec,screenshotSectionClipboard -bind=SUPER_SHIFT,S,exec,screenshotSection +bind=SUPER_SHIFT,S,exec,~/.local/scripts/screenshot bind=SUPERCTRL_SHIFT,S,exec,qrcode.sh bind=SUPER,p,exec,hyprpicker | wl-copy; wl-paste | xargs notify-send Copied bind=SUPER,slash,exec,brave diff --git a/scripts/screenshot b/scripts/screenshot new file mode 100755 index 0000000..17d261a --- /dev/null +++ b/scripts/screenshot @@ -0,0 +1,9 @@ +#!/bin/sh + +OUT_DIR=${GRIM_DEFAULT_DIR:-~/Pictures/Screenshots/} +mkdir -p "$OUT_DIR" + +grim -g "$(slurp -o)" - | wl-copy +notify-send "Screenshot Taken" "to the clipboard" +wl-paste > $OUT_DIR/$(date +"%Y-%m-%dT%H:%M:%SZ").png +