This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# License: CC0 <https://creativecommons.org/choose/zero/> | |
# Author: elundmark@posteo.se | |
# Link: https://gist.github.com/elundmark/a7e491a1a3b26834972adeeb4962a955 | |
# Using dbus and the mpv-mpris script: | |
# Targets either the frontmost player, | |
# or every instance of mpv (all), | |
# or one or more specific mpv processes by PID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
my_vpn_is() { | |
if /sbin/ethtool tun0 2>/dev/null | grep -qiP "link\s+detected"; then | |
echo up | |
else | |
echo down | |
fi | |
return 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright 2017 Thameera Senanayaka | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*:after, *:before { content: none !important; } | |
* { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; } | |
.archive .post, .blog .post, .search .grid-item, .search .page, .search .post, .single .post, .post-tags { | |
margin: 0 !important; } | |
.content { | |
float: none !important; | |
width: 100% !important; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
spin.js & | |
declare PID=$! | |
sleep 5s | |
kill -INT "$PID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
repeat_char () { | |
printf '%0*d' "$2" 0 | sed 's/0/'"$1"'/g' | |
return 0 | |
} | |
if ! command -v lolcat; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare tmp_file="/tmp/neomutt_ffp_piped_html" | |
if [[ -p /dev/stdout ]] ; then exit 0; fi | |
# Privacy - remove tmp file after 20 seconds | |
( sleep 20s && rm -f "$tmp_file" )& | |
# Disable fullscreen-mode if any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
f() { | |
local -a args=("${@}") valid_args=() | |
local -i i=0 len=${#args[@]} | |
for (( ; i < len; i++ )); do | |
if [[ "${args[i]}" != '' ]] ; then | |
valid_args+=("${args[i]}") | |
else | |
echo "Removed empty string [$((i+1))]" 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://wiki.archlinux.org/index.php/NetworkManager#Network_services_with_NetworkManager_dispatcher | |
# cat /etc/NetworkManager/dispatcher.d/00_reconnect_mullvad.sh | |
# | |
# sudo cp -f -v -t /etc/NetworkManager/dispatcher.d/ ~/bin/00_reconnect_mullvad.sh | |
# sudo chmod a+x /etc/NetworkManager/dispatcher.d/00_reconnect_mullvad.sh | |
# create lockfile | |
if ! mkdir /tmp/.reconnecting_mullvad_vpn ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare tmp_folder="$HOME/.ramdisk/.ddg" tmp_file | |
mkdir -p "$tmp_folder" || exit 1 | |
declare URL='https://duckduckgo.com/' | |
declare -i image_search=0 swedish_only=0 from_console=0 | |
declare -a args=() | |
while getopts ":isc" options ; do | |
case "$options" in |