Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# REQUIRES: xdotool wmctrl
# AUTHOR: Ethan Djeric <[email protected]>
# CONFIRMED WM COMPATIBILITY: kwin
# Usage:/path/to/toggle_front.sh </path/to/BINARY> <WINDOW CLASS>
# /path/to/BINARY can be any callable command from $PATH that runs the program.
# <WINDOW CLASS> can be found by taking the constant part of the name present in the window bar;
# typically the format is <INSTANCE NAME> - <WINDOW NAME>.
@deafmute1
deafmute1 / .zshrc
Last active October 30, 2019 08:27
.zshrc on turnip
# Path to your oh-my-zsh installation.
export ZSH="/root/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will load a random theme each time oh-my-zsh is loaded,
ZSH_THEME="random"
# Set list of themes to pick from when loading at random
ZSH_THEME_RANDOM_CANDIDATES=(crcandy avit bira kphoen xiong-chiamiov xiong-chiamiov-plus rkj-repos gnzh funky darkblood bira agnoster ys)
# Uncomment the following line to use case-sensitive completion.
@deafmute1
deafmute1 / forcexrandr.sh
Last active October 26, 2019 06:31
forces modelines for xrandr that do not cause visual glitching (for radish)
#!/bin/bash
#forces modelines for xrandr that do not cause visual glitching (for radish)
var1=$RANDOM
var2=$RANDOM
#DVI-D-0 LG
xrandr --newmode "59.93-$var1" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync +vsync
xrandr --addmode DVI-D-0 "59.93-$var1"
xrandr --output DVI-D-0 --mode "59.93-$var1"
@deafmute1
deafmute1 / httpup.sh
Last active December 27, 2019 10:41
fetches the relative path of files uploaded to webserver in /files (from a remote mount) and sends full URL to clipboard
#!/bin/bash
# takes path to file (on local machine) as argument and uploads it to /files on webserver.
cp "$1" /media/ayew/turnip/var/www/html/files
#outputs the url to clipboard, requires package xclip
path="$(find /media/ayew/turnip/var/www/html/files -type f -printf "%T@ %p\n" | sort -n | tail -n 1 | cut -d' ' -f 2- | sed 's#/media/ayew/turnip/var/www/html/#/#g')"
echo -n "https://ayew.host"$path"" | xclip -selection clipboard
@deafmute1
deafmute1 / calibreadd.sh
Last active October 26, 2019 06:31
automagically handles importing of ebooks from set folders (from deluged) and associated jobs
#!/bin/bash
#automagically handles importing of ebooks from set folders (from deluged)
import=/mnt/media/Media/Calibre/CalibreImport
download=/mnt/data/torrent/download
httplib=http://localhost:8080/#CalibreLib
physlib=/mnt/media/Media/Calibre/CalibreLib
media=/mnt/media/Media
echo stopping calibre-web