Skip to content

Instantly share code, notes, and snippets.

View rien333's full-sized avatar

Rijnder Wever rien333

View GitHub Profile
#!/usr/bin/sh
echo "message-info 'Opening $QUTE_URL with mpv'" >> "$QUTE_FIFO" &
if echo "$QUTE_URL" | grep -q 'youtube'; then
youtube-viewer -A --quiet --no-video-info --no-interactive --no-get-captions --append-arg="--osc yes " --player "mpv" "$QUTE_URL"
elif echo "$QUTE_URL" | grep -q 'bandcamp\.com'; then
d="bandcamp-"$(date +%s)
mkdir -p /tmp/$d
bandcamp-dl --base-dir /tmp/$d --template='%{track}' "$QUTE_URL" > /dev/null 2> /dev/null &
echo "01.mp3.tmp" > /tmp/$d/playlist.txt
$ sudo tlp-stat -s -b
--- TLP 1.2.2 --------------------------------------------
+++ System Info
System = HUAWEI M14 MACH-WX9
BIOS = 1.12
Release = "Arch Linux"
Kernel = 5.5.0-1-mainline #1 SMP PREEMPT Mon, 27 Jan 2020 10:55:21 +0000 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-linux-mainline root=UUID=811aabe2-ca25-4039-ae49-bd4fa1de5dc3 rw console=tty12 quiet loglevel=1 vga=current rd.systemd.show_status=false udev.log_priority=3 acpi_osi=Linux i915.fastboot=1 i915.enable_fbc=1 i915.enable_psr=0 i915.enable_guc=2 i915.enable_dc=2 i915.disable_power_well=0i915.error_capture=0 i915.modeset=1 drm.vblankoffdelay=1 drm.debug=0 snd_hda_intel.power_save=1 pcie_aspm=force pcie_port_pm=on nmi_watchdog=0 nowatchdog
Init system = systemd
23:59:12 DEBUG keyboard basekeyparser:_debug_log:196 Clearing keystring (was: :).
23:59:12 DEBUG commands command:run:541 command called: set-cmd-text [':']
23:59:12 DEBUG commands command:run:555 Calling qutebrowser.mainwindow.statusbar.command.Command.set_cmd_text_command(<qutebrowser.mainwindow.statusbar.command.Command>, ':', None, False, False, False)
23:59:12 DEBUG completion completer:schedule_completion_update:215 Scheduling completion update.
23:59:12 DEBUG completion completer:schedule_completion_update:212 Ignoring update because there were no changes.
23:59:12 DEBUG modes command:set_cmd_text:112 Setting command text, focusing <qutebrowser.mainwindow.statusbar.command.Command>
23:59:12 DEBUG modes modeman:enter:317 Entering mode KeyMode.command (reason: cmd focus)
23:59:12 DEBUG statusbar text:set_text:56 Setting normal text to '-- COMMAND MODE --'.
23:59:12 DEBUG statusbar bar:set_mode_active:291 Setting command flag to True
~> pyinstrument --show-all (which castero)
_ ._ __/__ _ _ _ _ _/_ Recorded: 19:07:19 Samples: 469
/_//_/// /_\ / //_// / //_'/ // Duration: 0.899 CPU time: 0.748
/ _/ v3.0.0
Program: /usr/bin/castero
0.898 <module> castero:3
└─ 0.898 load_entry_point pkg_resources/__init__.py:487
# Maintainer: Rijnder Wever <rien334@gmail.com>
pkgname='fd-git'
pkgver=7.4.0.r3.gd48aeda
pkgrel=1
pkgdesc="Simple, fast and user-friendly alternative to find"
arch=('x86_64')
url='https://github.com/sharkdp/fd'
license=('MIT' 'APACHE')
depends=('gcc-libs')
#!/bin/sh
[ $2 != "playing" ] && exit 0
# file_path=$(echo "$@" | grep -o "file .*\...." | sed s/file\ //) # Does not always work?
# file_path=$(echo "$@" | sed -e 's/^.*file //; s/artist.*$//') # new sed command
file_path=$(echo "$@" | sed -e 's/.*file \(.*\) artist.*/\1/') # Experimental!
# try albumartist instead of artist
if [ "$file_path" = "$@" ] ;then
#!/usr/bin/sh
# disable some processes from showing
systemctl -t service --plain --no-legend --no-pager list-unit-files --state enabled,disabled | grep -Fv -e freedesktop -e systemd | sed 's/\..*//' > /tmp/sysunits &
systemctl list-unit-files -t service --no-legend --user --state enabled,disabled | sed 's/\..*//' > /tmp/usrunits &
action=$(dmenu <<EOF
start
stop
restart
This file has been truncated, but you can view the full file.
8523 15:46:03 execve("/usr/bin/mpv", ["mpv", "--no-config", "--log-file=mpv_is_slow", "--no-audio", "--vo=gpu", "--no-resume-playback", "Casiotone for the Painfully Alon"...], 0x7ffc30f1bac8 /* 32 vars */) = 0 <0.000696>
8523 15:46:03 brk(NULL) = 0x55a11421f000 <0.000178>
8523 15:46:03 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffce9274700) = -1 EINVAL (Invalid argument) <0.000018>
8523 15:46:03 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000142>
8523 15:46:03 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000154>
8523 15:46:03 fstat(3, {st_mode=S_IFREG|0644, st_size=243746, ...}) = 0 <0.000141>
8523 15:46:03 mmap(NULL, 243746, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fea9f586000 <0.000029>
8523 15:46:03 close(3) = 0 <0.000121>
8523 15:46:03 openat(AT_FDCWD, "/usr/lib/libshaderc_shared.so.1", O_RDONLY|O_CLOEXEC) = 3 <0.000186>
8523 15:46:03 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 P\0\0\0\0\0\0"..., 832) = 832 <0.00
#!/bin/bash
xidfile="/run/user/"$(id -u)"/zathura-tabbed.xid"
wmclass="zathura-tabbed"
xid=$(cat "$xidfile") && xprop -id "$xid"
read xid < <(tabbed -cd -n "$wmclass" -p -1 2> /dev/null)
wmctrl -i -r "$xid" -b add,maximized_vert,maximized_horz
echo "$xid" > "$xidfile"
@rien333
rien333 / observer.m
Last active January 22, 2018 23:43
Command-line app that tells a bitbar chunkwm plugin to refresh whenever the user changes spaces
#import <Cocoa/Cocoa.h>
@interface SpaceChangeNotifier : NSObject
- (void) registerNotifier;
- (void)spaceChanged:(NSNotification *)aNotification;
@end
@implementation SpaceChangeNotifier
- (id) init