From 910239fdefa7440899bfa87642290d1afe2894dd Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 8 Jun 2020 02:11:19 +0200 Subject: [PATCH] Recreate user scripts and add them to the PATH --- fish/.config/fish/config.fish | 1 + scripts/.local/share/scripts/peerflix | 8 ++++++++ scripts/.local/share/scripts/subject | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100755 scripts/.local/share/scripts/peerflix create mode 100755 scripts/.local/share/scripts/subject diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 682a872..75edb3f 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -14,6 +14,7 @@ alias docker-compose "podman-compose" # Additional paths set PATH $PATH $HOME/.emacs.d/bin +set PATH $PATH $HOME/.local/share/scripts # fff colors [0-9] set -x FFF_COL1 4 diff --git a/scripts/.local/share/scripts/peerflix b/scripts/.local/share/scripts/peerflix new file mode 100755 index 0000000..5dc177c --- /dev/null +++ b/scripts/.local/share/scripts/peerflix @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +directory=/tmp/webtorrent +player=mpv + +webtorrent download "$1" -s -o "$directory" --"$player" +read -rp "File number: " nr +webtorrent download "$@" -s "$nr" -o "$directory" --"$player" diff --git a/scripts/.local/share/scripts/subject b/scripts/.local/share/scripts/subject new file mode 100755 index 0000000..196e02e --- /dev/null +++ b/scripts/.local/share/scripts/subject @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "Usage: subject.sh " + exit 1 +fi + +name=$1 +type=$2 + +if [ "$type" -eq 0 ]; then + mkdir -p "$name"/Code + mkdir -p "$name"/TP + mkdir -p "$name"/Exos +else + mkdir -p "$name"/TP + mkdir -p "$name"/Exos +fi