{ pkgs, config, lib, ... }: with lib; let library = import ../../library { inherit pkgs lib; }; allLicenses = let licenses = builtins.map (license: "echo '${license.shortName} : ${license.fullName}'") (builtins.attrValues pkgs.lib.licenses); in pkgs.writers.writeBashBin "all-licenses" (lib.concatStringsSep "\n" licenses); #joplin = pkgs.joplin-desktop; joplin = pkgs.unstable.joplin-desktop; #joplin = pkgs.writers.writeBashBin "joplin" '' # if [[ ! -x "$HOME/programs/Joplin.AppImage" ]] # then # echo "$HOME/programs/Joplin.AppImage does not exist or is not executable"; # exit 1 # fi # exec ${pkgs.appimage-run}/bin/appimage-run "$HOME/programs/Joplin.AppImage" #''; parseUrl = pkgs.writers.writeBashBin "parseUrl" '' echo "$@" | \ ${pkgs.jq}/bin/jq --raw-input --raw-output ' def parseURL: capture( "^((?[^:/?#]+):)?(//(?(?[^/?#:]*)(:(?[0-9]*))?))?((?[^?#]*)\\?)?((?([^#]*)))?(#(?(.*)))?"); parseURL ' ''; parseAndCopyLink = pkgs.writers.writeBashBin "parseAndCopyLink" '' ${parseUrl}/bin/parseUrl "$@" | \ ${pkgs.jq}/bin/jq --raw-output '"\(.scheme)://\(.domain)\(.path)"' | \ ${pkgs.xclip}/bin/xclip ''; replaceLinks = pkgs.writers.writeBashBin "replace-link-with-content" # sh '' if [ ! -L "$1" ] then echo "$1 does not exist or is not a file" exit 1 fi cp -rL "$1" "$1.backup" unlink "$1" mv "$1.backup" "$1" ''; pandocScript = { inputFormat, outputFormat }: pkgs.writers.writeDashBin "pandoc-from-${inputFormat}-to-${outputFormat}" '' ${pkgs.pandoc}/bin/pandoc \ --from ${inputFormat} \ --to ${outputFormat} \ --standalone \ "$@" ''; connectToSpeaker = name: id: pkgs.writeShellScriptBin "connect-to-speaker-${name}" # sh '' # hacky script because I have problems with # automatically connecting to trusted bluetooth devices. echo "Connect to Speaker ${name}" bluetoothctl <