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 | |
last_hsvol=64 | |
while true; do | |
hsvol=$(headsetcontrol -o json | jq '.devices[0].chatmix') | |
vol=$(echo "scale= 5; $hsvol / 128 * 100" | bc) | |
if (( $hsvol != $last_hsvol )); then | |
wpctl set-volume @DEFAULT_SINK@ $vol% -l 1.0 | |
last_hsvol=$hsvol |
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/python | |
''' | |
* setup displays first, e.g. with wdisplay | |
* run after setting up your displays `python sway_workspaces.py save <profilename>` | |
* repeat for every display setup | |
* setup kanshi and make it run `python sway_workspaces.py load <profilename>` | |
Multiple windows of an application/class aren't handled. No idea how to do so. | |
Had to alter the default tree, so the outputs are not the ports. |
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
/** | |
* @name TwitFix | |
* @version 1.5 | |
* @authorLink https://github.com/Nama | |
* @website https://yamahi.eu | |
* @description Send twitter links with preview | |
* @source https://gist.github.com/Nama/e61a13c29717b8eff48fa3ff41fc4ddd | |
* @updateUrl https://gist.githubusercontent.com/Nama/e61a13c29717b8eff48fa3ff41fc4ddd/raw/ | |
*/ |
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
# https://stackoverflow.com/a/39319540 | |
Add-Type @' | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
namespace PInvoke.Win32 { | |
public static class UserInput { | |
[DllImport("user32.dll", SetLastError=false)] | |
private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); | |
[StructLayout(LayoutKind.Sequential)] |
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 | |
#/etc/udev/rules.d/95-monitor-hotplug.rules | |
#KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/yama/.Xauthority", RUN+="/home/yama/scripts/monitor-hotplug.sh" | |
# udevadm control --reload-rules && udevadm trigger | |
xrandr | grep -q "DP2-8 connected" | |
connected1=$? | |
xrandr | grep -q "DP2-1-8 connected" |
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/python | |
import os | |
import i3ipc | |
import sys | |
import pickle | |
PATH = os.path.expanduser("~/.config/i3/workspace_mapping") | |
def showHelp(): |
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/python | |
from sh import hostname, checkupdates, yay, touch | |
from tg_bot import send | |
chatid = '000000000' | |
updates = checkupdates() | |
if updates: |
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 python | |
from flask import Flask, request, url_for | |
from werkzeug.contrib.atom import AtomFeed | |
from html.parser import HTMLParser | |
import urllib.request | |
from datetime import datetime | |
app = Flask(__name__) | |
url_noc = 'https://noc.rub.de/cgi-bin/status/' |
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 | |
KERNEL="/boot/vmlinuz-linux" | |
hibernate() { | |
grep $(uname -r) $KERNEL* > /dev/null | |
if [[ $? == 0 ]]; then | |
echo "Newest kernel is running, hibernating..." | |
systemctl hibernate | |
else | |
echo "New kernel is installed, can't continue after hibernate..." |
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 | |
mnthdd() { | |
# The full mount-path is put together bei $MOUNTPATH and $DRIVES | |
# In this example it would be /media/ + your parameter | |
MOUNTPATH="/media/" | |
# /etc/fstab | |
## hdd1 | |
#/dev/mapper/hdd1 /media/hdd1 ext4 noauto,defaults 0 0 | |
# |
NewerOlder