Skip to content

Instantly share code, notes, and snippets.

KEY_Q 24
KEY_W 25
KEY_E 26
KEY_R 27
KEY_T 28
KEY_Y 29
KEY_U 30
KEY_I 31
KEY_O 32
KEY_P 33
@MahouShoujoMivutilde
MahouShoujoMivutilde / layouts.cpp
Created October 26, 2022 18:00
Keyboard layouts - list of brief names ("us") and long names ("English (US)") from xkbcommon / libxkbregistry
#include <string>
#include <iostream>
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbregistry.h>
int main() {
const auto CONTEXT = rxkb_context_new(RXKB_CONTEXT_LOAD_EXOTIC_RULES);
rxkb_context_parse_default_ruleset(CONTEXT);
@MahouShoujoMivutilde
MahouShoujoMivutilde / copyq-dmenu.sh
Created October 12, 2022 17:04
Use dmenu instead of `copyq show` to select clipboard entries
#!/usr/bin/env bash
read -r -d '' copyqjs << EOM
for (var i = 0; i < size(); i++) {
var lines = str(read(i)).split(/[\r\n]+/);
var line = "";
if (lines.length > 1) {
line = lines[0] + " (+" + str(lines.length - 1) + " more lines)";
} else {
@MahouShoujoMivutilde
MahouShoujoMivutilde / wikipedia-minerva.user.js
Last active August 20, 2021 15:26
User script to force wikipedia to use minerva skin (mobile look) without login in
// ==UserScript==
// @name Wikipedia minerva (style like on mobile)
// @namespace Violentmonkey Scripts
// @run-at document-start
// @include *.wikipedia.org/wiki/*
// @include *.wiktionary.org/wiki/*
// @include *.metapedia.org/wiki/*
// @version 1
// @grant none
// @noframes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MahouShoujoMivutilde
MahouShoujoMivutilde / README.md
Last active July 12, 2021 12:18
lf-keys.py - is the script that allows you to translate latin lf mappings to your non-latin keyboard layout

USAGE

  1. In lf-keys.py edit translists variable according to your needs (see comments).

  2. Concatenate default mappings (goes first) with your mappings (second), and pipe the result into lf-keys.py. E.g. like this:

grep '^map' ~/.config/lf/lfrc | cat ~/.config/lf/lf-defaults - | lf-keys.py > ~/.config/lf-localized-maps
@MahouShoujoMivutilde
MahouShoujoMivutilde / README.md
Last active July 23, 2024 07:58
fzf as dmenu replacement

fzf as dmenu replacement

Why? ...Because it's faster.

So you'll need:

  1. terminal that launches fast and supports custom class or window name. St fits the bill perfectly.

  2. window manager with an option to automatically put windows in center based on class or name. Most seem to have it.

@MahouShoujoMivutilde
MahouShoujoMivutilde / hideDotfilesOnAllDrives.ps1
Created January 7, 2019 21:49
A script to automatically hide dotfiles (on all drives in all subfolders recursively) on windows machine. Multithreaded.
workflow hideDotfilesOnAllDrives {
function hide($mask) {
$sw = [Diagnostics.Stopwatch]::StartNew()
ATTRIB +H /s /d $mask
$sw.Stop()
echo "$mask - $($sw.Elapsed.TotalSeconds)s"
}
@MahouShoujoMivutilde
MahouShoujoMivutilde / remove_vk_away.user.js
Last active June 19, 2024 22:17
remove_vk_away.user.js - конвертирует vk away ссылки внутри видимых на экране сообщениях в прямые url.
// ==UserScript==
// @name Remove vk away
// @description Конвертирует vk away ссылки внутри видимых на экране сообщениях в прямые url.
// @downloadURL https://gist.github.com/MahouShoujoMivutilde/e27ff32bfbccdec9a583b3d8ab831345/raw/remove_vk_away.user.js
// @updateURL https://gist.github.com/MahouShoujoMivutilde/e27ff32bfbccdec9a583b3d8ab831345/raw/remove_vk_away.user.js
// @namespace FuckVkAway
// @version 0.3.0
// @author MahouShoujoMivutilde
// @match https://vk.com/*
// @run-at document-end
// ==UserScript==
// @name HTTP in red on DuckDuckGo
// @namespace HttpInRedOnDuckDuckGo
// @version 0.3.0
// @updateURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js
// @downloadURL https://gist.githubusercontent.com/MahouShoujoMivutilde/186f595897d4f2fc13c010a2758781cd/raw/Mark_with_red_HTTP_sites_on_DuckDuckGo.user.js
// @author MahouShoujoMivutilde
// @match https://duckduckgo.com/*
// @run-at document-end
// @grant none