diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 34088c5..93ff9e0 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -16,7 +16,6 @@ let YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn"; # TODO Some of that stuff is not really relavant any more }; - dotfilesPath = "$HOME/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles, also, should be an option in { @@ -133,6 +132,18 @@ in diff = "diff --color=auto"; dmesg = "dmesg --ctime"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; + + # Imported from scripts + rms = ''${pkgs.findutils}/bin/find . -name "*.sync-conflict-*" -delete''; # Remove syncthing conflict files + pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy + newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail''; + oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head''; + tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file''; + } // lib.optionalAttrs config.frogeye.desktop.xorg { + noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; + beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; + # FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory) + } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory @@ -279,10 +290,10 @@ in ff = "only"; }; } // lib.optionalAttrs config.frogeye.desktop.xorg { - diff.tool = "meld"; - difftool.prompt = false; - "difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\""; - # This escapes quotes, which isn't the case in the original, hoping this isn't an issue. + diff.tool = "meld"; + difftool.prompt = false; + "difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\""; + # This escapes quotes, which isn't the case in the original, hoping this isn't an issue. }; # TODO Delta syntax highlighter... and other cool-looking options? }; @@ -399,6 +410,7 @@ in wget curl python3Packages.pip + rename # shell zsh-completions @@ -425,9 +437,6 @@ in ncdu jdupes duperemove - optipng - libjpeg - # FIXME reflac not available (but also a dumb shell script) # local monitoring htop @@ -490,9 +499,9 @@ in } // direnv; # TODO Session variables only get reloaded on login I think. sessionPath = [ - "$HOME/.local/bin" + "${config.home.homeDirectory}/.local/bin" "${config.home.sessionVariables.GOPATH}" - "${dotfilesPath}/config/scripts" + "${config.frogeye.dotfiles.path}/config/nix/scripts" ]; }; } diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index dd8aac1..0874ec7 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -605,7 +605,6 @@ twemoji-color-font gnome.gedit feh - zathura zbar zathura meld diff --git a/config/nix/options.nix b/config/nix/options.nix index baa7a76..e083890 100644 --- a/config/nix/options.nix +++ b/config/nix/options.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ lib, config, ... }: { options.frogeye = { extra = lib.mkEnableOption "Big software"; @@ -13,6 +13,13 @@ fpga = lib.mkEnableOption "FPGA dev stuff"; python = lib.mkEnableOption "Python dev stuff"; }; + dotfiles = { + path = lib.mkOption { + type = lib.types.str; + default = "${config.home.homeDirectory}/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles + # FIXME References to this use config/nix subfolder, which we might want to make root + }; + }; }; config = { diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index 11d480e..727eebd 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -54,7 +54,7 @@ chrony = { enable = true; servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - extraConfig = "rtcsync"; + extraConfig = "rtcsync"; # See 23.11 release notes }; # Prevent power button from shutting down the computer. diff --git a/config/scripts/.bsh/bashrc b/config/nix/scripts/.bsh/bashrc similarity index 100% rename from config/scripts/.bsh/bashrc rename to config/nix/scripts/.bsh/bashrc diff --git a/config/scripts/.bsh/bashrc_unsortable b/config/nix/scripts/.bsh/bashrc_unsortable similarity index 100% rename from config/scripts/.bsh/bashrc_unsortable rename to config/nix/scripts/.bsh/bashrc_unsortable diff --git a/config/scripts/.bsh/inputrc b/config/nix/scripts/.bsh/inputrc similarity index 100% rename from config/scripts/.bsh/inputrc rename to config/nix/scripts/.bsh/inputrc diff --git a/config/scripts/.bsh/vimrc b/config/nix/scripts/.bsh/vimrc similarity index 100% rename from config/scripts/.bsh/vimrc rename to config/nix/scripts/.bsh/vimrc diff --git a/config/scripts/.gitignore b/config/nix/scripts/.gitignore similarity index 100% rename from config/scripts/.gitignore rename to config/nix/scripts/.gitignore diff --git a/config/scripts/archive b/config/nix/scripts/archive similarity index 98% rename from config/scripts/archive rename to config/nix/scripts/archive index 8ac60ee..c53e962 100755 --- a/config/scripts/archive +++ b/config/nix/scripts/archive @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs import argparse import logging diff --git a/config/scripts/bsh b/config/nix/scripts/bsh similarity index 95% rename from config/scripts/bsh rename to config/nix/scripts/bsh index 45e21a7..9ad639b 100755 --- a/config/scripts/bsh +++ b/config/nix/scripts/bsh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash openssh coreutils gawk gnused # TODO More integrated with current config diff --git a/config/scripts/cached_pass b/config/nix/scripts/cached_pass similarity index 83% rename from config/scripts/cached_pass rename to config/nix/scripts/cached_pass index 401b797..d52ecfd 100755 --- a/config/scripts/cached_pass +++ b/config/nix/scripts/cached_pass @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash pass libnotify # TODO Password changed? diff --git a/config/scripts/camera_name_date b/config/nix/scripts/camera_name_date similarity index 96% rename from config/scripts/camera_name_date rename to config/nix/scripts/camera_name_date index 0001baa..55bb9e2 100755 --- a/config/scripts/camera_name_date +++ b/config/nix/scripts/camera_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/cleandev b/config/nix/scripts/cleandev similarity index 82% rename from config/scripts/cleandev rename to config/nix/scripts/cleandev index 1beff42..4f7886d 100755 --- a/config/scripts/cleandev +++ b/config/nix/scripts/cleandev @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash findutils git gnumake # Removes files that can be regenerated # from a dev environment diff --git a/config/scripts/compressPictureMovies b/config/nix/scripts/compressPictureMovies similarity index 98% rename from config/scripts/compressPictureMovies rename to config/nix/scripts/compressPictureMovies index 79701e9..16c4a4c 100755 --- a/config/scripts/compressPictureMovies +++ b/config/nix/scripts/compressPictureMovies @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 ffmpeg import datetime import hashlib diff --git a/config/scripts/crepuscule b/config/nix/scripts/crepuscule similarity index 97% rename from config/scripts/crepuscule rename to config/nix/scripts/crepuscule index abf456b..bedc04e 100755 --- a/config/scripts/crepuscule +++ b/config/nix/scripts/crepuscule @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/docker-image-childs b/config/nix/scripts/docker-image-childs similarity index 69% rename from config/scripts/docker-image-childs rename to config/nix/scripts/docker-image-childs index cf72ad1..c463d29 100755 --- a/config/scripts/docker-image-childs +++ b/config/nix/scripts/docker-image-childs @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker gnugrep coreutils # Find the dependent child image from an image diff --git a/config/scripts/docker-rm b/config/nix/scripts/docker-rm similarity index 57% rename from config/scripts/docker-rm rename to config/nix/scripts/docker-rm index aadc6fb..ffa1ea8 100755 --- a/config/scripts/docker-rm +++ b/config/nix/scripts/docker-rm @@ -1,4 +1,7 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker + docker unpause $(docker ps -q) docker kill $(docker ps -q) docker container prune -f diff --git a/config/scripts/dummy b/config/nix/scripts/dummy similarity index 76% rename from config/scripts/dummy rename to config/nix/scripts/dummy index 1423b2a..c723378 100755 --- a/config/scripts/dummy +++ b/config/nix/scripts/dummy @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash tree coreutils # Remplace le contenu d'un dossier par un fichier texte # relatant son arborescense diff --git a/config/nix/scripts/emergency-clean b/config/nix/scripts/emergency-clean new file mode 100755 index 0000000..f8fb79d --- /dev/null +++ b/config/nix/scripts/emergency-clean @@ -0,0 +1,19 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash + +# Clears everything it can to save space + +rm -rf $HOME/.cache +if command -v pacman > /dev/null; then + sudo pacman -Scc +fi +if command -v apt-get > /dev/null; then + sudo apt-get clean +fi +if command -v nix-store > /dev/null; then + sudo journalctl --vacuum-size=100M +fi +if command -v journalctl > /dev/null; then + sudo journalctl --vacuum-size=100M +fi diff --git a/config/scripts/gitCheckoutModes b/config/nix/scripts/gitCheckoutModes similarity index 70% rename from config/scripts/gitCheckoutModes rename to config/nix/scripts/gitCheckoutModes index f4bdbb2..dfc1e72 100755 --- a/config/scripts/gitCheckoutModes +++ b/config/nix/scripts/gitCheckoutModes @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash git gnugrep coreutils findutils # From https://stackoverflow.com/a/2083563 diff --git a/config/scripts/gitghost b/config/nix/scripts/gitghost similarity index 93% rename from config/scripts/gitghost rename to config/nix/scripts/gitghost index dc24cf1..6a89c6e 100755 --- a/config/scripts/gitghost +++ b/config/nix/scripts/gitghost @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils git gnused # Replace git folders with a placeholder containing the remote and the commit diff --git a/config/scripts/jour b/config/nix/scripts/jour similarity index 97% rename from config/scripts/jour rename to config/nix/scripts/jour index 72e9cbf..eb086d5 100755 --- a/config/scripts/jour +++ b/config/nix/scripts/jour @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/lestrte b/config/nix/scripts/lestrte similarity index 83% rename from config/scripts/lestrte rename to config/nix/scripts/lestrte index 65a16cb..8ade6c6 100755 --- a/config/scripts/lestrte +++ b/config/nix/scripts/lestrte @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/letrtes b/config/nix/scripts/letrtes similarity index 84% rename from config/scripts/letrtes rename to config/nix/scripts/letrtes index 2124fdc..5636e84 100755 --- a/config/scripts/letrtes +++ b/config/nix/scripts/letrtes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/lip b/config/nix/scripts/lip similarity index 81% rename from config/scripts/lip rename to config/nix/scripts/lip index 66a0b1d..3663bd2 100755 --- a/config/scripts/lip +++ b/config/nix/scripts/lip @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash jq curl findutils coreutils set -euo pipefail diff --git a/config/scripts/lorem b/config/nix/scripts/lorem similarity index 96% rename from config/scripts/lorem rename to config/nix/scripts/lorem index 77e3998..771c67b 100755 --- a/config/scripts/lorem +++ b/config/nix/scripts/lorem @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash # Generates Lorem Ipsum diff --git a/config/scripts/mediaDuration b/config/nix/scripts/mediaDuration similarity index 91% rename from config/scripts/mediaDuration rename to config/nix/scripts/mediaDuration index 6ae8d70..0c8f9ee 100755 --- a/config/scripts/mediaDuration +++ b/config/nix/scripts/mediaDuration @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs ffmpeg import logging import os diff --git a/config/scripts/music_remove_dashes b/config/nix/scripts/music_remove_dashes similarity index 90% rename from config/scripts/music_remove_dashes rename to config/nix/scripts/music_remove_dashes index 2693a5b..25101d2 100755 --- a/config/scripts/music_remove_dashes +++ b/config/nix/scripts/music_remove_dashes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 """ Small script to convert music files in the form: diff --git a/config/scripts/nuit b/config/nix/scripts/nuit similarity index 97% rename from config/scripts/nuit rename to config/nix/scripts/nuit index 9666d97..5f409ec 100755 --- a/config/scripts/nuit +++ b/config/nix/scripts/nuit @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/o b/config/nix/scripts/o similarity index 93% rename from config/scripts/o rename to config/nix/scripts/o index f427b8a..94d5e78 100755 --- a/config/scripts/o +++ b/config/nix/scripts/o @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.magic xdg-utils feh zathura # pylint: disable=C0103 """ diff --git a/config/scripts/optimize b/config/nix/scripts/optimize similarity index 93% rename from config/scripts/optimize rename to config/nix/scripts/optimize index 2113bd2..fbbfa36 100755 --- a/config/scripts/optimize +++ b/config/nix/scripts/optimize @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils imagemagick libjpeg optipng ffmpeg diffutils # Optimizes everything the script can find in a folder, @@ -11,6 +13,7 @@ # TODO Lots of dupplicated code there # TODO Maybe replace part with https://github.com/toy/image_optim? +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) dir=${1:-$PWD} total=$(mktemp) echo -n 0 > $total @@ -148,20 +151,18 @@ do done <<< "$(find "$dir/" -type f -iname "*.png")" -# FLAC (requires reflac) +# FLAC (requires ffmpeg) while read music do if [ -z "$music" ]; then continue; fi echo Processing $music - temp_dir=$(mktemp --directory) - temp="$temp_dir/to_optimize.flac" + temp=$(mktemp --suffix .flac) cp "$music" "$temp" - reflac --best "$temp_dir" + ffmpeg -8 -o "$temp" echo "→ Optimize done" replace "$temp" "$music" - rm -rf "$temp_dir" done <<< "$(find "$dir/" -type f -iname "*.flac")" @@ -186,6 +187,6 @@ done <<< "$(find "$dir/" -type f -iname "*.flac")" # - I might want to keep editor data and/or ids for some of them # So rather use scour explicitely when needed -cleandev +${SCRIPT_DIR}/cleandev showtotal diff --git a/config/scripts/overpdf b/config/nix/scripts/overpdf similarity index 95% rename from config/scripts/overpdf rename to config/nix/scripts/overpdf index 1fb9752..32cbcd6 100755 --- a/config/scripts/overpdf +++ b/config/nix/scripts/overpdf @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk inkscape gnused coreutils file # Utility to write over a PDF file pages diff --git a/config/scripts/pdfpages b/config/nix/scripts/pdfpages similarity index 63% rename from config/scripts/pdfpages rename to config/nix/scripts/pdfpages index 1b86e2d..969fcf5 100755 --- a/config/scripts/pdfpages +++ b/config/nix/scripts/pdfpages @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk gnugrep gawk # From https://stackoverflow.com/a/14736593 for FILE in "$@" diff --git a/config/scripts/pdfrename b/config/nix/scripts/pdfrename similarity index 92% rename from config/scripts/pdfrename rename to config/nix/scripts/pdfrename index 7cfdd9c..c48c112 100755 --- a/config/scripts/pdfrename +++ b/config/nix/scripts/pdfrename @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk coreutils # Change the title of a PDF file diff --git a/config/scripts/picture_name_date b/config/nix/scripts/picture_name_date similarity index 96% rename from config/scripts/picture_name_date rename to config/nix/scripts/picture_name_date index a327499..6235729 100755 --- a/config/scripts/picture_name_date +++ b/config/nix/scripts/picture_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.exifread import argparse import datetime diff --git a/config/scripts/pushToTalk b/config/nix/scripts/pushToTalk similarity index 94% rename from config/scripts/pushToTalk rename to config/nix/scripts/pushToTalk index b7add24..f987a08 100755 --- a/config/scripts/pushToTalk +++ b/config/nix/scripts/pushToTalk @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.pulsectl python3Packages.xlib import sys diff --git a/config/scripts/raw_move_precomp b/config/nix/scripts/raw_move_precomp similarity index 95% rename from config/scripts/raw_move_precomp rename to config/nix/scripts/raw_move_precomp index 9b62408..e00535a 100755 --- a/config/scripts/raw_move_precomp +++ b/config/nix/scripts/raw_move_precomp @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/rep b/config/nix/scripts/rep similarity index 82% rename from config/scripts/rep rename to config/nix/scripts/rep index 789f25f..086d7dc 100755 --- a/config/scripts/rep +++ b/config/nix/scripts/rep @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils # Moves a file to another place and put a symbolic link in place diff --git a/config/scripts/replayGain b/config/nix/scripts/replayGain similarity index 90% rename from config/scripts/replayGain rename to config/nix/scripts/replayGain index 9f48e35..3d3e574 100755 --- a/config/scripts/replayGain +++ b/config/nix/scripts/replayGain @@ -1,4 +1,8 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.r128gain + +# TODO r128gain is not maintainted anymore # Normalisation is done at the default of each program, # which is usually -89.0 dB diff --git a/config/scripts/rmf b/config/nix/scripts/rmf similarity index 99% rename from config/scripts/rmf rename to config/nix/scripts/rmf index 53e3fbe..1bbc2b7 100755 --- a/config/scripts/rmf +++ b/config/nix/scripts/rmf @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 # Handles sync-conflict files diff --git a/config/scripts/rssVideos b/config/nix/scripts/rssVideos similarity index 98% rename from config/scripts/rssVideos rename to config/nix/scripts/rssVideos index 22f6539..9b1401c 100755 --- a/config/scripts/rssVideos +++ b/config/nix/scripts/rssVideos @@ -1,4 +1,7 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.configargparse python3Packages.filelock python3Packages.filelock python3Packages.requests python3Packages.yt-dlp ffmpeg +# Also needs mpv but if I put it there it's not using the configured one """ diff --git a/config/scripts/smtpdummy b/config/nix/scripts/smtpdummy similarity index 98% rename from config/scripts/smtpdummy rename to config/nix/scripts/smtpdummy index 67be437..df3776a 100755 --- a/config/scripts/smtpdummy +++ b/config/nix/scripts/smtpdummy @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.colorama python3Packages.configargparse import base64 import datetime diff --git a/config/scripts/spongebob b/config/nix/scripts/spongebob similarity index 78% rename from config/scripts/spongebob rename to config/nix/scripts/spongebob index 6bdfdf0..980616a 100755 --- a/config/scripts/spongebob +++ b/config/nix/scripts/spongebob @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/syncthingRestore b/config/nix/scripts/syncthingRestore similarity index 85% rename from config/scripts/syncthingRestore rename to config/nix/scripts/syncthingRestore index f6b41f7..0accfb6 100755 --- a/config/scripts/syncthingRestore +++ b/config/nix/scripts/syncthingRestore @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import os import shutil diff --git a/config/scripts/tagCreatorPhotos b/config/nix/scripts/tagCreatorPhotos similarity index 79% rename from config/scripts/tagCreatorPhotos rename to config/nix/scripts/tagCreatorPhotos index 7bec346..d5146c1 100755 --- a/config/scripts/tagCreatorPhotos +++ b/config/nix/scripts/tagCreatorPhotos @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.piexif import os import sys diff --git a/config/scripts/ter b/config/nix/scripts/ter similarity index 95% rename from config/scripts/ter rename to config/nix/scripts/ter index ec432a5..01fbc3b 100755 --- a/config/scripts/ter +++ b/config/nix/scripts/ter @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import sys from math import inf diff --git a/config/scripts/unziptree b/config/nix/scripts/unziptree similarity index 96% rename from config/scripts/unziptree rename to config/nix/scripts/unziptree index 83eb81b..0b6720c 100755 --- a/config/scripts/unziptree +++ b/config/nix/scripts/unziptree @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.magic unzip p7zip unrar gnutar gzip import logging import os diff --git a/config/scripts/updateCompressedMusic b/config/nix/scripts/updateCompressedMusic similarity index 97% rename from config/scripts/updateCompressedMusic rename to config/nix/scripts/updateCompressedMusic index 49c9a8a..11a48d3 100755 --- a/config/scripts/updateCompressedMusic +++ b/config/nix/scripts/updateCompressedMusic @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progresbar2 ffmpeg # pylint: disable=C0103 import logging diff --git a/config/scripts/videoQuota b/config/nix/scripts/videoQuota similarity index 93% rename from config/scripts/videoQuota rename to config/nix/scripts/videoQuota index b139836..10cea98 100755 --- a/config/scripts/videoQuota +++ b/config/nix/scripts/videoQuota @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 ffmpeg # Compress a video to make it fit under a certain size. # Usage: videoQuota SIZE SRC DST diff --git a/config/scripts/wttr b/config/nix/scripts/wttr similarity index 68% rename from config/scripts/wttr rename to config/nix/scripts/wttr index f1b368c..9b327c9 100755 --- a/config/scripts/wttr +++ b/config/nix/scripts/wttr @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash curl ncurses # change Paris to your default location request="v2.wttr.in/${1-Amsterdam}" diff --git a/config/scripts/linuxColors b/config/nix/unprocessed/config/linuxColors.sh old mode 100755 new mode 100644 similarity index 100% rename from config/scripts/linuxColors rename to config/nix/unprocessed/config/linuxColors.sh diff --git a/config/scripts/adb_backup_extract b/config/nix/unprocessed/config/scripts/adb_backup_extract similarity index 100% rename from config/scripts/adb_backup_extract rename to config/nix/unprocessed/config/scripts/adb_backup_extract diff --git a/config/scripts/arch-kexec b/config/nix/unprocessed/config/scripts/arch-kexec similarity index 100% rename from config/scripts/arch-kexec rename to config/nix/unprocessed/config/scripts/arch-kexec diff --git a/config/scripts/cudarun b/config/nix/unprocessed/config/scripts/cudarun similarity index 100% rename from config/scripts/cudarun rename to config/nix/unprocessed/config/scripts/cudarun diff --git a/config/scripts/dafont b/config/nix/unprocessed/config/scripts/dafont similarity index 100% rename from config/scripts/dafont rename to config/nix/unprocessed/config/scripts/dafont diff --git a/config/scripts/debloc b/config/nix/unprocessed/config/scripts/debloc similarity index 100% rename from config/scripts/debloc rename to config/nix/unprocessed/config/scripts/debloc diff --git a/config/scripts/diapo b/config/nix/unprocessed/config/scripts/diapo similarity index 100% rename from config/scripts/diapo rename to config/nix/unprocessed/config/scripts/diapo diff --git a/config/scripts/hc b/config/nix/unprocessed/config/scripts/hc similarity index 100% rename from config/scripts/hc rename to config/nix/unprocessed/config/scripts/hc diff --git a/config/scripts/hl b/config/nix/unprocessed/config/scripts/hl similarity index 100% rename from config/scripts/hl rename to config/nix/unprocessed/config/scripts/hl diff --git a/config/scripts/html2pdf b/config/nix/unprocessed/config/scripts/html2pdf similarity index 100% rename from config/scripts/html2pdf rename to config/nix/unprocessed/config/scripts/html2pdf diff --git a/config/scripts/install-wsl b/config/nix/unprocessed/config/scripts/install-wsl similarity index 100% rename from config/scripts/install-wsl rename to config/nix/unprocessed/config/scripts/install-wsl diff --git a/config/scripts/logstasync b/config/nix/unprocessed/config/scripts/logstasync similarity index 100% rename from config/scripts/logstasync rename to config/nix/unprocessed/config/scripts/logstasync diff --git a/config/scripts/machines b/config/nix/unprocessed/config/scripts/machines similarity index 100% rename from config/scripts/machines rename to config/nix/unprocessed/config/scripts/machines diff --git a/config/scripts/md2html b/config/nix/unprocessed/config/scripts/md2html similarity index 100% rename from config/scripts/md2html rename to config/nix/unprocessed/config/scripts/md2html diff --git a/config/scripts/mel b/config/nix/unprocessed/config/scripts/mel similarity index 100% rename from config/scripts/mel rename to config/nix/unprocessed/config/scripts/mel diff --git a/config/scripts/melConf b/config/nix/unprocessed/config/scripts/melConf similarity index 100% rename from config/scripts/melConf rename to config/nix/unprocessed/config/scripts/melConf diff --git a/config/scripts/musiqueBof b/config/nix/unprocessed/config/scripts/musiqueBof similarity index 100% rename from config/scripts/musiqueBof rename to config/nix/unprocessed/config/scripts/musiqueBof diff --git a/config/scripts/nv b/config/nix/unprocessed/config/scripts/nv similarity index 100% rename from config/scripts/nv rename to config/nix/unprocessed/config/scripts/nv diff --git a/config/scripts/package-lock.json b/config/nix/unprocessed/config/scripts/package-lock.json similarity index 100% rename from config/scripts/package-lock.json rename to config/nix/unprocessed/config/scripts/package-lock.json diff --git a/config/scripts/package.json b/config/nix/unprocessed/config/scripts/package.json similarity index 100% rename from config/scripts/package.json rename to config/nix/unprocessed/config/scripts/package.json diff --git a/config/scripts/proxy b/config/nix/unprocessed/config/scripts/proxy similarity index 100% rename from config/scripts/proxy rename to config/nix/unprocessed/config/scripts/proxy diff --git a/config/scripts/remcrlf b/config/nix/unprocessed/config/scripts/remcrlf similarity index 77% rename from config/scripts/remcrlf rename to config/nix/unprocessed/config/scripts/remcrlf index 09e5882..8364e2a 100755 --- a/config/scripts/remcrlf +++ b/config/nix/unprocessed/config/scripts/remcrlf @@ -1,4 +1,6 @@ #!/usr/bin/env bash +#! nix-shell -i bash --pure +#! nix-shell -p bash # Removes CRLF (^M or \r) from a file diff --git a/config/scripts/tunnel b/config/nix/unprocessed/config/scripts/tunnel similarity index 100% rename from config/scripts/tunnel rename to config/nix/unprocessed/config/scripts/tunnel diff --git a/config/scripts/tvshow b/config/nix/unprocessed/config/scripts/tvshow similarity index 100% rename from config/scripts/tvshow rename to config/nix/unprocessed/config/scripts/tvshow diff --git a/config/scripts/updatedate b/config/nix/unprocessed/config/scripts/updatedate similarity index 100% rename from config/scripts/updatedate rename to config/nix/unprocessed/config/scripts/updatedate diff --git a/config/scripts/arch-rankmirrors b/config/scripts/arch-rankmirrors deleted file mode 100755 index 939eb56..0000000 --- a/config/scripts/arch-rankmirrors +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ $USER != root ] -then - echo "This script should be run as root." - exit 1 -fi - -if ! pacman -Qq pacman-mirrorlist &> /dev/null -then - pacman -S pacman-mirrorlist -fi - -if [ ! -f /etc/pacman.d/mirrorlist.pacnew ] -then - cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew -fi - -egrep -o 'Server = .+' /etc/pacman.d/mirrorlist.pacnew | /usr/bin/rankmirrors -n 6 - > /etc/pacman.d/mirrorlist diff --git a/config/scripts/automatrop b/config/scripts/automatrop deleted file mode 100755 index d463b74..0000000 --- a/config/scripts/automatrop +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -cd ~/.dotfiles/config/automatrop -if [ -f ~/.config/automatrop/self_name ] -then - hostname=$(cat ~/.config/automatrop/self_name) -else - hostname="$HOSTNAME" -fi -ansible-playbook --diff playbooks/default.yml --limit $hostname --connection local "$@" diff --git a/config/scripts/beep b/config/scripts/beep deleted file mode 100755 index 5cd87e2..0000000 --- a/config/scripts/beep +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null -# echo  diff --git a/config/scripts/dotfiles b/config/scripts/dotfiles deleted file mode 100755 index 4d6cddf..0000000 --- a/config/scripts/dotfiles +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash - -# Handles dotfiles -# Yes there are tons of similar scipts yet I wanted no more nor less than what I needed - -# Config - -if [ -z "$DOTHOME" ]; then - DOTHOME="$HOME" -fi -if [ -z "$DOTREPO" ]; then - DOTREPO="$HOME/.dotfiles" -fi - -# Common functions - -# From http://stackoverflow.com/a/12498485 -function relativePath { - # both $1 and $2 are absolute paths beginning with / - # returns relative path to $2/$target from $1/$source - source=$1 - target=$2 - - common_part=$source # for now - result="" # for now - - while [[ "${target#$common_part}" == "${target}" ]]; do - # no match, means that candidate common part is not correct - # go up one level (reduce common part) - common_part="$(dirname $common_part)" - # and record that we went back, with correct / handling - if [[ -z $result ]]; then - result=".." - else - result="../$result" - fi - done - - if [[ $common_part == "/" ]]; then - # special case for root (no common path) - result="$result/" - fi - - # since we now have identified the common part, - # compute the non-common part - forward_part="${target#$common_part}" - - - # and now stick all parts together - if [[ -n $result ]] && [[ -n $forward_part ]]; then - result="$result$forward_part" - elif [[ -n $forward_part ]]; then - # extra slash removal - # result="${forward_part:1}" # Removes the . in the beginning... - result="${forward_part#/}" - fi - - echo "$result" -} - - -# Script common functions - -function _dotfiles-install-dir { # dir - local dir - local absSource - local absTarget - local relTarget - - dir="${1%/}" - dir="${dir#/}" - - ls -A "$DOTREPO/$dir" | while read file; do - if [[ -z "$dir" && $(echo $file | grep '^\(\.\|LICENSE\|README\)') ]]; then - continue - fi - if [[ $(echo $file | grep '^.dfrecur$') ]]; then - continue - fi - - if [ -z "$dir" ]; then - absSource="$DOTHOME/.$file" - absTarget="$DOTREPO/$file" - else - absSource="$DOTHOME/.$dir/$file" - absTarget="$DOTREPO/$dir/$file" - fi - relTarget="$(relativePath "$DOTHOME/$dir" "$absTarget")" - recurIndicator="$absTarget/.dfrecur" - - if [[ -h "$absTarget" ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a link" - fi - else - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - fi - elif [[ -f "$absTarget" || ( -d $absTarget && ! -f $recurIndicator ) ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="ln --symbolic --no-dereference --force $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a symbolic link" - fi - else - cmd="ln --symbolic --no-dereference $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - fi - elif [[ -d "$absTarget" && -f $recurIndicator ]]; then - if [ -e "$absSource" ]; then - if [ -d "$absSource" ]; then - # echo "Directory $absSource already exists" - _dotfiles-install-dir $dir/$file - else - echo "[ERROR] $absSource already exists, but is not a directory" - fi - else - cmd="mkdir $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - _dotfiles-install-dir $dir/$file - fi - else - echo "[WARNING] Skipped $absTarget" - fi - done - -} - -# Script functions - -function dotfiles_install { - _dotfiles-install-dir / -} - -function dotfiles_help { - command="$1" - if [ -n "$command" ]; then - if type "dotfiles_${command}_help" &> /dev/null; then - shift - "dotfiles_${command}_help" "$@" - return $? - fi - fi - echo "Usage: $0 COMMAND" - echo - echo "Commands:" - echo " install Install dotfiles from repository" - echo " help Get help with commands" - echo - echo "Environment variables:" - echo " DOTHOME Where to install dotfiles" - echo " DOTREPO Where do the dotfiles comes from" - return 0 -} - -# MAIN -command="$1" -shift -if type "dotfiles_$command" &> /dev/null; then - "dotfiles_$command" "$@" -else - dotfiles_help -fi - diff --git a/config/scripts/emergency-clean b/config/scripts/emergency-clean deleted file mode 100755 index be88836..0000000 --- a/config/scripts/emergency-clean +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Clears everything it can to save space - -rm -rf $HOME/.cache -if which pacman &> /dev/null; then - sudo pacman -Scc -elif which apt-get &> /deb/null; then - sudo apt-get clean -fi -if which journalctl &> /dev/null; then - sudo journalctl --vacuum-size=100M -fi diff --git a/config/scripts/heavyPackages b/config/scripts/heavyPackages deleted file mode 100755 index 8235b61..0000000 --- a/config/scripts/heavyPackages +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Return a list of packages sorted by size - -(echo PACKAGE SIZE; \ - for A in /var/lib/pacman/local/*/desc; do - (sed -n 2p $A; (grep '^%SIZE%$' $A -A1 | tail -1)) | tr '\n' ' '; echo - done \ - | sort -nrk2) \ -| column -t diff --git a/config/scripts/newestFile b/config/scripts/newestFile deleted file mode 100755 index 508a762..0000000 --- a/config/scripts/newestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | tail "$@" diff --git a/config/scripts/noise b/config/scripts/noise deleted file mode 100755 index eeb8ac8..0000000 --- a/config/scripts/noise +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -play -c 2 -n synth ${1}noise diff --git a/config/scripts/oldestFile b/config/scripts/oldestFile deleted file mode 100755 index 4f90f83..0000000 --- a/config/scripts/oldestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | head "$@" diff --git a/config/scripts/ovhcli b/config/scripts/ovhcli deleted file mode 100755 index 880dc62..0000000 --- a/config/scripts/ovhcli +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import json -import logging -import os -import urllib.request -from pprint import pprint - -import coloredlogs -import ovh -import xdg.BaseDirectory - -coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") -log = logging.getLogger() - -debug = None - - -class OvhCli: - ROOT = "https://api.ovh.com/1.0?null" - - def __init__(self): - self.cacheDir = os.path.join(xdg.BaseDirectory.xdg_cache_home, "ovhcli") - # TODO Corner cases: links, cache dir not done, configurable cache - if not os.path.isdir(self.cacheDir): - assert not os.path.exists(self.cacheDir) - os.makedirs(self.cacheDir) - - def updateCache(self): - log.info("Downloading the API description") - rootJsonPath = os.path.join(self.cacheDir, "root.json") - log.debug(f"{self.ROOT} -> {rootJsonPath}") - urllib.request.urlretrieve(self.ROOT, rootJsonPath) - with open(rootJsonPath, "rt") as rootJson: - root = json.load(rootJson) - basePath = root["basePath"] - - for apiRoot in root["apis"]: - fmt = "json" - assert fmt in apiRoot["format"] - path = apiRoot["path"] - schema = apiRoot["schema"].format(format=fmt, path=path) - apiJsonPath = os.path.join(self.cacheDir, schema[1:]) - apiJsonUrl = basePath + schema - log.debug(f"{apiJsonUrl} -> {apiJsonPath}") - apiJsonPathDir = os.path.dirname(apiJsonPath) - if not os.path.isdir(apiJsonPathDir): - os.makedirs(apiJsonPathDir) - urllib.request.urlretrieve(apiJsonUrl, apiJsonPath) - - def createParser(self): - parser = argparse.ArgumentParser(description="Access the OVH API") - return parser - - -if __name__ == "__main__": - cli = OvhCli() - # cli.updateCache() - parser = cli.createParser() - args = parser.parse_args() - print(args) diff --git a/config/scripts/pw b/config/scripts/pw deleted file mode 100755 index e1dd8c4..0000000 --- a/config/scripts/pw +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Generate strong enough password(s) - -# This generates a password with ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy, -# which is a bit above the recommended standars (128 bits) while still having -# a 0 probability that the service will break because of incompatible character - -pwgen 32 -y diff --git a/config/scripts/requirements.txt b/config/scripts/requirements.txt deleted file mode 100644 index f806981..0000000 --- a/config/scripts/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -coloredlogs>=10.0<11 -progressbar2>=3.47.0<4 -yt-dlp>=2021.10.22 -ConfigArgParse>=1.5<2 -asyncinotify -ffmpeg -r128gain diff --git a/config/scripts/rms b/config/scripts/rms deleted file mode 100755 index 885b287..0000000 --- a/config/scripts/rms +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find . -name "*.sync-conflict-*" -delete diff --git a/config/scripts/sedrename b/config/scripts/sedrename deleted file mode 100755 index 42a6f23..0000000 --- a/config/scripts/sedrename +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Rename a list of files with a sed pattern - -usage() { - echo "Usage: $0 PATTERN [-d] < filelist" - echo - echo "Arguments:" - echo " PATTERN Sed pattern to apply" - echo - echo "Options:" - echo " -d Dry run" - exit 1 -} - -if [[ -z "$1" ]]; then - usage -fi - -pattern="$1" - -dry=1 -if [[ -n "$2" ]]; then - if [[ "$2" = '-d' ]]; then - dry=0 - else - usage - fi -fi - -while read src -do - dst="$(echo "$src" | sed "$pattern")" - if [[ $? != 0 ]]; then - echo "ERREUR Invalid sed pattern" - exit 2 - fi - if [[ $dry == 0 ]]; then - echo "$src" → "$dst" - else - mv -- "$src" "$dst" - fi - -done - - - diff --git a/config/scripts/tracefiles b/config/scripts/tracefiles deleted file mode 100755 index 662f59e..0000000 --- a/config/scripts/tracefiles +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -strace -f -t -e trace=file $@ diff --git a/config/scripts/transfer b/config/scripts/transfer deleted file mode 100755 index a937228..0000000 --- a/config/scripts/transfer +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -if [ $# -eq 0 ] -then - echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" - return 1 -fi - -tmpfile=$( mktemp -t transferXXX ) - -if tty -s -then - basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g') - curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile -else - curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile -fi - -cat $tmpfile -rm -f $tmpfile diff --git a/config/scripts/vidcmp b/config/scripts/vidcmp deleted file mode 100755 index 7a284b9..0000000 --- a/config/scripts/vidcmp +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Compresses video using FFMPEG using -# FFMPEG's reasonable default settings - -import os -import subprocess -import sys - -files = sys.argv[1:] - -remove = False -if "-r" in files: - files.remove("-r") - remove = True - -for f in files: - print(os.path.splitext(f))