Skip to content

Instantly share code, notes, and snippets.

View AltonV's full-sized avatar

Magnus Smedberg AltonV

  • Sweden
  • 22:46 (UTC +02:00)
View GitHub Profile
@AltonV
AltonV / battery-headset-widget.sh
Created August 24, 2024 12:09
Script for displaying headset battery status in a command output widget using the headsetcontrol program
#!/usr/bin/env bash
BATTERY=$(headsetcontrol -c -b)
RESULT=$?
if (( RESULT == 0 )) && (( BATTERY >= 0 )); then
# Connected
echo "🎧 $BATTERY%"
elif (( BATTERY == -1 )); then
# Charging
@AltonV
AltonV / dim-if-on.js
Last active August 1, 2023 14:52
Homey dim all dimmable lights that are on
/*
* Dims all lights that are on
*/
let val = 0.01
if (args[0]) {
val = parseFloat(args[0]);
}
const devices = await Homey.devices.getDevices();
@AltonV
AltonV / youtube-shorts-in-regular-player.js
Last active June 28, 2022 12:05
Changes links to youtube shorts to open in the regular player instead
// ==UserScript==
// @name Youtube Shorts In Regular Player
// @namespace https://github.com/AltonV
// @version 0.1
// @description Changes links to youtube shorts to open in the regular player instead
// @author AltonV
// @match *://*.youtube.com/*
// @updateURL https://gist.githubusercontent.com/AltonV/a9ac62e5f42e0a895185643941ea289a/raw/45846b86ea5f8d290f6bd012d16f01ba81f56ea5/youtube-shorts-in-regular-player.js
// @downloadURL https://gist.githubusercontent.com/AltonV/a9ac62e5f42e0a895185643941ea289a/raw/45846b86ea5f8d290f6bd012d16f01ba81f56ea5/youtube-shorts-in-regular-player.js
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAe1BMVEVHcEymAACFhYXkAAC/AADyAADTAAD/////Ly//AwPhBgbxAAAmAAD5AADxAADJAADVBATaDw+BAADTAgL/LCzWAADhCAjfGhr/KCjnAAD0AADOAAD/AAD/////9/f/7+//e3v/UFD/vr7/qan/PT3/39//kJD/Kir/zc0Q/tNHAAAAHHRSTlMALQOZg+HKD8j9S+wQ88ttWX4fO6+0imqYqbniBuNvagAAAZNJREFUWIXtlt1ygjAQhTdEaBOSQEQBNVGrrfX9n7ABRlvR/EhueuGZYRgg52MTluwCvPTSv1LCEKp

Keybase proof

I hereby claim:

  • I am altonv on github.
  • I am altonv (https://keybase.io/altonv) on keybase.
  • I have a public key ASDyO-jLw2FfgD-AaylGCUxUgXZ-DeCJW8XzB_-e420RLQo

To claim this, I am signing this object:

/*
* Connector Docking Status 1.5.3
* by AltonV
*
* This is a script that sets the name of connectors according to the status,
* if they are locked, in proximity, unoccupied or disabled.
*
* Features:
* -- Show on hud (configurable, default is only when unoccupied)
* !! Currently not working as of the release of this version due to game changes