From e2bf69a855bf411f7167b8721ecaff44a2630d3e Mon Sep 17 00:00:00 2001 From: josuah Date: Sun, 27 Nov 2016 19:13:10 +0100 Subject: [PATCH] Fix dead link in the repo --- io-files | 10 ---------- io-tty-theme | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 11 deletions(-) delete mode 100644 io-files rewrite io-tty-theme (100%) mode change 120000 => 100755 diff --git a/io-files b/io-files deleted file mode 100644 index 20289c9..0000000 --- a/io-files +++ /dev/null @@ -1,10 +0,0 @@ -# List of recent files, directory - -path="$PWD" - -while [ -d $($path)" ] -do - path="$(ls -a | iomenu)" -done - -printf '%s\n' "$path" diff --git a/io-tty-theme b/io-tty-theme deleted file mode 120000 index f4a5025..0000000 --- a/io-tty-theme +++ /dev/null @@ -1 +0,0 @@ -/home/josuah/Config/.local/bin/theme \ No newline at end of file diff --git a/io-tty-theme b/io-tty-theme new file mode 100755 index 0000000..80c86e9 --- /dev/null +++ b/io-tty-theme @@ -0,0 +1,50 @@ +# ---- | +# | |--. ,--. --.-. ,--. +# | | | |--' | | | |--' +# ' ' ' `--' ' ' ' `--' 2016-10-27 +#_______________________________________________________________________________ +# +# Set a x-ressource theme to the tty +# +# Set the directory where you usually set your themes: +THEMES="$HOME/.config/themes" +# +# Then run this script, with either one theme name as argument, or as is, to +# run it in an interactively filter. You can set the filter to something like +# fzf, fzy, slmenu, pick, pick, selecta... +FILTER='iomenu' + +# if no argument +if [ $# = 0 ] +then + # interactively prompt for a color theme + ls "$THEMES" | $FILTER +else + # otherwise use the one from the command line argument + printf %s $1 +fi | xargs -i sed -rn ' + +# remove comment lines +/^[[:space:]]*!.*/ d + +# remove empty lines +/^[[:space:]]*$/ d + +# convert colors numbers from decimal to hexadecimal +s/color10/colorA/ +s/color11/colorB/ +s/color12/colorC/ +s/color13/colorD/ +s/color14/colorE/ +s/color15/colorF/ + +# print escaped color names +s/.*\.color([0-9A-F])[[:space:]]*:[[:space:]]*#/\1/ p + +' "$THEMES/{}" | while read color +do + # TTY color escape codes + printf '\033]P%s' "$color" +done + +clear -- 2.11.4.GIT