Skip to content

Instantly share code, notes, and snippets.

View sermuns's full-sized avatar
😬
might have broken something..

Samuel Åkesson sermuns

😬
might have broken something..
View GitHub Profile
@sermuns
sermuns / niri_toggle_output_scale_keybind.md
Last active December 2, 2025 19:07
Command+keybind to toggle Niri output scale

By running

OUTPUT=$(niri msg --json focused-output); niri msg output $(echo $OUTPUT | jq -r .name) scale $([ $(echo $OUTPUT | jq .logical.scale) = 1.0 ] && echo 2.0 || echo 1.0)

the current output's scale is toggled between 1.0 and 2.0.

Can be bound to a keystroke like this:

e.g. Mod+Shift+U:

@sermuns
sermuns / check_android_battery_health_with_adb.md
Last active December 2, 2025 18:47
Check Android battery health with ADB
  1. On the device, enable USB debugging (in developer options).

  2. Connect device to computer via USB.

  3. Run the following on computer:

adb shell awk '"BEGIN{print $(cat /sys/class/power_supply/battery/charge_full) / $(cat /sys/class/power_supply/battery/charge_full_design)}"'
  1. The number printed is the quotient between the reported current max charge and designed max charge.