Skip to content

Instantly share code, notes, and snippets.

@ghostface
ghostface / vtx.lua
Last active October 16, 2022 15:27
VTX Power switching via transmitter switch (Opentx/Betaflight/Tramp/Smartaudio)
--
-- *Fixed version of wkochFPV for BF 3.5
-- Original: https://github.com/betaflight/betaflight/issues/3094#issuecomment-302953603
-- Note: If you put it on a 3-way switch and go from first to third position fast it may not register correctly so better step through slowly
--
-- *Changes:
-- Corrected loading of dependencies
-- Shortened filename to make it compatible with latest opentx restrictions
-- Added a condition in the script for pit mode (vtx power 0 alone didn't work for me)
--
@ghostface
ghostface / greetd_tuigreet.md
Created August 27, 2021 07:27
Greetd + tuigreet
❯ cat /etc/greetd/tuigreet_wrap.sh
#!/bin/bash
GPU=`asusctl graphics -g`
tuigreet /home/christoph/bin/sway --sessions /etc/greetd/tuigreet_sessions --time  -i
❯ cat /etc/greetd/config.toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 7
@ghostface
ghostface / dunstrc
Created August 11, 2021 12:27
dunstrc
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
@ghostface
ghostface / pulsevol
Created August 11, 2021 12:24
Wrapper for volume control with dunst notification
#!/bin/bash
# Arbitrary but unique message id
msgId="991049"
# Change the volume using alsa(might differ if you use pulseaudio)
#amixer -c 0 set Master "$@" > /dev/null
if [[ $1 == "up" ]]; then
pamixer -i 5
@ghostface
ghostface / sway.conf
Last active August 6, 2021 19:42
~/.config/sway/config
###########################################################
# Christophs sway config
###########################################################
set $mod Mod4
mouse_warping container
# Font
font pango:Monospace 12
@ghostface
ghostface / zephyrus_g14_gaming_tty2.md
Last active July 29, 2021 19:16
Zephyrus G14 - tty1,sway,iGPU and tty2,xorg,dGPU

Intro

On the Zephyrus G14 the gpu situation is as follows:

  • HDMI port is wired to the iGPU (amd)
  • USB-C Displayport is wired to the dGPU (nvidia)

Sway (wayland) now supports prime render offloading with nvidia 470 drivers however:

  • Render offloading has a performance hit so not ideal for gaming
  • Using the dGPU as primary doesn't work to my knowledge
  • As such no usb-c -> displayport support
$fn=64*1;
function sumv(v,i,s=0) = (i<=s ? v[i] : v[i] + sumv(v,i-1,s));
// (ugh, i'm using base 1 to make the UI readable and it's making me sad)
// Inner diameter #1 (mm). You can have up to 8 inner diameters in this pack; if you want fewer, just set the others to zero.
id1 = 2;
// Inner diameter #2 (mm). Zero to ignore.
id2 = 0;
#!/usr/bin/env python
import re, argparse, sys, time
import shutil, os
from serial import Serial
# call like this ./serial_test.py /dev/ttyACM0 115200 labeloflog
# note: edit paths in script accordingly - could/should be cleaned up a bit
CLI_DELIMITER = '# '
@ghostface
ghostface / README.md
Created January 31, 2019 15:42
SCRIPT-8
@ghostface
ghostface / README.md
Created January 31, 2019 15:42
SCRIPT-8