scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

commit 2c065927ff405b2d8b2eec6fc1fbee9c4f93e0a8
parent dc98cba24cb5f1f3e260c49fc61add4a113a1df0
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon, 19 Jun 2023 08:27:58 +0200

Merge branch 'master' of tronto.net:scripts

Diffstat:
MMakefile | 1-
Dexperiments/edit-menu | 25-------------------------
Rtheme -> old/theme | 0
Mvirename | 4++--
4 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/Makefile b/Makefile @@ -32,7 +32,6 @@ SCRIPTS = addressgrep \ status \ templess \ terminal \ - theme \ translate \ trash \ urlgrep \ diff --git a/experiments/edit-menu b/experiments/edit-menu @@ -1,25 +0,0 @@ -#!/bin/sh - -# A "filter", based on your favorite editor. -# It reads lines from stdin, opens a file containing these lines -# with your favorite editor, and then prints the content of the file -# $EDITMENU to stdout. I have configured my editor to write the -# current line to $EDITMENU when pressing ;; (semicolon twice) like this -# map ;; !!tee -a $EDITMENU^M " For nvi - -# It can be used to replace dmenu or similar menu applications in -# constrained environment. It works even without any (n)curses library, -# assuming you use a suitable editor (like ed). - -editor=${EDITOR:-vi} - -export EDITMENU=$(mktemp) -in=$(mktemp) - -cat > "$in" - -# This is a dirty trick to "help" the editor (vi) understand that it can -# take over the tty to get its input. -$editor "$in" < /dev/tty - -cat $EDITMENU diff --git a/theme b/old/theme diff --git a/virename b/virename @@ -15,8 +15,8 @@ if [ "$(wc -l $file | awk '{print $1}')" != \ echo "Error reading new file names" else paste "$file" "$file2" | while read f; do - fold=$(echo "$f" | sed 's/\t.*//') - fnew=$(echo "$f" | sed 's/.*\t//') + fold=$(echo "$f" | sed 's/ .*//') + fnew=$(echo "$f" | sed 's/.* //') if [ "$fold" != "$fnew" ]; then mv "$fold" "$fnew" \ || echo "Error renaming $fold to $fnew"