Skip to content

Instantly share code, notes, and snippets.

View MeganerdNL's full-sized avatar
🖖

MeganerdNL

🖖
  • Netherlands
View GitHub Profile
@MeganerdNL
MeganerdNL / 1 uupd-custom.service
Last active September 20, 2026 10:00
Systemd (user) services and scripts for custom check on system updates and give a notification on Bazzite. Remove the numbers in front of the filesnames, they are for ordering in the gist. There is 1 system service with a timer and 1 user service with a timer. Besides that 2 scripts that are called from the services.
## Place in /etc/systemd/system
## Service is started by the timer
[Unit]
Description=Custom Universal Blue Update Oneshot Service
StartLimitBurst=3
StartLimitIntervalSec=600
[Service]
Type=oneshot
@MeganerdNL
MeganerdNL / mc-wrapper-homebrew-bash.sh
Last active September 14, 2026 18:26
mc-wrapper script to exit in the last active directory of Midnight Commander for the bash shell (homebrew version)
## Place somewhere: for example ~/bin/mc-wrapper-homebrew-bash.sh
## Paste the following in ~/.bashrc: alias mc='. ~/bin/mc-wrapper-homebrew-bash.sh'
if test -n "$MC_TMPDIR"; then
MC_PWD_FILE="`mktemp "${MC_TMPDIR}/mc.pwd.XXXXXX"`"
elif test -n "$TMPDIR"; then
MC_PWD_FILE="`mktemp "${TMPDIR}/mc.pwd.XXXXXX"`"
else
MC_PWD_FILE="`mktemp "/tmp/mc.pwd.XXXXXX"`"
fi
@MeganerdNL
MeganerdNL / mc-wrapper-homebrew-fish.fish
Last active September 14, 2026 18:27
mc-wrapper script to exit in the last active directory of Midnight Commander for the fish shell (homebrew version)
## mc-wrapper script to exit in the last active directory of Midnight Commander for the fish shell (homebrew version)
## Place in: ~/.config/fish/functions/mc-wrapper-homebrew-fish.fish
## Original author: Arkadiusz Halicki (https://github.com/halicki)
## Adjusted with help from: Azlan Mukhtar (https://github.com/azlan)
function mc
set SHELL_PID %self
if not test -d "/tmp/mc-$USER"
@MeganerdNL
MeganerdNL / battery-charge-limit.service
Last active September 14, 2026 18:36
Oneshot systemd service file for the Framework 16 laptop to set battery charge limit
## Oneshot systemd service file for the Framework 16 laptop to set batery charge limit
## Defaults here is to stop charging at 80%. Customize as needed
## The framework 16 laptop does NOT support a start threshold (charge_control_start_threshold) atm (sept 2026)
## Place in: /etc/systemd/system/battery-charge-limit.service
## Reload after making: sudo systemctl daemon-reload
## Enable and start: sudo systemctl enable --now battery-charge-limit.service
[Unit]
Description=Set battery charge limit
@MeganerdNL
MeganerdNL / mc-wrapper-regular-fish.fish
Last active September 14, 2026 18:28
mc-wrapper script to exit in the last active directory of Midnight Commander for the fish shell (regular version)
## mc-wrapper script to exit in the last active directory of Midnight Commander for the fish shell (regular version)
## Place in: ~/.config/fish/functions/mc-wrapper-regular-fish.fish
## Original author: Arkadiusz Halicki (https://github.com/halicki)
## Adjusted with help from: Azlan Mukhtar (https://github.com/azlan)
function mc
set SHELL_PID %self
if not test -d "/tmp/mc-$USER"