Skip to content

Instantly share code, notes, and snippets.

@Ropid
Ropid / monitor_journal.sh
Created December 10, 2020 21:09
Track system log for error messages and show desktop notifications (Linux, systemd-journal, libnotify)
#!/bin/bash
##
## Description:
## Track system log for error messages and show desktop notifications.
##
## filter messages that shouldn't show a notification
filter() {
grep --line-buffered -vE \
-e ': gkr-pam: unable to locate daemon control file$' \
@Ropid
Ropid / fanauto
Last active May 25, 2023 02:51
Fan control script (Linux, lm_sensors, hwmon)
#!/bin/bash
# This script is intended to control the fan speeds on an ASRock X470 Taichi
# motherboard, while also using a GPU's temperatures as input.
#
# ------------------------------
# ASRock X470 Taichi Motherboard
# ------------------------------
#
# This board's sensors are at /sys/devices/platform/nct6775.656/
@Ropid
Ropid / pavolume
Created August 6, 2018 15:09
PulseAudio volume control script (which will not go above 100%)
#!/bin/perl
use warnings;
use strict;
use v5.010;
$_ = qx/pacmd list-sinks/;
my ($sink, $vol) = /(?:^|\n)\h*\* index: (\S+).*?\n\h*volume:[^\n]*?(\d+)%/s;
if (scalar @ARGV == 1 and $ARGV[0] =~ /^ (-|\+)? (\d+)% | (toggle) $/x) {
if ($3) {
system "pactl set-sink-mute $sink toggle";