Skip to content

Instantly share code, notes, and snippets.

"""
Requirements:
1. merge_images.py from https://github.com/255/merge-images/blob/master/merge_images.py (and requirements for running script)
2. yad (sudo apt install yad)
3. AutoKey (with gtk+, install via Ubuntu Software)
---------------------------------------------------
tested on AutoKey 0.95.10, Ubuntu 20.04.3 LTS
"""
import subprocess
import os
from datetime import datetime
utime = datetime.now()
utime2 = utime.strftime("%Y_%m_%d_%H.%M.%S")
output_file = '/Users/john/Desktop/output-combine_images_%s.png' % utime2
script_file = '/Users/john/Desktop/ori.py'
column = 0
-- user options
set KillWindows_User to {"app1", "app2"}
set KillWindows_with_window to {"BCompare", "app2"}
set output_volume_before_shutdown_and_restart to "off" -- "on" or "off"
set output_volume to 0 -- you can set from 0 - 100
-- end of user options
-----------------------------------------------
set input_list_choose to {"Kill and Shut Down", "Kill and Restart", "Kill All Windows"}
-- user options
set KillWindows_User to {"app1", "app2"}
set KillWindows_with_window to {"BCompare", "app2"}
set output_volume_before_shutdown_and_restart to "off" -- "on" or "off"
set output_volume to 0 -- you can set from 0 - 100
-- end of user options
-----------------------------------------------
set input_list_choose to {"Kill and Shut Down", "Kill and Restart", "Kill All Windows"}
tell application "System Events"
set activeApp to (get name of first process where it is frontmost)
end tell
tell application "System Events"
tell process activeApp
set docPath1 to value of attribute "AXDocument" of window 1
end tell
{
"title" : "Eject Key - Capture Full Screen | Hold - Selection",
"rules" : [
{
"description" : "Eject Key - Capture Full Screen | Hold - Selection",
"manipulators" : [
{
"from" : {
"consumer_key_code":"eject"
},
-- Adjust resolution in Preview
-- open system preferences > keyboard > tab 'Shortcuts' > check 'Use keyboard navigation to move focus between controls'
-- user input
set resolution to "144"
-- end of user input -----------------------------------
if application "Preview" is running then
set prun to 1
brightness-up
one key:
gsettings set org.gnome.settings-daemon.plugins.media-keys screen-brightness-up "['F4']"
key combination:
gsettings set org.gnome.settings-daemon.plugins.media-keys screen-brightness-up "['<Ctrl><Shift>B']"
clear key:
gsettings set org.gnome.settings-daemon.plugins.media-keys screen-brightness-up "['']"
# apps: xclip,xdotool,zenity
import time
def new_item_categ_other():
keyboard.send_keys("other")
time.sleep(1.00)
keyboard.send_keys("<tab>")
time.sleep(0.1)
keyboard.send_keys("<tab>")
time.sleep(0.1)
-- user input (name of magic keybord and magic mouse: system preferences > bluetooth)
set keyboard to "Magic Keyboard"
set mouse to "Magic Mouse 2"
set warn_if_lower_than_percent to 74
-- end of user input
set aa to do shell script "system_profiler SPBluetoothDataType | grep '" & keyboard & "\\|Connected'"
set apple_std to text item delimiters
set text item delimiters to {keyboard, ":"}
set aa_list to aa's text items