Skip to content

Instantly share code, notes, and snippets.

@p-fruck
p-fruck / toggle-win-alt.sh
Last active May 2, 2025 13:23
Toggle swap_alt_win on gnome desktop (MX Keys for Mac on Linux with EurKEY US Layout)
#!/bin/sh
set -e
regular="@as []"
swapped="['altwin:swap_lalt_lwin', 'lv3:rwin_switch']"
current=$(gsettings get org.gnome.desktop.input-sources xkb-options)
if [ "${current}" == "${regular}" ]; then
echo "Switching to Mac keyboard"
gsettings set org.gnome.desktop.input-sources xkb-options "${swapped}"
elif [ "${current}" == "${swapped}" ]; then
@p-fruck
p-fruck / flatpak-nextcloud-client-nautilus.md
Last active March 11, 2026 09:38
Flatpak Nextcloud Client Nautilus Integration

Setup

This has been tested on Fedora Silverblue and might need adaptation for other distros. This setup enables nextcloud integration for nautilus with the flatpak version of the nextcloud desktop client.

Prerequisites

The following packages must be installed

@p-fruck
p-fruck / apt-cve-checker.sh
Created March 26, 2022 21:24
APT CVE checker script
#!/bin/bash
# A minimal CVE checker script for apt
# License: GPL-3.0
while read package version; do
offset=$(apt changelog ${package} 2>/dev/null | grep -n '(${version})' | cut -d ':' -f 1)
cves=$(apt changelog ${package} 2>/dev/null | head -${offset} | grep -o 'CVE-[0-9]\+-[0-9]\+')
[[ ! -z "$cves" ]] && echo ${package} ${cves} || echo "x: ${package} ${version}"
done <<< $(apt list --upgradable 2> /dev/null | sed -e 's|/.*from:||g' -e 's|\]$||g' | tail +2)
@p-fruck
p-fruck / dualis.sh
Last active October 7, 2021 06:02
Bash script for fetching DHBW Dualis grades
#!/bin/bash
# Dualis notification script by p-fruck <dev@p-fruck.de>
# License: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
#
# This script is intended to be used within a cronjob and will use the
# notify-send command once it detects new grades. However you can simply
# modify the code and use e.g. email notification instead. Have fun.
username=user@dhbw.de
password=Password1!
baseurl="https://dualis.dhbw.de/scripts/mgrqispi.dll"