Replace cursor_ask.sh with popup.sh launching popups from a Kando "popups" menu; cursor_follow.lua gains a popups table (sizes, follow until Enter, stay_focused) and pauses following while Kando is open. Add aichat config/role for the quick Claude popup and Kando menu/theme configs, with gen-colors syncing the Kando theme palette. Co-Authored-By: Claude Opus 5.5 <[email protected]>
318 lines
14 KiB
Markdown
318 lines
14 KiB
Markdown
# Linux Scripts and Configs
|
|
|
|
Dotfiles and scripts for Arch Linux (Manjaro), targeting Wayland (Hyprland / Sway) with an i3 fallback.
|
|
|
|
## IMPORTANT TODO
|
|
|
|
Inside `scripts/wofi/styles.css`, I have the colour css set to `/home/adamf/scripts/wofi/colors.css`, which is clearly ugly and not nice but it was quick to do.
|
|
|
|
Wofi is called in hypr/hyprland.lua and sway/swayconfig with the command `wofi --style /home/adamf/scripts/wofi/styles.css`. This is also not ideal but I couldn't find a way to get it to work with a relative path. I'm unsure when hyprland working directory is.
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
git clone --recurse-submodules <repo-url> ~/scripts
|
|
```
|
|
|
|
If already cloned without submodules:
|
|
|
|
```bash
|
|
git submodule update --init --recursive
|
|
```
|
|
|
|
Install all packages:
|
|
|
|
```bash
|
|
yay -S $(grep -v '^\s*$' ~/scripts/packages.txt | tr '\n' ' ')
|
|
```
|
|
|
|
## Install / Uninstall
|
|
|
|
`install.sh` symlinks configs, sources shell files, and backs up any existing files it would overwrite. `uninstall.sh` reverses the process, removing symlinks and restoring backups.
|
|
|
|
```bash
|
|
# Install everything (uses Hyprland as the WM)
|
|
~/scripts/install.sh all
|
|
|
|
# Install specific targets
|
|
~/scripts/install.sh hyprland shell nvim tmux
|
|
|
|
# Uninstall specific targets (restores from most recent backup)
|
|
~/scripts/uninstall.sh nvim shell
|
|
|
|
# Uninstall using a specific backup
|
|
~/scripts/uninstall.sh --backup ~/scripts/backups/20260319_120000 all
|
|
```
|
|
|
|
Available targets: `hyprland`, `sway`, `i3`, `cursor`, `shell`, `alacritty`, `tmux`, `nvim`, `vim`, `kde`, `all`.
|
|
|
|
`kde` is for KDE Plasma 6 (Steam Deck desktop mode) and is not part of `all`. See [KDE Plasma (Steam Deck)](#kde-plasma-steam-deck).
|
|
|
|
### tmux prerequisite
|
|
|
|
Install the plugin manager before running `install.sh tmux`:
|
|
|
|
```bash
|
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
|
```
|
|
|
|
### Manual linking
|
|
|
|
If you prefer to link configs manually instead of using `install.sh`:
|
|
|
|
<details>
|
|
<summary>Manual symlink commands</summary>
|
|
|
|
#### Hyprland
|
|
|
|
```bash
|
|
ln -sf ~/scripts/hypr ~/.config/hypr
|
|
ln -sf ~/scripts/waybar ~/.config/waybar
|
|
ln -sf ~/scripts/wofi ~/.config/wofi
|
|
mkdir -p ~/.config/kando
|
|
ln -sf ~/scripts/kando/menus.json ~/.config/kando/menus.json
|
|
ln -sf ~/scripts/kando/config.json ~/.config/kando/config.json
|
|
```
|
|
|
|
#### Sway
|
|
|
|
```bash
|
|
ln -sf ~/scripts/sway ~/.config/sway
|
|
ln -sf ~/scripts/waybar ~/.config/waybar
|
|
ln -sf ~/scripts/wofi ~/.config/wofi
|
|
```
|
|
|
|
The default waybar config (`waybar/config`) is set up for Hyprland. For Sway, rename the sway config as the active one:
|
|
|
|
```bash
|
|
mv ~/scripts/waybar/config ~/scripts/waybar/config.hypr.json
|
|
mv ~/scripts/waybar/waybar_sway_config.json ~/scripts/waybar/config
|
|
```
|
|
|
|
#### i3
|
|
|
|
```bash
|
|
ln -sf ~/scripts/i3 ~/.config/i3
|
|
ln -sf ~/scripts/i3blocks ~/.config/i3blocks
|
|
ln -sf ~/scripts/i3status ~/.config/i3status
|
|
```
|
|
|
|
#### Cursor
|
|
|
|
```bash
|
|
ln -sf ~/scripts/hatsune-miku-windows-linux-cursors/miku-cursor-linux ~/.local/share/icons/"Miku Cursor"
|
|
```
|
|
|
|
#### Shell
|
|
|
|
Add to `~/.bashrc` or `~/.zshrc`:
|
|
|
|
```bash
|
|
source ~/scripts/bashrc # or zshrc
|
|
export PATH="~/scripts/sh:$PATH"
|
|
```
|
|
|
|
#### Terminals
|
|
|
|
**Alacritty** - add to `~/.config/alacritty/alacritty.toml`:
|
|
|
|
```toml
|
|
import = ["~/scripts/alacritty.toml"]
|
|
```
|
|
|
|
**Kitty** - kitty.conf is used directly by the WM configs.
|
|
|
|
#### tmux
|
|
|
|
Add to `~/.tmux.conf`:
|
|
|
|
```
|
|
source ~/scripts/tmux.conf
|
|
```
|
|
|
|
#### Vim
|
|
|
|
Add to `~/.vimrc`:
|
|
|
|
```
|
|
source ~/scripts/vimrc
|
|
```
|
|
|
|
</details>
|
|
|
|
## Keybindings
|
|
|
|
All window managers and tmux use vim-style <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd> navigation. `$mod` is the Super key.
|
|
|
|
### Shared across WMs
|
|
|
|
| Key | Action |
|
|
| ------------------------ | ------------------------------------------ |
|
|
| `$mod + Return` | Terminal (kitty) |
|
|
| `$mod + Shift + q` | Kill window |
|
|
| `$mod + d` | Launcher (wofi / dmenu) |
|
|
| `$mod + h/j/k/l` | Focus left/down/up/right |
|
|
| `$mod + Shift + h/j/k/l` | Move window left/down/up/right |
|
|
| `$mod + g` / `$mod + v` | Split horizontal / vertical |
|
|
| `$mod + f` | Fullscreen |
|
|
| `$mod + Shift + Space` | Toggle floating |
|
|
| `$mod + 1-8` | Switch workspace |
|
|
| `$mod + Shift + 1-8` | Move window to workspace |
|
|
| `$mod + Ctrl + 1-8` | Move window silently |
|
|
| `$mod + -` | Scratchpad show |
|
|
| `$mod + Shift + -` | Move to scratchpad |
|
|
| `$mod + b` | Previous workspace |
|
|
| `$mod + 9` | Lock screen |
|
|
| `$mod + 0` | System menu (lock/suspend/reboot/shutdown) |
|
|
| `$mod + r` | Resize mode (hjkl) |
|
|
| `$mod + m` | Toggle bar |
|
|
| `$mod + Shift + c` | Reload config |
|
|
| `$mod + Ctrl + m` | PulseAudio control |
|
|
| `$mod + F2` | Browser (Waterfox) |
|
|
| `$mod + F3` | File manager (ranger) |
|
|
| `$mod + F5` | Music (mocp) |
|
|
| `Print` | Screenshot |
|
|
|
|
### Hyprland only
|
|
|
|
| Key | Action |
|
|
| ---------------------------- | ---------------------------------------------------------------- |
|
|
| `$mod + a` | Pie menu of popups, see [Popups](#popups-mod--a) |
|
|
| `$mod + z` | Pause the following window; press again over another window to make it follow instead, or over the paused one to resume it. With nothing following, the window under the cursor follows |
|
|
| `$mod + Shift + z` | Stop following |
|
|
| `$mod + Ctrl + z` | Toggle a bigger window centered above the cursor |
|
|
| `$mod + Alt + s` | Play / pause the video (playerctl) |
|
|
| `$mod + Alt + a / d` | Skip the video back / forward 10s |
|
|
| `$mod + Alt + Up / Down` | Widen / narrow the gap between the cursor and the window |
|
|
| `$mod + Alt + Right / Left` | Make the following window bigger / smaller |
|
|
| `$mod + Alt + z` | Show these cursor-follow keys in a notification |
|
|
|
|
Picture-in-Picture windows follow the cursor automatically (`hypr/cursor_follow.lua`).
|
|
|
|
### Popups (`$mod + a`)
|
|
|
|
`$mod + a` opens a [Kando](https://kando.menu) pie menu at the cursor. Keep `$mod` held, flick toward a slice and let go, or tap `$mod + a` and then click a slice or press its letter. Each slice runs `hypr/popup.sh <name>`:
|
|
|
|
| Slice (key) | What it opens |
|
|
| ---------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
| AI question (`a`) | aichat in kitty: short answers, follow-ups keep context; code requests get the library and functions |
|
|
| Ask about a screen region (`r`) | Drag a box (slurp + grim), type a question, then chat about the screenshot |
|
|
| Terminal (`t`) | kitty |
|
|
| Audio (`v`) | pavucontrol |
|
|
| Receipt printer (`p`) | The receipt_maker page as a Chromium app: `127.0.0.1:8765` if it is running, else the website |
|
|
| Sticky notes (`s`) | Shows / hides the xpad notes, which live in the scratchpad (also `$mod + -`) |
|
|
|
|
Keyboard popups (AI, terminal) follow the cursor and keep keyboard focus until Enter is pressed in them (or the pie menu is opened), then stay put so they can be scrolled with the mouse. The others are only placed beside the cursor. Sizes and which popups follow are the `popups` table at the top of `hypr/cursor_follow.lua`.
|
|
|
|
Setup:
|
|
|
|
- The AI popups need an Anthropic API key in `~/.config/aichat/.env` (never in this repo; `.env` is gitignored):
|
|
|
|
```bash
|
|
mkdir -p ~/.config/aichat && read -rs "k?API key: " && printf 'CLAUDE_API_KEY=%s\n' "$k" > ~/.config/aichat/.env && chmod 600 ~/.config/aichat/.env
|
|
```
|
|
|
|
- aichat's model and the short-answer instructions are `hypr/aichat/config.yaml` and `hypr/aichat/roles/quick.md`; `popup.sh` points aichat at them, so plain `aichat` elsewhere is unaffected.
|
|
- Kando's menu and theme are `kando/menus.json` and `kando/config.json`, linked into `~/.config/kando` by `install.sh hyprland`. Edits made in Kando's settings window are written straight back into the repo. Kando is started by `cursor_follow.lua` when Hyprland starts.
|
|
|
|
### System menu (`$mod + 0`)
|
|
|
|
| Key | Action |
|
|
| ---------------- | ------------ |
|
|
| `l` | Lock |
|
|
| `s` | Suspend |
|
|
| `h` | Hibernate |
|
|
| `r` | Reboot |
|
|
| `Shift + s` | Power off |
|
|
| `e` | Exit session |
|
|
| `Return` / `Esc` | Cancel |
|
|
|
|
### KDE Plasma (Steam Deck)
|
|
|
|
`install.sh kde` runs `kde/apply.sh`. It installs the [Krohnkite](https://github.com/anametologin/krohnkite) tiling script into `~/.local/share/kwin/scripts`, so it survives SteamOS updates, creates 8 virtual desktops, and sets the shortcuts live through kglobalaccel's D-Bus API (`kde/shortcuts.py`). KWin owns `kglobalshortcutsrc` while it's running, so editing that file by hand doesn't stick. To change a binding, edit the `BINDINGS` table in `kde/shortcuts.py` and press `$mod + Shift + c`. `uninstall.sh kde` (or `kde/apply.sh --reset`) puts every touched shortcut back to its KDE default.
|
|
|
|
Bindings match the shared table above, with these differences:
|
|
|
|
| Key | KDE behaviour |
|
|
| ---------------------------- | ------------------------------------------------------------ |
|
|
| `$mod + Return` / `d` | Konsole / KRunner |
|
|
| `$mod + F2` / `F3` | Firefox (flatpak) / Dolphin |
|
|
| `$mod + t` | Cycle Krohnkite layout: spiral (dwindle) → tile (master) → monocle |
|
|
| `$mod + w` | Monocle layout (instead of a tab group) |
|
|
| `$mod + e` / `v` | Rotate layout / rotate the focused part |
|
|
| `$mod + r` | Interactive resize; `$mod + Ctrl + h/j/k/l` resizes tiles |
|
|
| `$mod + Space` | Switch to the last window |
|
|
| `$mod + Shift + s` | Keep window on all desktops |
|
|
| `$mod + Shift + -` | Minimize (no scratchpad in KDE) |
|
|
| `$mod + 0` / `Shift + e` | Plasma logout/shutdown screen |
|
|
| `$mod + Ctrl + x` | Kill window (xkill) |
|
|
| `$mod + Shift + w` | KDE Overview |
|
|
| `Print` / `$mod + Print` / `$mod + Shift + Print` | Spectacle region → GUI / clipboard / `~/screenshot.png` |
|
|
|
|
Not mapped: `$mod + b` (KWin has no "last desktop" action), `$mod + m` (bar toggle), `$mod + g`, `$mod + c`, `$mod + F5`.
|
|
|
|
### tmux
|
|
|
|
Prefix is <kbd>Ctrl</kbd> + <kbd>f</kbd>.
|
|
|
|
| Key | Action |
|
|
| ------------------------- | --------------------------- |
|
|
| `Prefix + g` | Split horizontal |
|
|
| `Prefix + v` | Split vertical |
|
|
| `Prefix + h/j/k/l` | Select pane |
|
|
| `Prefix + J/K` | Swap pane down/up |
|
|
| `Prefix + Ctrl + H/J/K/L` | Resize pane |
|
|
| `Prefix + 1-0` | Select window 1-10 |
|
|
| `Alt + 1-0` | Create window 1-10 |
|
|
| `Prefix + !/@ etc.` | Move pane to window 1-10 |
|
|
| `Prefix + w` | Choose window |
|
|
| `Prefix + q` | Kill pane |
|
|
| `Prefix + [` / `]` | Copy mode / Paste |
|
|
| `Prefix + r` | Refresh |
|
|
| `Prefix + R` | Reload config |
|
|
| `Prefix + Space` | Send prefix (nested tmux) |
|
|
| `Prefix + ?` | List keys |
|
|
| `Prefix + Ctrl + s` | Save session (resurrect) |
|
|
| `Prefix + Ctrl + r` | Restore session (resurrect) |
|
|
|
|
## Colorscheme
|
|
|
|
All colors are defined in a single file: `colors.conf`. A generator script produces format-specific fragments that each config sources or imports.
|
|
|
|
To change the theme:
|
|
|
|
```bash
|
|
# 1. Edit the palette
|
|
vim ~/scripts/colors.conf
|
|
|
|
# 2. Regenerate fragments
|
|
~/scripts/sh/gen-colors
|
|
|
|
# 3. Reload your WM / bar
|
|
hyprctl reload # Hyprland
|
|
swaymsg reload # Sway
|
|
killall waybar && waybar & # Waybar
|
|
```
|
|
|
|
Generated files (gitignored; `install.sh` runs `gen-colors` before building):
|
|
|
|
| File | Format | Used by |
|
|
| ------------------- | ---------------------------- | ---------------------------- |
|
|
| `hypr/colors.lua` | `color_name = "rgb(HEXVAL)"` | `hyprland.lua` (built in) |
|
|
| `sway/colors.conf` | `set $color_name #HEXVAL` | `swayconfig` (include) |
|
|
| `i3/colors.conf` | `set $color_name #HEXVAL` | `i3config` (include) |
|
|
| `waybar/colors.css` | CSS custom properties | `waybar/style.css` (@import) |
|
|
| `wofi/colors.css` | CSS custom properties | `wofi/style.css` (@import) |
|
|
| `kando/config.json` | `menuThemeColors.purity` | Kando's Purity theme (tracked; only that key is rewritten, and Kando reloads it live) |
|
|
|
|
## Scripts
|
|
|
|
All in `sh/`, added to `$PATH` via the shell config above.
|
|
|
|
| Script | Description |
|
|
| ------------------ | --------------------------------------------- |
|
|
| `sharefile <file>` | Upload a file to 0x0.st |
|
|
| `getfile <id>` | Download a file from 0x0.st |
|
|
| `waybar-history` | Stream the last zsh history entry to waybar |
|
|
| `gen-colors` | Regenerate color fragments from `colors.conf` |
|