Skip to content

Instantly share code, notes, and snippets.

@M4he
M4he / via_offline.md
Created November 3, 2023 18:01
How to use the QMK VIA app offline on Linux

Using the VIA app offline on Linux

  1. make sure to configure the udev rule first
  2. prepare Node.js on your Linux system either by installing it from your system repositories or by downloading it from https://nodejs.org/en and adding it to your PATH variable
  3. clone the VIA app git repository from https://github.com/the-via/app, e.g. git clone https://github.com/the-via/app.git
  4. enter the directory of the cloned git repository in a terminal
  5. execute npm install to install the required node modules for the app (you only need to do that once)
  6. execute npm run start (this will start the app server on your local machine in the background)
  7. open the displayed localhost URL in your browser, for example http://localhost:5173/
  8. use the VIA app as usual (for NuPhy keebs remember to enable the design tab and load the JSON first)
@M4he
M4he / pcmanfm-qt-pathbar-fix.qss
Created March 29, 2023 19:34
PCManFM-Qt QSS fix for discolored PathBar when using the Breeze Qt5 style
// Add this as a .qss file to "Style Sheets" in qt5ct
//
// Notes:
// PathBar is within the Fm C++ namespace, see:
// https://github.com/lxqt/libfm-qt/blob/abd4aaa91c44d8141cdcc04972b906e10285a52f/src/pathbar.cpp#L36
// https://doc.qt.io/qt-5/stylesheet-syntax.html#widgets-inside-c-namespaces
Fm--PathBar QScrollArea, Fm--PathBar .QWidget {
background: transparent;
}
@M4he
M4he / pcmanfm-qt_disable_smooth_scrolling.patch
Created February 2, 2023 21:56
PCManFM-Qt patch for disabling smooth-scrolling to fix scrolling behavior on touchpad devices, until https://github.com/lxqt/libfm-qt/pull/875 lands in packages
--- src/folderview.cpp.orig 2023-02-02 22:54:09.780036423 +0100
+++ src/folderview.cpp 2023-02-02 22:50:06.284034359 +0100
@@ -1592,9 +1592,6 @@
return true;
}
}
- // row-by-row scrolling when Shift is pressed
- if((QApplication::keyboardModifiers() & Qt::ShiftModifier)
- && (mode == CompactMode || mode == DetailedListMode)) // other modes have smooth scroling
{
@M4he
M4he / x11-desktop-a-b-switcher.py
Last active April 9, 2023 10:51
A Python3 Xlib script to a-b switch between recently used virtual desktops
#!/usr/bin/env python3
"""EWMH A-B desktop switcher (aka switch to the previously selected desktop)
A Python script for X11 that listens to changes of the current virtual desktop
and remembers the previously selected virtual desktop based on the
_NET_CURRENT_DESKTOP EWMH extension in X11.
It also listens on a UNIX socket, which if sent to, will switch back to the
remembered previous desktop.
@M4he
M4he / pcmanfm-qt_default_to_slow_scrolling.patch
Created October 19, 2022 13:27
PCManFM-Qt patch for making default scrolling slow (row-by-row) and only fast with Shift key (like Dolphin, the reverse of PCManFM-Qt's default behavior)
--- src/folderview.cpp.orig 2022-10-19 15:22:15.688067732 +0200
+++ src/folderview.cpp 2022-10-19 15:10:59.396065442 +0200
@@ -1592,8 +1592,8 @@
return true;
}
}
- // row-by-row scrolling when Shift is pressed
- if((QApplication::keyboardModifiers() & Qt::ShiftModifier)
+ // row-by-row scrolling when Shift is NOT pressed
+ if (!(QApplication::keyboardModifiers() & Qt::ShiftModifier)
@M4he
M4he / kvm-gpu-passthrough-on-debian-buster.md
Created February 7, 2021 01:36
Setting up KVM with GPU passthrough in Debian Buster

Here's how to set up a Windows 10 virtual machine in KVM with PCI passthrough. The VM will have access to an NVIDIA graphics card while the host machine (running Debian Buster) uses Intel integrated graphics. This is mostly for my own reference so I don't forget how I did it.

Hardware

  • Intel i5 (an old one) with integrated graphics: this will be used as the graphics card for the host machine running Debian Buster
  • NVIDIA Geforce 1070: this will be used as the graphics card for the Windows 10 VM

Step 1: Enable IOMMU

In order to do hardware passthrough with KVM at all, you need to enable the Intel Vt-d virtualization extensions. Edit /etc/default/grub and edit the GRUB_CMDLINE_LINUX_DEFAULT line so that it reads like:

@M4he
M4he / pcmanfm_hide_menubar.patch
Last active October 1, 2022 22:32
PCManFM patch for hiding menubar toggle (GTK2 version), accessed via 'View' menu or pressing Ctrl+M
Description: Make menubar visibility optional
Introduces a new toggle for hiding the menubar in the 'View' menu
as well as via Ctrl+M.
pcmanfm (1.3.1-1)
--- pcmanfm-1.3.1.orig/src/app-config.c
+++ pcmanfm-1.3.1/src/app-config.c
@@ -527,6 +527,7 @@ static void fm_app_config_init(FmAppConf
cfg->autorun_choices = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, _free_archoice);