Skip to content

Instantly share code, notes, and snippets.

View sl5net's full-sized avatar
🏠
Working from home

sl5net

🏠
Working from home
View GitHub Profile
@sl5net
sl5net / configParser-set-defaults.py
Created November 7, 2020 13:22
data["hotKey"]["hotKey"] = "<f11>" KeyError: 'hotKey'
from pathlib import Path
import json
home = str(Path.home())
path = home + "/.config/autokey/data/Sample Scripts/"
jsonFilePath = home + "/.config/autokey/data/Sample Scripts/.run-run-lintalistAHK-all.json"
# /home/administrator/.config/autokey/data/Sample Scripts/.run-run-lintalistAHK-all.json
# /home/administrator.config/autokey/data/Sample Scripts/.run-run-lintalistAHK-all.json'
# {
# "hotkey": {
# "modifiers": [],
@sl5net
sl5net / configParser-set-defaults.py
Created November 7, 2020 13:54
working example change shortcut in autokey script
from pathlib import Path
import json
home = str(Path.home())
path = home + "/.config/autokey/data/Sample Scripts/"
jsonFilePath = home + "/.config/autokey/data/Sample Scripts/.run-run-lintalistAHK-all.json"
file = open(jsonFilePath)
data = json.load(file)
for x in data['hotkey']:
data['hotkey'][x] = '<f11>'
print(data)
@sl5net
sl5net / install.sh
Created November 7, 2020 15:31
this adds and not changes values
#!/bin/bash
# Start it for e.g. so:
#/‾‾‾ problems installing autohokey using this line
# clear ; cd /tmp ; wget https://raw.githubusercontent.com/sl5net/Lintalist4Linux/master/install.sh ./install.sh ; sudo chmod +wx ./install.sh ; ./install.sh ; rm ./install.sh ;
#/‾‾‾ no problems # chmod +rwx :))))
# clear ; cd /tmp ; rm ./install.sh ; wget https://raw.githubusercontent.com/sl5net/Lintalist4Linux/master/install.sh ./install.sh ; sudo chmod 777 ./install.sh ; ./install.sh ; rm ./install.sh ;
#/‾‾‾ no problems bash: ./install.sh: Permission denied
# clear ; sudo wget https://raw.githubusercontent.com/sl5net/Lintalist4Linux/master/install.sh ~/Downloads/install.sh ; cd ~/Downloads ; sudo chmod 750 ./install.sh ; ./install.sh
#/‾‾‾ solution without sh-script
@sl5net
sl5net / .run-run-lintalistAHK-all.json
Created November 7, 2020 15:40
that not change, it adds
{
"type": "script",
"description": "run-run-lintalistAHK-all",
"store": {},
"modes": [
3
],
"usageCount": 12,
"prompt": false,
"omitTrigger": false,
@sl5net
sl5net / temp.py
Created November 9, 2020 18:29
some helper working with autokey
doPopupNotify_howItWorks = True # subprocess.Popen(['notify-send', "will be showed right top"]) # will be showed right top
def popupNotify(text):
subprocess.Popen(['notify-send', text]) # will be showed right top
def popupNotify_howItWorks(text):
global doPopupNotify_howItWorks
if doPopupNotify_howItWorks:
subprocess.Popen(['notify-send', text]) # will be showed right top
time.sleep(.2)
def beeps(duration=.1, freq=2000, loops=1):
# duration = .8 # second
# Attention: !!! don`t edit thi file. this file will be result from other files merged.
# this file will be (hopefully merged to) ...-all.py
from pathlib import Path
home = str(Path.home())
# BTW you can run a script using autokey-run --script {script-name}.
#/‾‾‾ CPU too high !!!!!!!!!!!!!!!!
# autokey-gtk.Autokey-gtk.AutoKey
import os, time, subprocess
def popupNotify(text):
subprocess.Popen(['notify-send', text]) # will be showed right top
# path = home + "/.config/autokey/data/Sample Scripts/"
def beeps(duration=.1, freq=2000, loops=1):
# duration = .8 # second # freq = 1500 # Hz
for x in range(loops):
os.system('play --no-show-progress --null --channels 1 synth %s sine %f' % (duration, freq))
@sl5net
sl5net / gist:2f176259e0686710358b2ed6be23a89a
Created November 22, 2020 11:27
i using a fast (5x) an a very slow (0.05x) speed ( https://youtu.be/ArpvNfMCuSQ )
{
"TranslatedKeys": ["Title"],
"Data":
[
{
"Speed": 0.05,
"Title": "Normal Turtle (0.05×)",
"Default": true
},
{
@sl5net
sl5net / gist:97793c9b2256ff893163f1fe30a47e91
Created November 22, 2020 15:34
0 A. D. game - set Tiny map Default true
{
"TranslatedKeys": ["Name", "Tooltip"],
"Data":
[
{
"Name": "Tiny",
"Tooltip": "This map size has barely any room for even the most basic resources.",
"Tiles": 128,
"Default": true
},
@sl5net
sl5net / flask-hello-worl_.flaskenv
Created January 4, 2021 19:37
Error: Could not locate a Flask application. i.imgur.com/VW0PCM2.png
FLASK_APP=app:create_app() # or app.py
FLASK_ENV=development
FLASK_DEBUG=0
# FLASK_RUN_EXTRA_FILES=
# FLASK_RUN_HOST=
# FLASK_RUN_PORT=8080
# FLASK_RUN_CERT=
# FLASK_RUN_KEY=