Giter Site home page Giter Site logo

custom_tmsu's Introduction

custom_tmsu

License: MIT

A custom modification for TMSU file tagging command line utility, written in bash, based on fzf fuzzy finder which helps user select tags.

Whenever a tmsu command needs to select tags, which will usually be at the end of the command, this script will use fzf to help user select the tags. When there is no need to select tags then this script is same as original tmsu.

Requirements: fzf

Note: Right now nothing related to values is implemented. Fzf options will contain only the output of tmsu tags (just tags). You can still use values without any problem, just that there will be no fzf completion. For giving tag=value you will have to type it in fzf window and fzf will give out the query since nothing matches.

Usage

If original usage is

tmsu tag file_name tag1 tag2 tag3

this script should be run as

this_script tag file_name

And then fzf interface will ask to select the already available tags one after other. Once all required tags are selected press Esc or Ctrl-C in fzf interface which will close fzf and run the following

tmsu tag file_name fzf_selections1 fzf_selections2 fzf_selections3

Note that all the initial arguments given to this script will be used in same order as arguments while running tmsu. Weather the fzf_selections are valid or new tags need to be created or more arguments are given, tmsu will do the needful as it would originally (even errors).

This script can replace your original tmsu and care is taken that it doesn't break any of your previous scripts. For example if the following command is entered, fzf interface will pop-up and ask user to select tags.

this_script tag file_name

If a tag is already is given like

this_script tag file_name tag1

then no changes are in effect and original tmsu is run. Originally if a tag is not given in the above command, you get an error, but now you will be asked to select one. But if any other options are used (having '-') like

tmsu tag --tags="landscape" field1.jpg field2.jpg

then original is run.

For files option default will be run only for the following command

this_script files -fzf

with anything other than the '-fzf' option the default tmsu will be run.

The behavior will be different only for the following arguments where tag/tags need to be selected:

  • files
  • merge
  • tag
  • untag
  • copy
  • delete
  • rename

Binary

At the end of this script, original tmsu binary ( version x86_64-0.7.5 ) is appended so that this script can work standalone. So will have to be careful with using the correct binary. To change the binary, edit this script by deleting all lines below the line saying '__PAYLOAD_BEGIN__' and append the script with correct binary as below

cat orignial_tmsu_binary >> this_script

custom_tmsu's People

Contributors

kvngvikram avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.