Skip to content

Instantly share code, notes, and snippets.

@pdc4444
pdc4444 / workspace_switcher.php
Created June 16, 2021 15:05
This script was written to quickly swap between desktops in GNOME2 (might work in GNOME3).
<?php
/*
This script was written to quickly swap between desktops in GNOME2 (might work in GNOME3).
Logic is written to determine if the current desktop +1 or -1 exists so the user can pass the --next or --previous flags.
If the previous or next desktop does not exist then the desktop does not switch (it does not loop).
You might think "Why not use xdotool?" The reason I'm not using xdotool is so that the keys that it presses do no get passed to windows which grab keyboard input.
For example, using virt-viewer if you were to script xdotool to a hotkey, the actual key presses would be sent to the virtual machine instead of the hostmachine.
@pdc4444
pdc4444 / audio_helper.php
Created September 9, 2020 16:32
Easily create an audio pipe for use with OBS
<?php
/**
* This script was created for use in Linux with PulseAudio. It will dynamically create a null sink via pactl and a combined sink to listen in on that newly created null sink on the output of your choice.
* My personal use case is to easily create a new combined audio pipe that includes game audio and the virtual audio sink so I can stream only my game audio via OBS but also be able to hear it!
*
* Dependencies:
* pulseaudio
* pavucontrol
* php-cli
@pdc4444
pdc4444 / refresh_ark_shortcuts.php
Created December 30, 2019 15:51
Creates ark shortcuts on your desktop to quickly join a server.
<?php
/**
* The purpose of this script is to create custom ark shortcuts on your desktop that automatically will connect you to the server of your choosing.
* This avoids Wildcard's dumb menu which is currently bugged out and will sometimes crash your game :(
*
* Another reason for this script's existence is the fact that I can't put a hostname into the shortcut and have it automatically be resolved (it has to be an ip address).
*
* Code Flow:
* - Get the ip address to elephantbox.net