Skip to content

Instantly share code, notes, and snippets.

@Kambaa
Last active June 7, 2024 12:15
Show Gist options
  • Save Kambaa/4a1fc8fb79f5335306056215bf77632f to your computer and use it in GitHub Desktop.
Save Kambaa/4a1fc8fb79f5335306056215bf77632f to your computer and use it in GitHub Desktop.
Custom keyboard shortcuts for My Linux Mint. Go to Settings - Keyboard - Shortcuts - Custom and add a shortcut to call these files and set your keyboard combinations.
#!/bin/bash
# This command sends this text on active window: {
# Go to settings - keyboard - shortcuts and add a shortcut to call this file and set your keyboard combinations.
windowid=$(xdotool getwindowfocus)
sleep 0.2 && xdotool windowactivate --sync $windowid type '{'
#!/bin/bash
# This command sends this text on active window: }
# Go to settings - keyboard - shortcuts and add a shortcut to call this file and set your keyboard combinations.
windowid=$(xdotool getwindowfocus)
sleep 0.2 && xdotool windowactivate --sync $windowid type '}'
#!/bin/bash
# This command sends `string` value.
# Go to settings - keyboard - shortcuts and add a shortcut to call this file and set your keyboard combinations.
string="ImportantText"
delay=0.05 # Delay between character inputs in seconds
sleep "0.5" # initial wait, without this beginning text is missing
for char in ${string}; do
xdotool type "${char}" && sleep "${delay}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment