Skip to content

Instantly share code, notes, and snippets.

View Scott-Nx's full-sized avatar
💭
I may be slow to respond.

Scott Scott-Nx

💭
I may be slow to respond.
View GitHub Profile
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.smoothScrolling": true,
"editor.cursorSmoothCaretAnimation": "on",
"editor.formatOnType": true,
"diffEditor.experimental.showMoves": true,
"files.autoGuessEncoding": true,
"files.insertFinalNewline": true,
"workbench.list.smoothScrolling": true,
@Scott-Nx
Scott-Nx / 99-force-noto.conf
Created July 10, 2025 13:29
High-priority Fontconfig rules to remap generic families (serif, sans-serif, monospace, sans) to Google’s Noto fonts.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Force all “serif” to Noto Serif -->
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="assign" binding="strong">
@Scott-Nx
Scott-Nx / dolphin_kitty.md
Created April 19, 2025 17:05
Approach to get Dolphin to use Kitty instead of Konsole.

Summary

Dolphin’s “Open Terminal” functionality is driven by the global KDE setting (F4 embedded terminal and Ctrl+Alt+T shortcut), which is read from your ~/.config/kdeglobals


Manually Editing kdeglobals

  1. Open (or create) ~/.config/kdeglobals in your favorite editor.
  2. Append:

[General]

@Scott-Nx
Scott-Nx / ssh-add.md
Last active April 19, 2025 13:11
Fully automatic ssh-agent & add all ssh key in Hyprland on Arch Linux

Auto-start ssh-agent in Hyprland on Arch Linux:

1. Remember password in ksshaskpass

following Arch Linux Wiki and manually ssh-add for first time by select remember password

2. Add ssh-add-all scripts to /usr/bin

  1. Copy ssh-add-all to /usr/bin/ssh-add-all
  2. chmod +x /usr/bin/ssh-add-all
@Scott-Nx
Scott-Nx / KWallet-pam-ly-hyprland.md
Created April 17, 2025 14:38
Step‑by‑step guide to have your KDE Wallet (KWallet) automatically unlock when you log in via **ly** and then start **Hyprland**

Below is a step‑by‑step guide to have your KDE Wallet (KWallet) automatically unlock when you log in via ly and then start Hyprland. In short, you’ll:

  1. Install the PAM module (kwallet-pam) and ensure your wallet password matches your user password
  2. Hook PAM in ly’s login routine so it hands off your login password to KWallet
  3. Autostart the helper (pam_kwallet_init) in your Hyprland config so that the wallet actually opens

With these in place, applications like Dolphin or Brave should stop nagging you for the wallet password after you’ve already logged in.

1. Install the necessary packages

Make sure you have the core KWallet components and the PAM integration module:

@Scott-Nx
Scott-Nx / ssh-add-all
Created April 11, 2025 14:43
A shell script that find all private SSH keys and add them to SSH agent
#!/bin/bash
# Check if ssh-agent is running
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
echo "ssh-agent is not running. Exiting."
exit 1
fi
# Find all files in ~/.ssh/ that are private keys (not .pub and not known_hosts)
# Then add them to the SSH agent
#!/bin/bash
SERVICE="avahi-daemon.service"
start_service() {
systemctl start $SERVICE
echo "$SERVICE started."
notify-send "Service Notification" "$SERVICE started."
}
@Scott-Nx
Scott-Nx / Intel-Undervolt-Check-Modify.md
Last active April 18, 2025 16:44
Only run `intel-undervolt apply` if CPU model is **Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz**

intel-undervolt apply will only runs if the CPU model is Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz. If it's a different CPU, the script will disable undervolting (intel-undervolt revert).


1️⃣ Edit the CPU Check Script

Run:

sudo nano /usr/local/bin/intel-undervolt-cpu-check

Replace the contents with:

@Scott-Nx
Scott-Nx / Intel-Undervolt-CPU-Check.md
Last active April 18, 2025 16:46
Prevent Intel-Undervolt Running at Boot after CPU change

If you want Intel-undervolt to disable automatically when the CPU changes (e.g., after a BIOS update, new CPU, or different CPU model detected), you can create a script that checks the CPU model at boot and disables undervolting if it's different from the expected model.


1️⃣ Create a CPU Detection Script

Run:

sudo nano /usr/local/bin/intel-undervolt-cpu-check

Paste:

@Scott-Nx
Scott-Nx / xiaomi_poco_m5_response.csv
Created October 20, 2024 15:36
Xiaomi POCO M5 Speaker Frequency Response
Frequency (Hz) Amplitude (dB)
27.258 -30.004
44.348 -30.222
65.574 -30.193
91.616 -27.14
123.122 -18.345
160.746 -10.222
205.164 -4.423
257.068 -1.905
317.168 -4.285