{ pkgs, ... }: let # open a window with live video feed from the camera webcam = pkgs.writeScriptBin "webcam" '' ${pkgs.mpv}/bin/mpv av://v4l2:/dev/video0 --profile=low-latency --untimed ''; # create new repo on fern git-new-repo = pkgs.writeScriptBin "git-new-repo" '' if [ $# -eq 0 ]; then echo "requires an arg" exit 1 fi # $1 - section/repo-name ssh git@ferrn git init --bare "$1"; git remote add origin git@ferrn:"$1"; git push -u origin HEAD; ''; # set git repo descriptions on cgit git-set-desc = pkgs.writeScriptBin "git-set-desc" '' remote=$(git remote get-url --push origin) scp .git/description "$remote/description" ''; # screen record with ffmpeg and slop record = import ./record.nix pkgs; # file uploader uploader = import ./up.nix pkgs; # battery script battery = import ./battery.nix pkgs; # run-on-gpu script nvidia-offload = import ./nvidia-offload.nix pkgs; # move window to next monitor m2m = import ./monitor-to-monitor.nix pkgs; # fzf script to switch between tmux sessions tmux-fzf = pkgs.writeScriptBin "tmux-fzf" '' LIST_DATA="#{session_name}/#{window_name}/#{pane_current_command} @ #{pane_current_path}" FZF_COMMAND="${pkgs.fzf}/bin/fzf-tmux -p 80,30 --delimiter=: --with-nth 4" TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" LINE=$(tmux list-windows -a -F "$TARGET_SPEC $LIST_DATA" | $FZF_COMMAND) || exit 0 args=(''${LINE//:/ }) ${pkgs.tmux}/bin/tmux select-window -t ''${args[1]} && tmux switch-client -t ''${args[0]} ''; touchscreen = "ELAN9008:00 04F3:2ED6"; stylus = "ELAN9008:00 04F3:2ED6 Stylus Pen (0)"; portait-transform = builtins.toString [ 0 (-1) 1 1 0 0 0 0 1 ]; landscape-transform = builtins.toString [ 0 0 0 0 0 0 0 0 0 ]; portrait = pkgs.writeScriptBin "portrait" '' ${pkgs.xorg.xrandr}/bin/xrandr -o left ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} ''; landscape = pkgs.writeScriptBin "landscape" '' ${pkgs.xorg.xrandr}/bin/xrandr -o normal ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} ''; in [ webcam git-set-desc git-new-repo record uploader battery tmux-fzf portrait landscape nvidia-offload m2m ]