Skip to content

Instantly share code, notes, and snippets.

View strycore's full-sized avatar
:shipit:
Founder of Lutris, the open gaming platform for Linux.

Mathieu Comandon strycore

:shipit:
Founder of Lutris, the open gaming platform for Linux.
View GitHub Profile
@strycore
strycore / setlayout.py
Last active September 17, 2016 19:40
Test layout switching in python
import os
import time
import subprocess
print("Set layout to 'us'")
setxkbmap_command = ['setxkbmap', '-model', 'pc101', 'us', '-print']
xkbcomp_command = ['xkbcomp', '-', os.environ.get('DISPLAY', ':0')]
xkbcomp = subprocess.Popen(xkbcomp_command, env=os.environ, stdin=subprocess.PIPE).stdin
subprocess.Popen(setxkbmap_command,
@strycore
strycore / mailbot.py
Created August 21, 2016 08:07
Download emails from an imap folder
#!/usr/bin/python3
import os
import ssl
import imaplib
from configparser import ConfigParser
config_path = os.path.expanduser('~/.mailbot.conf')
parser = ConfigParser()
parser.read(config_path)
@strycore
strycore / designer.html
Last active August 29, 2015 14:16
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
@strycore
strycore / vdf_parser.py
Created June 8, 2013 15:18
Parser for Steam VDF files
import os
import json
def vdf_parse(steam_config_file, config):
line = " "
while line:
line = steam_config_file.readline()
if not line or line.strip() == "}":
return config
@strycore
strycore / setup.sh
Last active November 28, 2020 05:59
Setup script for installing Terraria on Ubuntu
#!/bin/bash
# installing dependencies
dependencies="libmonogame-cil ffmpeg mmv libopenal1 zenity"
install_deps=0
for package in $dependencies; do
echo $package
dpkg -s $package | grep installed
if [ $? == 0 ]; then
install_deps=1
@strycore
strycore / build-gimp-git.sh
Created April 5, 2012 10:40
Gimp git installer script for Ubuntu
#!/bin/bash
# Resources
# http://www.gimpusers.com/tutorials/compiling-gimp-for-ubuntu
# http://ubuntuforums.org/showthread.php?p=11818979
#
sudo apt-get build-dep gimp
sudo apt-get install libjpeg62-dev libopenexr-dev librsvg2-dev libtiff4-dev
mkdir gimp_build && cd gimp_build
@strycore
strycore / lifesupport-unplug.py
Created February 22, 2011 21:37
unplug life support
#!/usr/bin/python
import time
import os.path
while True:
if not os.path.exists("/dev/input/js0"):
break
else:
# Do stuff here