Giter VIP home page Giter VIP logo

snippy.sh's Introduction

In the quest for an analogue on Linux of Autohotkey that exclusively runs on Microsoft Windows, neither autokey nor espanso proved as reliable.

Use

Instead, this little shell script snippy.sh that depends on

expands (by typing it out via xdotool) a fuzzily selected string from a popup menu (provided by rofi).

Each such string, say LGTM, is stored as the name of a file ~/.snippy/LGTM inside ~/.snippy that expands to the content of the file. For example, if ~/.snippy/LGTM reads Looks good to me!, then fuzzily selecting LGTM writes out Looks good to me!.

This works quite universally, that is, in every text box, editor, ... because xdotool simulates key presses.

To call it by a global key binding, a daemon such as xbindkeys (or sxhkd) is needed.

Installation

  1. Save this script, say to ~/bin/snippy.sh by

    mkdir --parents ~/bin &&
    curl -fLo https://raw.githubusercontent.com/Konfekt/snippy.sh/master/snippy.sh ~/bin/snippy.sh
  2. mark it executable by chmod a+x ~/bin/snippy.sh,

To launch snippy.sh by a global keyboard shortcut, say by pressing, at the same time, the Microsoft Windows key and S:

  1. install xdotool, rofi and, say, Xbindkeys (or Sxhkd), (for example, on openSUSE by sudo zypper install xbindkeys respectively sudo zypper install xdotool rofi sxhkd)

  2. add to ~/.xbindkeysrc a key binding that launches snippy.sh, say

    "$HOME/bin/snippy.sh"
        Mod4 + s
  3. start xbindkeys.

To start xbindkeys automatically at login, say on a KDE desktop environment, put a file xbindkeys.sh reading

#! /bin/sh
xbindkeys

into ~/.config/autostart-scripts/.

Credits

This script is based on snippy and passmenu; all credit shall be theirs and their licenses apply.

snippy.sh's People

Contributors

konfekt avatar

Stargazers

 avatar

Watchers

 avatar  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.