FFFF
Skip to content

Instantly share code, notes, and snippets.

View krisu5's full-sized avatar
✌️
Making things pretty

Kristian Salonen krisu5

✌️
Making things pretty
View GitHub Profile
-- Toggle redshift when viewing videos with mpv
-- When pausing redshift is reenabled (and disabled again when continuing)
-- Original script by CreamyCookie, retrieved from Wayback Machine: https://web.archive.org/web/20240920135304/https://gist.github.com/CreamyCookie/079570ad0dd27d322421f6637c828ab8
-- If running
if os.execute("pgrep -x redshift >/dev/null") ~= 0 then
rs_enabled = true
else
rs_enabled = false
-- Toggle redshift when viewing videos with mpv
-- When pausing redshift is reenabled (and disabled again when continuing)
-- This script assumes that redshift is running
-- Original script by CreamyCookie, retrieved from Wayback Machine: https://web.archive.org/web/20221014123046/https://gist.github.com/CreamyCookie/d036b66af4e17ea527d08e303eb96145
rs_enabled = true
function rs_toggle()
os.execute("pkill -x -USR1 redshift")
@krisu5
krisu5 / set-icon.sh
Last active January 13, 2025 23:38 — forked from michaeljymsgutierrez/set-icon.sh
Set icon on window and panel - xseticon
#! /bin/bash
# @params $1: APP_NAME
# @params $2: ICON_PATH
# set-icon.sh Slack /usr/share/pixmaps/slack.png
# Note: Make sure xseticon is installed on your system
# If not installed: https://github.com/xeyownt/xseticon
# Either/usr/bin or /usr/local/bin is fine for script directory
# sudo cp set-icon.sh /usr/local/bin
@krisu5
krisu5 / anilist_anti-social_extras.user.css
Last active April 21, 2021 12:09
AniList - Anti-Social (Extras)
/* ==UserStyle==
@name AniList - Anti-Social (Extras)
@author krisu (https://github.com/krisu5)
@namespace github.com/krisu5/userstyles
@homepageURL https://github.com/krisu5/userstyles/tree/master/AniList%20-%20Anti-Social
@version 1.0.0
@license unlicense
@preprocessor default
==/UserStyle== */
// ==UserScript==
// @name Reddit - /r/random with keyboard shortcut
// @description Easy access to discover random subreddits. Just press r+e
// @namespace krisu
// @include *://www.reddit.com/*
// @grant none
// ==/UserScript==
/* Mousetrap v1.4.6 by Craig Campbell <craig.is/killing/mice> */
(function(J,r,f){function s(a,b,d){a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent("on"+b,d)}function A(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return h[a.which]?h[a.which]:B[a.which]?B[a.which]:String.fromCharCode(a.which).toLowerCase()}function t(a){a=a||{};var b=!1,d;for(d in n)a[d]?b=!0:n[d]=0;b||(u=!1)}function C(a,b,d,c,e,v){var g,k,f=[],h=d.type;if(!l[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(g=0;g<l[a].length;++g)if(k=
0