Alternatively, you can opt for a more practical approach that combines all formatting options in one script. Of course, if you want to add other formatting options like italics or underlining, you have to create a separate script for each markup tag pair and assign a keyboard shortcut to the script. You can then assign a new global command/URL shortcut to the script. To do this on KDE, select Configure Desktop from the Kicker and switch to Shortcuts and Gestures. Obviously, running the script manually every time you need to insert tags is not very practical, so you might want to assign a keyboard shortcut to it. Then, xdotool inserts the selection into the text file. The echo ""$"" command wraps the selection into the specified tags ( in this case) and passes the wrapped string to the X selection. The script cuts the selected text fragment and sets it as the X selection. Instead of adding these tags manually, you can create a simple Bash script that inserts the tags around the currently selected text fragment: #!/bin/bash Suppose you often work on articles containing light HTML markup, such as for italics, for bold, and so on. The good news is that you can easily repurpose the script for other uses. The original Snippy Bash script is essentially a one-trick pony: Expanding abbreviations is all it can do. This problem is easy to fix by adding the -delay 0 parameter to all xdotool key commands, for example: xdotool key -delay 0 ctrl+shift+Left If the script doesn't behave properly, the most likely cause is the default 12ms delay that xdotool inserts between keystrokes. Make the script executable using the chmod +x snippy.sh command, and then test the script to make sure it works. Create a new script file, paste the contents of Listing 1 in it, and save as the snippy.sh file. snippy directory and populate it with files containing text snippets. To do the same on openSUSE, run the zypper install xsel xdotool command as root. On Debian and Ubuntu, this can be done by running the apt-get install xsel xdotool command as root. XSel and xdotool are available in the software repositories of most mainstream Linux distributions, so you can install both utilities using your distro's package manager. Before you start tweaking the script, however, you need to install the required packages. With a bit of creative tweaking, this script can be adapted for other text-expansion tasks, too. So, when you type foo and run the script, it replaces the abbreviation with the contents of the ~/.snippy/foo text file. Finally, the xdotool pastes the copied contents by simulating the Ctrl+V keyboard shortcut. The script then fetches the appropriate text file and copies its contents as the X selection. Which leaves you free to move on to your next project.The cut abbreviation is then set as the X selection with the XSel tool. With a double-click of the Ctrl key, FastFox will complete your thought and increase your productivity. These frequently used phrases are then suggested to you as you type. FastFox pays attention to common phrases for you and will learn the phrases that you repeatedly type. Intuitive AutocompleteYou may be wondering which phrases you use frequently throughout the day and where to begin creating shortcuts. Now you are ready to use the macro, sit back and watch the program work for you. Use a combination of Ctrl, Alt and Shift with other key strokes to create the shortcut keys for your macro, enter your command for the set of actions and save it. Fortunately, those with a technical aptitude can easily share their macros with other FastFox users. Enter the dimensions and save your shortcut.Ĭreating a MacroMacros are for the more advanced user. Enter the shortcut keys, such as 'cologo' and import the image. Have a nice day!' You will be amazed at your increased productivity and fast typing.Ĭreating a shortcut to insert your company logo sized to 110px x 150px is just as simple. Next time you want to use the phrase, just type ty and it will expand to 'Thank you. Have a nice day!" Select a keyboard shortcut such as 'ty' and save your new text shortcut. Enter a frequently used phrase, such as, "Thank you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |