This commit is contained in:
11
Technical/Linux/Arch Linux.md
Executable file
11
Technical/Linux/Arch Linux.md
Executable file
@@ -0,0 +1,11 @@
|
||||
# Links:
|
||||
|
||||
- <https://www.geeksforgeeks.org/how-to-install-intellij-idea-on-arch-based-linux-distributionsmanjaro/>
|
||||
|
||||
|
||||
|
||||
``` shell
|
||||
|
||||
sudo fuser -k 8000/tcp
|
||||
|
||||
```
|
||||
35
Technical/Linux/GPG Encryption.md
Executable file
35
Technical/Linux/GPG Encryption.md
Executable file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
note type:
|
||||
- note
|
||||
date: 2026-06-03
|
||||
done: true
|
||||
---
|
||||
If you want to encrypt a file, use the following command:
|
||||
|
||||
``` bash
|
||||
|
||||
gpg -c file.txt
|
||||
|
||||
# options include :
|
||||
# gpg -c file.txt : for symmetric encryption
|
||||
# gpg -d file.txt.gpg : to decrypt the file
|
||||
# gpg --batch -c --passphrase mypassphrase file.txt : accepts passphrase right from command line
|
||||
|
||||
```
|
||||
|
||||
and to decrypt, use:
|
||||
|
||||
``` bash
|
||||
|
||||
gpg -d file.txt
|
||||
|
||||
# You have to wait 10 minutes before you can get prompted for a password, before this, it will
|
||||
# decrypt without the passphrase.
|
||||
|
||||
```
|
||||
|
||||
`gpg –batch -c –passphrase Shakkal123! passwords.md`
|
||||
|
||||
`gpg –batch -d –passphrase Shakkal123! passwords.md.gpg`
|
||||
|
||||
`gpg –batch –output passwords.md -d –passphrase Shakkal123! passwords.md.gpg`
|
||||
179
Technical/Linux/Keyboard.md
Executable file
179
Technical/Linux/Keyboard.md
Executable file
@@ -0,0 +1,179 @@
|
||||
# Keyboard inputs
|
||||
|
||||
This all comes from the fact that a "key press" isn't one thing — it's
|
||||
a stack of specs and translations from **keyboard hardware → USB/HID →
|
||||
Linux kernel → userspace (XKB/Wayland) → Hyprland binds**.
|
||||
|
||||
## 1\. Big picture: what happens when you press a key?
|
||||
|
||||
When you hit a key (like your "lock" key), roughly this happens:
|
||||
|
||||
``` text
|
||||
Physical switch on keyboard
|
||||
↓
|
||||
Keyboard firmware → USB HID "usage" (e.g. 0x07:0xE3 = Left GUI)
|
||||
↓
|
||||
Linux kernel input subsystem (evdev) → KEY_LEFTMETA (code 125)
|
||||
↓
|
||||
libinput / xkbcommon → keysyms (like Super_L, L, etc.)
|
||||
↓
|
||||
Hyprland → your `bind = SUPER, L, exec, ...`
|
||||
```
|
||||
|
||||
The "topic" we've been poking at is basically **understanding each layer
|
||||
in that stack**.
|
||||
|
||||
-----
|
||||
|
||||
## 2\. USB HID: where `700e3` comes from
|
||||
|
||||
Modern USB keyboards follow the **USB HID (Human Interface Device)
|
||||
specification**. This spec defines **Usage Tables**: numerical codes for
|
||||
things like keys, buttons, axes, etc.
|
||||
|
||||
- The keyboard page is **Usage Page 0x07 (Keyboard/Keypad)**.
|
||||
|
||||
- In your `evtest` output, `MSC_SCAN value 700e3` means:
|
||||
|
||||
- `0x07` (Keyboard page)
|
||||
- `0xE3` (Left GUI / "Windows/Super" key)
|
||||
|
||||
You can see the official tables here (PDF):
|
||||
|
||||
- **HID Usage Tables (includes Keyboard/Keypad page 0x07)**
|
||||
<https://usb.org/sites/default/files/hut1_21.pdf>
|
||||
([USB Implementers Forum](https://usb.org/sites/default/files/hut1_21.pdf?utm_source=chatgpt.com))
|
||||
|
||||
If you scroll to the **Keyboard/Keypad Page (0x07)** section, it lists all
|
||||
the key usages: A, B, C, modifiers, function keys, etc. There's also a
|
||||
standalone Keyboard/Keypad-page extract people mirror, like this PDF
|
||||
snippet:
|
||||
([d1.amobbs.com](https://d1.amobbs.com/bbs_upload782111/files_47/ourdev_692986N5FAHU.pdf?utm_source=chatgpt.com))
|
||||
|
||||
So:
|
||||
|
||||
- `700e3` = Page `0x07`, Usage `0xE3` → *Keyboard Left GUI*
|
||||
- `7000f` = Page `0x07`, Usage `0x0F` → *Keyboard L* key
|
||||
|
||||
That's how we knew your lock key was sending **Super + L**.
|
||||
|
||||
-----
|
||||
|
||||
## 3\. Linux input subsystem: `EV_MSC`, `EV_KEY`, `KEY_LEFTMETA`
|
||||
|
||||
Linux has a dedicated **input subsystem** in the kernel (`drivers/input`,
|
||||
`drivers/hid` etc.) that takes those HID usages and turns them into a
|
||||
unified stream of **input events**.
|
||||
([Linux Kernel Documentation](https://docs.kernel.org/input/input.html?utm_source=chatgpt.com))
|
||||
|
||||
Key ideas:
|
||||
|
||||
- Devices expose `/dev/input/eventX` nodes.
|
||||
|
||||
- Each event is a struct with:
|
||||
|
||||
- `type` (e.g. =EV<sub>KEY</sub>=, `EV_MSC`, `EV_REL`, `EV_SYN`)
|
||||
- `code` (e.g. =KEY<sub>L</sub>=, `KEY_LEFTMETA`)
|
||||
- `value` (pressed = 1, released = 0, repeat = 2)
|
||||
|
||||
Docs worth bookmarking:
|
||||
|
||||
- **Linux input subsystem overview**
|
||||
<https://docs.kernel.org/input/input.html>
|
||||
([Linux Kernel Documentation](https://docs.kernel.org/input/input.html?utm_source=chatgpt.com))
|
||||
|
||||
- **Input event types and codes (`event-codes.txt`)**
|
||||
<https://www.kernel.org/doc/Documentation/input/event-codes.txt>
|
||||
([Kernel.org](https://www.kernel.org/doc/Documentation/input/event-codes.txt?utm_source=chatgpt.com))
|
||||
|
||||
The **keycode definitions** (`KEY_L`, `KEY_LEFTMETA`, etc.) live in:
|
||||
|
||||
- `include/uapi/linux/input-event-codes.h` in the kernel source Example
|
||||
mirror:
|
||||
<https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/input-event-codes.h>
|
||||
([GitHub](https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/input-event-codes.h?utm_source=chatgpt.com))
|
||||
|
||||
When `evtest` prints:
|
||||
|
||||
``` text
|
||||
type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
|
||||
type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
|
||||
```
|
||||
|
||||
that means:
|
||||
|
||||
- `EV_MSC / MSC_SCAN` → "Here is the raw hardware scancode" (from USB
|
||||
HID).
|
||||
- `EV_KEY / KEY_LEFTMETA` → "Linux mapped that scancode to logical key
|
||||
LEFTMETA".
|
||||
|
||||
-----
|
||||
|
||||
## 4\. XKB / xkbcommon: mapping to actual characters & modifiers
|
||||
|
||||
Above the kernel, you've got an extra mapping layer that says:
|
||||
|
||||
> For keycode N, with this layout, when Shift is held, produce this
|
||||
> character/symbol.
|
||||
|
||||
On X11 this is handled by **XKB (X Keyboard Extension)**; on Wayland
|
||||
compositors (including Hyprland) the same ideas are implemented via
|
||||
**xkbcommon**.
|
||||
|
||||
Docs:
|
||||
|
||||
- **X Keyboard Extension (XKB) protocol spec**
|
||||
<https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html>
|
||||
([X.Org](https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html?utm_source=chatgpt.com))
|
||||
|
||||
- **Arch Wiki: X keyboard extension** (good high-level intro)
|
||||
<https://wiki.archlinux.org/title/X_keyboard_extension>
|
||||
([ArchWiki](https://wiki.archlinux.org/title/X_keyboard_extension?utm_source=chatgpt.com))
|
||||
|
||||
- A nice "practical" walkthrough of XKB concepts:
|
||||
[[https://medium.com/\[cite/t:@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450](https://medium.com/%5Bcite/t:@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450)](https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450)\]
|
||||
([Medium](https://medium.com/%40damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450?utm_source=chatgpt.com))
|
||||
|
||||
Hyprland, Sway, etc. all use libinput + xkbcommon under the hood to
|
||||
interpret those keycodes and translate them into keysyms and modifiers.
|
||||
|
||||
-----
|
||||
|
||||
## 5\. Hyprland / your config: where the bindings fit in
|
||||
|
||||
Hyprland sits at the top of this stack:
|
||||
|
||||
- It listens to the input events (via libinput).
|
||||
- It sees keysyms/modifiers (e.g. =Super=, `L`).
|
||||
- It matches them against your config:
|
||||
|
||||
<!-- end list -->
|
||||
|
||||
``` ini
|
||||
bind = SUPER, L, exec, hyprlock
|
||||
```
|
||||
|
||||
So your keyboard's "lock" key:
|
||||
|
||||
1. Firmware sends HID usages `0xE3` (Left GUI) and `0x0F` (L).
|
||||
2. Linux maps them to `KEY_LEFTMETA` (125) and `KEY_L` (38).
|
||||
3. xkbcommon maps that to `Super` + `L`.
|
||||
4. Hyprland says: "Ah, SUPER+L → run `hyprlock`".
|
||||
|
||||
The "topic" you stumbled into is just **peeling back each abstraction
|
||||
layer**.
|
||||
|
||||
-----
|
||||
|
||||
## 6\. Handy tools & libraries if you want to go deeper
|
||||
|
||||
- `evtest`, `libinput debug-events`, `showkey` → To watch what your
|
||||
keyboard is actually sending.
|
||||
|
||||
- **Python-evdev** – Python bindings to read `/dev/input/event*`
|
||||
yourself: <https://python-evdev.readthedocs.io/>
|
||||
([python-evdev.readthedocs.io](https://python-evdev.readthedocs.io/?utm_source=chatgpt.com))
|
||||
|
||||
- Linux input subsystem docs again:
|
||||
<https://docs.kernel.org/driver-api/input.html>
|
||||
([Linux Kernel Documentation](https://docs.kernel.org/driver-api/input.html?utm_source=chatgpt.com))
|
||||
12
Technical/Linux/Linux MOC.md
Executable file
12
Technical/Linux/Linux MOC.md
Executable file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
note type:
|
||||
- moc
|
||||
date: 2026-06-03
|
||||
done: true
|
||||
---
|
||||
- [[Wacom]]
|
||||
- [[Systemd Services]]
|
||||
- [[GPG Encryption]]
|
||||
- [[Arch Linux]]
|
||||
- [[i3 WM]]
|
||||
- [[Keyboard]]
|
||||
45
Technical/Linux/Systemd Services.md
Executable file
45
Technical/Linux/Systemd Services.md
Executable file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
note type:
|
||||
- note
|
||||
date: 2026-06-03
|
||||
done: true
|
||||
---
|
||||
# To add a systemctl
|
||||
|
||||
- create a new systemd service file:
|
||||
`sudo nano /etc/systemd/system/name.service`
|
||||
|
||||
- example content:
|
||||
`[Unit]`
|
||||
`Description=Watch TODO Directory and Update Master Task List`
|
||||
`After=network.target`
|
||||
|
||||
`[Service]`
|
||||
`ExecStart=/usr/local/bin/watch-todo.sh`
|
||||
`Restart=always`
|
||||
`User=zaine`
|
||||
`WorkingDirectory=/home/zaine/master-folder/org<sub>files</sub>/todo`
|
||||
`StandardOutput=append:/var/log/watch-todo.log`
|
||||
`StandardError=append:/var/log/watch-todo.log`
|
||||
|
||||
\[Install\]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
- reload and start:
|
||||
|
||||
`sudo systemctl daemon-reload`
|
||||
`sudo systemctl enable watch-todo.service`
|
||||
`sudo systemctl start watch-todo.service`
|
||||
|
||||
# To remove a systemctl service:
|
||||
|
||||
```
|
||||
systemctl stop \[servicename\]
|
||||
systemctl disable \[servicename\]
|
||||
rm *etc/systemd/system*\[servicename\]
|
||||
rm *etc/systemd/system*\[servicename\] \# and symlinks that might be related
|
||||
rm *usr/lib/systemd/system*\[servicename\]
|
||||
rm *usr/lib/systemd/system*\[servicename\] \# and symlinks that might be related
|
||||
systemctl daemon-reload
|
||||
systemctl reset-failed
|
||||
```
|
||||
58
Technical/Linux/Wacom.md
Executable file
58
Technical/Linux/Wacom.md
Executable file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
note type:
|
||||
- note
|
||||
date: 2026-06-03
|
||||
done: true
|
||||
---
|
||||
The command: `xsetwacom --list` gave me:
|
||||
|
||||
``` bash
|
||||
Wacom One by Wacom M Pen stylus id: 12 type: STYLUS
|
||||
Wacom One by Wacom M Pen eraser id: 13 type: ERASER
|
||||
```
|
||||
|
||||
Then, in order to map the stylus to a single monitor i needed to know my monitor mappings via `xrandr`:
|
||||
|
||||
``` bash
|
||||
|
||||
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
|
||||
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
|
||||
1920x1080 60.00*+ 143.85 119.98 59.94
|
||||
1680x1050 59.95
|
||||
1440x900 59.89
|
||||
1440x576 50.00
|
||||
1440x480 59.94
|
||||
1280x1024 75.02 60.02
|
||||
1280x960 60.00
|
||||
1280x720 60.00 59.94
|
||||
1152x864 75.00
|
||||
1024x768 75.03 70.07 60.00
|
||||
800x600 75.00 72.19 60.32 56.25
|
||||
720x480 59.94
|
||||
640x480 75.00 72.81 59.94 59.93
|
||||
DP-1 disconnected (normal left inverted right x axis y axis)
|
||||
HDMI-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 521mm x 293mm
|
||||
1920x1080 60.00*+ 59.94 50.00
|
||||
1680x1050 59.95
|
||||
1600x900 60.00
|
||||
1440x900 59.89
|
||||
1280x1024 60.02
|
||||
1280x800 59.81
|
||||
1280x720 60.00 59.94 50.00
|
||||
1024x768 70.07 60.00
|
||||
800x600 72.19 60.32 56.25
|
||||
720x576 50.00
|
||||
720x480 59.94
|
||||
640x480 72.81 59.94
|
||||
DP-2 disconnected (normal left inverted right x axis y axis)
|
||||
DP-3 disconnected (normal left inverted right x axis y axis)
|
||||
DP-4 disconnected (normal left inverted right x axis y axis)
|
||||
DP-5 disconnected (normal left inverted right x axis y axis)
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
Then I simply map it via:
|
||||
|
||||
`xsetwacom set "Wacom One by Wacom M Pen stylus" MapToOutput HEAD-0`
|
||||
10
Technical/Linux/i3 WM.md
Executable file
10
Technical/Linux/i3 WM.md
Executable file
@@ -0,0 +1,10 @@
|
||||
# Commands:
|
||||
|
||||
**Mod1 = Win Key**
|
||||
|
||||
`$mod+Enter = Open Terminal`
|
||||
`$mod+s = Stacked layout`
|
||||
`$mod+e = Default layout`
|
||||
`$mod+d = dmenu`
|
||||
|
||||
# Config file:
|
||||
Reference in New Issue
Block a user