feat: initial commit

This commit is contained in:
johannes committed 2026-07-26 11:42:17 +02:00
commit b802ff49ab
454 files changed
+52429

No files matched your search

+218
View File
@@ -0,0 +1,218 @@
# Place a copy of this config to ~/.aerospace.toml
# After that, you can edit ~/.aerospace.toml to your liking
# You can use it to add commands that run after login to macOS user session.
# 'start-at-login' needs to be 'true' for 'after-login-command' to work
# Available commands: https://nikitabobko.github.io/AeroSpace/commands
after-login-command = []
# You can use it to add commands that run after AeroSpace startup.
# 'after-startup-command' is run after 'after-login-command'
# Available commands : https://nikitabobko.github.io/AeroSpace/commands
after-startup-command = [
'exec-and-forget borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=5.0'
]
# Start AeroSpace at login
start-at-login = false
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
# The 'accordion-padding' specifies the size of accordion padding
# You can set 0 to disable the padding feature
accordion-padding = 30
# Possible values: tiles|accordion
default-root-container-layout = 'tiles'
# Possible values: horizontal|vertical|auto
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
# tall monitor (anything higher than wide) gets vertical orientation
default-root-container-orientation = 'auto'
# Mouse follows focus when focused monitor changes
# Drop it from your config, if you don't like this behavior
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
# Fallback value (if you omit the key): on-focused-monitor-changed = []
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
# Also see: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = false
# Possible values: (qwerty|dvorak|colemak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'
# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant: gaps.outer.top = 8
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
# In this example, 24 is a default value when there is no match.
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
# See:
# https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
[gaps]
inner.horizontal = 5
inner.vertical = 5
outer.left = 10
outer.bottom = 10
outer.top = 10
outer.right = 10
# 'main' binding mode declaration
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
# 'main' binding mode must be always presented
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon,
# backtick, leftSquareBracket, rightSquareBracket, space, enter, esc,
# backspace, tab, pageUp, pageDown, home, end, forwardDelete,
# sectionSign (ISO keyboards only, european keyboards only)
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right
# All possible modifiers: cmd, alt, ctrl, shift
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# You can uncomment the following lines to open up terminal with alt + enter shortcut
# (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-t = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
cmd-h = 'focus --boundaries-action wrap-around-the-workspace left'
cmd-j = 'focus --boundaries-action wrap-around-the-workspace down'
cmd-k = 'focus --boundaries-action wrap-around-the-workspace up'
cmd-l = 'focus --boundaries-action wrap-around-the-workspace right'
# See: https://nikitabobko.github.io/AeroSpace/commands#move
cmd-shift-h = 'move left'
cmd-shift-j = 'move down'
cmd-shift-k = 'move up'
cmd-shift-l = 'move right'
cmd-q = 'close'
alt-f = 'fullscreen'
alt-s = 'layout v_accordion' # 'layout stacking' in i3
alt-w = 'layout h_accordion' # 'layout tabbed' in i3
alt-e = 'layout tiles horizontal vertical' # 'layout toggle split' in i3
alt-r = 'mode resize'
alt-i = 'mode macos'
alt-h = 'mode service'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
cmd-1 = 'workspace 1'
cmd-2 = 'workspace 2'
cmd-3 = 'workspace 3'
cmd-4 = 'workspace 4'
cmd-5 = 'workspace 5'
cmd-6 = 'workspace 6'
cmd-7 = 'workspace 7'
cmd-8 = 'workspace 8'
cmd-9 = 'workspace 9'
cmd-0 = 'workspace 10'
cmd-shift-1 = 'move-node-to-workspace 1'
cmd-shift-2 = 'move-node-to-workspace 2'
cmd-shift-3 = 'move-node-to-workspace 3'
cmd-shift-4 = 'move-node-to-workspace 4'
cmd-shift-5 = 'move-node-to-workspace 5'
cmd-shift-6 = 'move-node-to-workspace 6'
cmd-shift-7 = 'move-node-to-workspace 7'
cmd-shift-8 = 'move-node-to-workspace 8'
cmd-shift-9 = 'move-node-to-workspace 9'
cmd-shift-0 = 'move-node-to-workspace 10'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
cmd-tab = 'workspace-back-and-forth'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
cmd-shift-tab = 'move-workspace-to-monitor --wrap-around next'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
cmd-shift-semicolon = 'mode service'
# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
#s = ['layout sticky tiling', 'mode main']
cmd-shift-h = ['join-with left', 'mode main']
cmd-shift-j = ['join-with down', 'mode main']
cmd-shift-k = ['join-with up', 'mode main']
cmd-shift-l = ['join-with right', 'mode main']
down = 'volume down'
up = 'volume up'
shift-down = ['volume set 0', 'mode main']
[mode.resize.binding]
h = 'resize width -50'
j = 'resize height +50'
k = 'resize height -50'
l = 'resize width +50'
enter = 'mode main'
esc = 'mode main'
[mode.macos.binding]
esc = 'mode main'
[workspace-to-monitor-force-assignment]
1 = 1
2 = 1
3 = 1
4 = 2
5 = 2
6 = 2
7 = 2
8 = 3
9 = 3
10 = 3
#[[on-window-detected]]
# if.app-id="com.mitchellh.ghostty"
# run= [
# "layout tiling",
# ]
[[on-window-detected]]
if.app-id="com.tinyapp.TablePlus-setapp"
run= [
"layout floating",
]
+272
View File
@@ -0,0 +1,272 @@
#? Config file for btop v.1.4.6
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "/home/johannes/.config/btop/themes/catppuccin.theme"
#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = false
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = true
#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = false
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
#* Use whitespace " " as separator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = true
#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = true
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
terminal_sync = true
#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"
# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty".
graph_symbol_gpu = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"
#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
shown_boxes = "cpu net proc mem"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 1000
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "cpu lazy"
#* Reverse sorting order, True or False.
proc_reversed = false
#* Show processes as a tree.
proc_tree = false
#* Use the cpu graph colors in the process list.
proc_colors = true
#* Use a darkening gradient in the process list.
proc_gradient = true
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = false
#* Show process memory as bytes instead of percent.
proc_mem_bytes = true
#* Show cpu graph for each process.
proc_cpu_graphs = true
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = false
#* Show proc box on left side of screen instead of right.
proc_left = false
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = false
#* In tree-view, always accumulate child process resources in the parent process.
proc_aggregate = false
#* Should cpu and memory usage display be preserved for dead processes when paused.
keep_dead_proc_usage = false
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"
#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"
#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off".
show_gpu_info = "Auto"
#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = true
#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = false
#* Show cpu box at bottom of screen instead of top.
cpu_bottom = false
#* Shows the system uptime in the CPU box.
show_uptime = true
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
show_cpu_watts = true
#* Show cpu temperature.
check_temp = true
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = true
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""
#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = false
#* Show CPU frequency.
show_cpu_freq = true
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
freq_mode = "first"
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = true
#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user"
disks_filter = ""
#* Show graphs instead of meters for memory values.
mem_graphs = true
#* Show mem box below net box instead of above.
mem_below_net = false
#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = true
#* If swap memory should be shown in memory box.
show_swap = true
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = true
#* If mem box should be split to also show disks info.
show_disks = true
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = true
#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = true
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = false
#* Set to true to show available disk space for privileged users.
disk_free_priv = false
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = true
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = false
#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = false
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""
#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100
net_upload = 100
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = true
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = true
#* Starts with the Network Interface specified here.
net_iface = ""
#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes.
base_10_bitrate = "Auto"
#* Show battery stats in top right if battery is present.
show_battery = true
#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"
#* Show power stats of battery next to charge indicator.
show_battery_watts = true
#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING"
#* Automatically save current settings to config file on exit.
save_config_on_exit = true
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
nvml_measure_pcie_speeds = true
#* Measure PCIe throughput on AMD cards, may impact performance on certain cards.
rsmi_measure_pcie_speeds = true
#* Horizontally mirror the GPU graph.
gpu_mirror_graph = true
#* Set which GPU vendors to show. Available values are "nvidia amd intel"
shown_gpus = "nvidia amd intel"
#* Custom gpu0 model name, empty string to disable.
custom_gpu_name0 = ""
#* Custom gpu1 model name, empty string to disable.
custom_gpu_name1 = ""
#* Custom gpu2 model name, empty string to disable.
custom_gpu_name2 = ""
#* Custom gpu3 model name, empty string to disable.
custom_gpu_name3 = ""
#* Custom gpu4 model name, empty string to disable.
custom_gpu_name4 = ""
#* Custom gpu5 model name, empty string to disable.
custom_gpu_name5 = ""
+83
View File
@@ -0,0 +1,83 @@
# Main background, empty for terminal default, need to be empty if you want transparent background
theme[main_bg]="#eff1f5"
# Main text color
theme[main_fg]="#4c4f69"
# Title color for boxes
theme[title]="#4c4f69"
# Highlight color for keyboard shortcuts
theme[hi_fg]="#1e66f5"
# Background color of selected item in processes box
theme[selected_bg]="#bcc0cc"
# Foreground color of selected item in processes box
theme[selected_fg]="#1e66f5"
# Color of inactive/disabled text
theme[inactive_fg]="#8c8fa1"
# Color of text appearing on top of graphs, i.e uptime and current network graph scaling
theme[graph_text]="#dc8a78"
# Background color of the percentage meters
theme[meter_bg]="#bcc0cc"
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
theme[proc_misc]="#dc8a78"
# CPU, Memory, Network, Proc box outline colors
theme[cpu_box]="#8839ef" #Mauve
theme[mem_box]="#40a02b" #Green
theme[net_box]="#e64553" #Maroon
theme[proc_box]="#1e66f5" #Blue
# Box divider line and small boxes line color
theme[div_line]="#9ca0b0"
# Temperature graph color (Green -> Yellow -> Red)
theme[temp_start]="#40a02b"
theme[temp_mid]="#df8e1d"
theme[temp_end]="#d20f39"
# CPU graph colors (Teal -> Lavender)
theme[cpu_start]="#179299"
theme[cpu_mid]="#209fb5"
theme[cpu_end]="#7287fd"
# Mem/Disk free meter (Mauve -> Lavender -> Blue)
theme[free_start]="#8839ef"
theme[free_mid]="#7287fd"
theme[free_end]="#1e66f5"
# Mem/Disk cached meter (Sapphire -> Lavender)
theme[cached_start]="#209fb5"
theme[cached_mid]="#1e66f5"
theme[cached_end]="#7287fd"
# Mem/Disk available meter (Peach -> Red)
theme[available_start]="#fe640b"
theme[available_mid]="#e64553"
theme[available_end]="#d20f39"
# Mem/Disk used meter (Green -> Sky)
theme[used_start]="#40a02b"
theme[used_mid]="#179299"
theme[used_end]="#04a5e5"
# Download graph colors (Peach -> Red)
theme[download_start]="#fe640b"
theme[download_mid]="#e64553"
theme[download_end]="#d20f39"
# Upload graph colors (Green -> Sky)
theme[upload_start]="#40a02b"
theme[upload_mid]="#179299"
theme[upload_end]="#04a5e5"
# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve)
theme[process_start]="#209fb5"
theme[process_mid]="#7287fd"
theme[process_end]="#8839ef"
+83
View File
@@ -0,0 +1,83 @@
# Main background, empty for terminal default, need to be empty if you want transparent background
theme[main_bg]="#1e1e2e"
# Main text color
theme[main_fg]="#cdd6f4"
# Title color for boxes
theme[title]="#cdd6f4"
# Highlight color for keyboard shortcuts
theme[hi_fg]="#89b4fa"
# Background color of selected item in processes box
theme[selected_bg]="#45475a"
# Foreground color of selected item in processes box
theme[selected_fg]="#89b4fa"
# Color of inactive/disabled text
theme[inactive_fg]="#7f849c"
# Color of text appearing on top of graphs, i.e uptime and current network graph scaling
theme[graph_text]="#f5e0dc"
# Background color of the percentage meters
theme[meter_bg]="#45475a"
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
theme[proc_misc]="#f5e0dc"
# CPU, Memory, Network, Proc box outline colors
theme[cpu_box]="#cba6f7" #Mauve
theme[mem_box]="#a6e3a1" #Green
theme[net_box]="#eba0ac" #Maroon
theme[proc_box]="#89b4fa" #Blue
# Box divider line and small boxes line color
theme[div_line]="#6c7086"
# Temperature graph color (Green -> Yellow -> Red)
theme[temp_start]="#a6e3a1"
theme[temp_mid]="#f9e2af"
theme[temp_end]="#f38ba8"
# CPU graph colors (Teal -> Lavender)
theme[cpu_start]="#94e2d5"
theme[cpu_mid]="#74c7ec"
theme[cpu_end]="#b4befe"
# Mem/Disk free meter (Mauve -> Lavender -> Blue)
theme[free_start]="#cba6f7"
theme[free_mid]="#b4befe"
theme[free_end]="#89b4fa"
# Mem/Disk cached meter (Sapphire -> Lavender)
theme[cached_start]="#74c7ec"
theme[cached_mid]="#89b4fa"
theme[cached_end]="#b4befe"
# Mem/Disk available meter (Peach -> Red)
theme[available_start]="#fab387"
theme[available_mid]="#eba0ac"
theme[available_end]="#f38ba8"
# Mem/Disk used meter (Green -> Sky)
theme[used_start]="#a6e3a1"
theme[used_mid]="#94e2d5"
theme[used_end]="#89dceb"
# Download graph colors (Peach -> Red)
theme[download_start]="#fab387"
theme[download_mid]="#eba0ac"
theme[download_end]="#f38ba8"
# Upload graph colors (Green -> Sky)
theme[upload_start]="#a6e3a1"
theme[upload_mid]="#94e2d5"
theme[upload_end]="#89dceb"
# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve)
theme[process_start]="#74c7ec"
theme[process_mid]="#b4befe"
theme[process_end]="#cba6f7"
+8
View File
@@ -0,0 +1,8 @@
# Journal
@Cursor Rules Auto Document Session (Work/Private)
@Git
@Past Chats
Create today’s structured development log and save to Anytype (Work or Private).
+17
View File
@@ -0,0 +1,17 @@
---
description: Auto-document session to Anytype (asks Work/Private) and saves to today's daily page
alwaysApply: false
---
# Auto Document Session (Work/Private)
- Ask me which Anytype space: **Work Journal** or **Private Journal**.
- Use **@Git** to gather staged diffs/commit messages and **@Past Chats** for today’s key exchanges.
- Summarize as Markdown sections:
1) Date & Context
2) Git Changes
3) Cursor Interaction Summary
4) Completed Work
5) Pending Work / Next Steps
- Using the Anytype MCP, **create or append** to the daily page titled `YYYY-MM-DD` in the chosen space. If missing, create it; then append the entry (separate entries with `---`).
+54
View File
@@ -0,0 +1,54 @@
---
alwaysApply: false
---
You write commit messages by reading the staged diff, current branch name, and recent history.
## Detect style
1. Look at the last 30 commit subjects.
- If ≥70% match Conventional Commits (`^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w\-./]+\))?: `) → use **Conventional**.
2. Else, if the branch name matches a project/issue pattern, use **ProjectIssue**:
- Accept: `project-issue-branch`, `project/issue-branch`, `PROJECT-123/feature-x`, `proj-123-scope-x`.
- Extract `project` = leading letters/dashes, `issue` = number block (e.g., `123` or `PROJ-123`).
## Message rules (both styles)
- Subject: imperative mood, ≤ 50 chars, no period.
- Scope: infer from top-level changed path (e.g., `api`, `ui`, `build`, `docs`).
- Body: explain **why** and **what**, wrap at 72 cols; list key changes as bullets.
- Footer: include references (`Refs: #<issue>`), co-authors, and `BREAKING CHANGE:` when applicable.
## Types
feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
## Formats
- **Conventional**
`<type>(<scope>): <subject>`
[blank line]
`<body>`
[blank line if footers]
`Refs: <ticket or link>`
`BREAKING CHANGE: <details>`
- **ProjectIssue**
`<project>-<issue>: #time <used time> - <body>`
## Issue/branch parsing
Examples → extracted
- `checkout-321-add-paypal` → `checkout-321`
- `PAY-1042/refactor-provider` → `PAY-1042`
- `proj-77-auth-cleanup` → `proj-77`
- `feature/PAY-88-retry` → `PAY-88`
## Output
- Propose **3 options** following the chosen style.
- Each option = subject + body (+ footers if relevant).
- If multiple scopes changed, pick dominant one by lines changed; otherwise omit scope.
- If history is mixed, prefer **Conventional** unless branch clearly encodes issue.
## Examples
- Conventional:
`feat(api): add refund endpoint`
Body: explain why/what, bullets, breaking change if needed
- ProjectIssue:
`PAY-1042: #time 0h - normalize provider errors`
+10
View File
@@ -0,0 +1,10 @@
---
alwaysApply: false
---
# Error Handling Rules
- Always return errors instead of panicking (except in `main` or tests).
- Wrap errors with `%w` when using `fmt.Errorf` for context.
- Do not ignore errors; handle or log them explicitly.
- Use sentinel errors or `errors.Is` / `errors.As` for checking.
+26
View File
@@ -0,0 +1,26 @@
---
alwaysApply: false
---
# Go Code Style Rules
- Always run `gofmt` or `goimports` before committing.
- Follow Go naming conventions:
- Exported identifiers: PascalCase.
- Unexported identifiers: camelCase.
- Keep line length <= 100 characters.
- Group standard library imports first, then third-party, then local modules.
- Avoid unnecessary abbreviations in variable names.
- Use `error` as the last return value in functions.
- Prefer `context.Context` as the first argument in long-lived or external-facing funcs.
# Go Code Style Rules
- Always run `gofmt` or `goimports` before committing.
- Follow Go naming conventions:
- Exported identifiers: PascalCase.
- Unexported identifiers: camelCase.
- Keep line length <= 100 characters.
- Group standard library imports first, then third-party, then local modules.
- Avoid unnecessary abbreviations in variable names.
- Use `error` as the last return value in functions.
- Prefer `context.Context` as the first argument in long-lived or external-facing funcs.
+12
View File
@@ -0,0 +1,12 @@
---
alwaysApply: false
---
# Testing Rules
- Write tests for all exported functions.
- Use `*_test.go` files with `testing` package.
- Test names must describe the behavior: `TestFunctionName_Scenario`.
- Use table-driven tests for multiple cases.
- Ensure test coverage > 80%.
- Use `t.Helper()` in test helpers.
- Benchmarks must be named `BenchmarkFunctionName`.
+8
View File
@@ -0,0 +1,8 @@
---
alwaysApply: false
---
# Documentation
- Update README on env vars, setup, and run commands.
- Public services/classes need PHPDoc when intent isn’t obvious.
- Changelog follows Keep a Changelog; SemVer for releases.
+10
View File
@@ -0,0 +1,10 @@
---
alwaysApply: false
---
# Errors & Exceptions
- Never suppress errors with @.
- Throw domain-specific exceptions; do not return error strings.
- Catch only what you can handle; rethrow with previous exception.
- Use Value Objects for validation; avoid silent defaults.
- Log unexpected exceptions once at the edge (middleware/handler).
+10
View File
@@ -0,0 +1,10 @@
---
alwaysApply: false
---
# Security
- Never commit secrets; load via env (vlucas/phpdotenv or server env).
- Escape output (HTML/JS) and use parameterized queries everywhere.
- Validate and sanitize all input; centralize validation.
- Use password_hash()/password_verify(); never custom crypto.
- Enable SameSite, HttpOnly, Secure cookies; rotate session IDs on login.
+10
View File
@@ -0,0 +1,10 @@
---
alwaysApply: false
---
# Security
- Never commit secrets; load via env (vlucas/phpdotenv or server env).
- Escape output (HTML/JS) and use parameterized queries everywhere.
- Validate and sanitize all input; centralize validation.
- Use password_hash()/password_verify(); never custom crypto.
- Enable SameSite, HttpOnly, Secure cookies; rotate session IDs on login.
+12
View File
@@ -0,0 +1,12 @@
---
alwaysApply: false
---
# PHP Code Style
- Follow PSR-12 strictly; run php-cs-fixer or PHP_CodeSniffer on commit.
- Enable strict_types=1 in all files.
- Use typed properties/params/returns; avoid mixed unless documented.
- One class per file; namespaces match directory structure.
- Limit line length to 120; prefer early returns to reduce nesting.
- Prefer short array syntax []; no Yoda conditions.
- Use null coalesce (??) and nullsafe (?->) where appropriate.
+10
View File
@@ -0,0 +1,10 @@
---
alwaysApply: false
---
# Testing
- Use PHPUnit or Pest; tests live in tests/.
- Aim ≥ 85% coverage for domain/services; integration tests for I/O.
- Test names: testMethod_Scenario_ExpectedResult.
- Use data providers/table tests for variants.
- Mock only external boundaries (HTTP/DB/FS); avoid over-mocking.
+128
View File
@@ -0,0 +1,128 @@
/*
HyDE provides xdg/share/fastfetch/presets/hyde/*.config.jsonc files for different layouts.
You can also create your own config.jsonc file in the same directory to create a custom theme.
To test HyDE's fastfetch theme, run:
fastfetch --config hyde/*.jsonc
*/
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": "./logo/*",
"height": 18
},
"display": {
"separator": " : "
},
"modules": [
{
"type": "command",
"key": " ",
"keyColor": "blue",
"text": "splash=$(hyprctl splash);echo $splash"
},
{
"type": "custom",
"format": "┌──────────────────────────────────────────┐"
},
{
"type": "chassis",
"key": " 󰇺 Chassis",
"format": "{1} {2} {3}"
},
{
"type": "os",
"key": " 󰣇 OS",
"format": "{2}",
"keyColor": "red"
},
{
"type": "kernel",
"key": "  Kernel",
"format": "{2}",
"keyColor": "red"
},
{
"type": "packages",
"key": " 󰏗 Packages",
"keyColor": "green"
},
{
"type": "display",
"key": " 󰍹 Display",
"format": "{1}x{2} @ {3}Hz [{7}]",
"keyColor": "green"
},
{
"type": "terminal",
"key": "  Terminal",
"keyColor": "yellow"
},
{
"type": "wm",
"key": " 󱗃 WM",
"format": "{2}",
"keyColor": "yellow"
},
{
"type": "custom",
"format": "└──────────────────────────────────────────┘"
},
"break",
{
"type": "title",
"key": " ",
"format": "{6} {7} {8}"
},
{
"type": "custom",
"format": "┌──────────────────────────────────────────┐"
},
{
"type": "cpu",
"format": "{1} @ {7}",
"key": "  CPU",
"keyColor": "blue"
},
{
"type": "gpu",
"format": "{1} {2}",
"key": " 󰊴 GPU",
"keyColor": "blue"
},
{
"type": "gpu",
"format": "{3}",
"key": "  GPU Driver",
"keyColor": "magenta"
},
{
"type": "memory",
"key": "  Memory ",
"keyColor": "magenta"
},
{
"type": "disk",
"key": " 󱦟 OS Age ",
"folders": "/",
"keyColor": "red",
"format": "{days} days"
},
{
"type": "uptime",
"key": " 󱫐 Uptime ",
"keyColor": "red"
},
{
"type": "custom",
"format": "└──────────────────────────────────────────┘"
},
{
"type": "colors",
"paddingLeft": 2,
"symbol": "circle"
},
"break"
]
}
+61
View File
@@ -0,0 +1,61 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"separator": "• "
},
"modules": [
"break",
{
"type": "title",
},
{
"type": "custom",
"format": "╭───────────────────────────────╮"
},
{
"type": "os",
"key": "  ",
"format": "{2}"
},
{
"type": "host",
"key": "  ",
},
{
"type": "kernel",
"key": "  "
},
{
"type": "wm",
"key": "  "
},
{
"type": "shell",
"key": " $ "
},
{
"type": "terminal",
"key": "  "
},
{
"type": "uptime",
"key": " 󰔚 "
},
{
"type": "memory",
"key": " 󰍛 "
},
{
"type": "packages",
"key": "  "
},
{
"type": "custom",
"format": "╰───────────────────────────────╯"
},
{
"type": "custom",
"format": " \u001b[90m── \u001b[31m── \u001b[32m── \u001b[33m── \u001b[34m── \u001b[35m── \u001b[36m── \u001b[37m── "
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

+9
View File
@@ -0,0 +1,9 @@
font-family = JetBrainsMono Nerd Font
theme = dark:Catppuccin Mocha,light:Catppuccin Latte
window-theme = ghostty
command = bash -c "$SHELL"
#background-opacity = 0.85
background-blur = true
auto-update = check
shell-integration = nushell
shell-integration-features = ssh-env,ssh-terminfo
+32
View File
@@ -0,0 +1,32 @@
theme = "catppuccin_mocha_transparent"
[editor]
line-number = "relative"
cursorline = true
color-modes = true
bufferline = "multiple"
true-color = true
mouse = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.indent-guides]
render = true
character = "│"
skip-levels = 1
[editor.statusline]
left = ["mode", "spinner", "file-name", "file-modification-indicator"]
center = []
right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
separator = "│"
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"
[keys.normal]
# Mimic Neovim config keymaps
space = { space = "file_picker", "," = "buffer_picker" }
@@ -0,0 +1 @@
inherits = "catppuccin_latte"\n\n"ui.background" = {}
@@ -0,0 +1,3 @@
inherits = "catppuccin_mocha"
"ui.background" = {}
+7
View File
@@ -0,0 +1,7 @@
{
"workspace": {
"library": [
"/usr/share/hypr/stubs"
]
}
}
View File
Whitespace-only changes.
+10
View File
@@ -0,0 +1,10 @@
general {
lock_cmd = hyprlock
before_sleep_cmd = loginctl lock-session
after_sleep_cmd = hyprctl dispatch dpms on
}
listener {
timeout = 300
on-timeout = loginctl lock-session
}
+281
View File
@@ -0,0 +1,281 @@
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
source = ~/.config/hypr/monitors.conf
source = ~/.config/hypr/theme.conf
###################
### MY PROGRAMS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
# Set programs that you use
$terminal = ghostty
$fileManager = nemo
$menu = qs ipc call appLauncher open
$clipboard = qs ipc call clipboardPicker open
$lock = hyprlock
$powermenu = qs ipc call powerMenu open
#################
### AUTOSTART ###
#################
exec-once = hypridle
exec-once = trayscale --hide-window
exec-once = nextcloud
exec-once = wl-paste --watch cliphist store
exec-once = quickshell
exec-once = easyeffects --service-mode
exec-once = lxqt-polkit-agent
exec-once = /home/johannes/.local/bin/mcpproxy
exec-once = awww-daemon
#############################
### ENVIRONMENT VARIABLES ###
#############################
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = XCURSOR_THEME,Bibata-Modern-Classic
env = QT_QPA_PLATFORMTHEME,qt5ct:qt6ct
env = MOZ_ENABLE_WAYLAND,1
env = XDG_SESSION_TYPE,wayland
env = MOZ_DBUS_REMOTE,1
env = GDK_BACKEND,wayland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_FORCE_DPI,physical
env = OZONE_PLATFORM,wayland
env = EGL_PLATFORM,wayland
env = CLUTTER_BACKEND,wayland
env = TERM,ghostty
env = TERMINAL,ghostty
env = ELECTRON_OZONE_PLATFORM_HINT,auto
env = QT_QPA_PLATFORM,wayland
env = QT_STYLE_OVERRIDE,kvantum
env = GTK_THEME,catppuccin-mocha-mauve-standard+default
env = PROTON_DLSS_UPGRADE,1
#####################
### LOOK AND FEEL ###
#####################
general {
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = $red
col.inactive_border = $surface1
resize_on_border = false
allow_tearing = false
layout = dwindle
}
decoration {
rounding = 2
rounding_power = 2
active_opacity = 1.0
inactive_opacity = 0.9
shadow {
enabled = true
range = 4
render_power = 3
color = rgba(1a1a1aee)
}
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
}
animations {
enabled = true
bezier = wind, 0.05, 0.9, 0.1, 1.05
bezier = winIn, 0.1, 1.1, 0.1, 1.1
bezier = winOut, 0.3, -0.3, 0, 1
bezier = liner, 1, 1, 1, 1
animation = windows, 1, 6, wind, slide
animation = windowsIn, 1, 6, winIn, slide
animation = windowsOut, 1, 5, winOut, slide
animation = windowsMove, 1, 5, wind, slide
animation = border, 1, 1, liner
animation = borderangle, 1, 30, liner, loop
animation = fade, 1, 10, default
animation = workspaces, 1, 5, wind
}
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
workspace = 2, layoutopt:direction:right
dwindle {
# pseudotile = true
preserve_split = true
}
master {
new_status = slave
}
scrolling {
fullscreen_on_one_column = true
column_width = 0.9
direction = right
}
misc {
force_default_wallpaper = -1
disable_hyprland_logo = false
}
#############
### INPUT ###
#############
input {
kb_layout = de
kb_model =
kb_rules =
follow_mouse = 1
sensitivity = 0
touchpad {
natural_scroll = true
}
}
gestures {
# workspace_swipe = true
}
# Example per-device config
device {
name = epic-mouse-v1
sensitivity = -0.5
}
###################
### KEYBINDINGS ###
###################
$mainMod = SUPER
exec = hyprctl dispatch submap global
submap = global
# Apps
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, M, exec, $powermenu
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, H, togglefloating,
bind = $mainMod, Space, exec, $menu
bind = $mainMod, P, pseudo,
#bind = $mainMod, J, togglesplit,
bind = $mainMod, F, fullscreen
bind = $mainMod, L, exec, $lock
bind = $mainMod, V, exec, $clipboard
# Layout
bind = $mainMod, period, layoutmsg, move +col
bind = $mainMod, comma, layoutmsg, move -col
bind = $mainMod SHIFT, period, layoutmsg, swapcol r
bind = $mainMod SHIFT, comma, layoutmsg, swapcol l
# Theme / wallpaper switchers
bind = $mainMod, T, exec, qs ipc call themeSwitcher open
bind = $mainMod, W, exec, qs ipc call wallpaperSwitcher open
bind = $mainMod SHIFT, W, exec, qs ipc call wallpaperSwitcher random
# Brightness
bindl = , XF86MonBrightnessUp, global, brightnessctl set 10%-
bindl = , XF86MonBrightnessDown, global, brightnessctl set 10%-
# Media
bindl = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
bindl = ,XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-
bindl = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindl = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindl = ,XF86AudioPlay, exec, playerctl play-pause
bindl = ,XF86AudioPause, exec, playerctl play-pause
bindl = ,XF86AudioStop, exec, playerctl stop
bindl = ,XF86AudioNext, exec, playerctl next
bindl = ,XF86AudioPrev, exec, playerctl previous
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
##############################
### WINDOWS AND WORKSPACES ###
##############################
windowrule = match:class vivaldi-snapshot, opacity 1.0 override 1.0 override
windowrule = float true,match:class ^(org.quickshell)$,match:title ^(Theme Switcher)$
windowrule = decorate false,match:class ^(org.quickshell)$,match:title ^(Theme Switcher)$
windowrule = rounding 34,match:class ^(org.quickshell)$,match:title ^(Theme Switcher)$
windowrule = float true,match:class ^(org.quickshell)$,match:title ^(Wallpaper Switcher)$
windowrule = decorate false,match:class ^(org.quickshell)$,match:title ^(Wallpaper Switcher)$
windowrule = rounding 34,match:class ^(org.quickshell)$,match:title ^(Wallpaper Switcher)$
windowrule = float true,match:class ^(org.quickshell)$,match:title ^(Power Menu)$
windowrule = decorate false,match:class ^(org.quickshell)$,match:title ^(Power Menu)$
windowrule = rounding 34,match:class ^(org.quickshell)$,match:title ^(Power Menu)$
windowrule = float true,match:class ^(org.quickshell)$,match:title ^(Clipboard Picker)$
windowrule = decorate false,match:class ^(org.quickshell)$,match:title ^(Clipboard Picker)$
windowrule = rounding 34,match:class ^(org.quickshell)$,match:title ^(Clipboard Picker)$
windowrule = float true,match:class ^(org.quickshell)$,match:title ^(App Launcher)$
windowrule = decorate false,match:class ^(org.quickshell)$,match:title ^(App Launcher)$
windowrule = rounding 34,match:class ^(org.quickshell)$,match:title ^(App Launcher)$
+266
View File
@@ -0,0 +1,266 @@
-- Migrated from hyprland.conf for Hyprland 0.55+.
-- Keep this file active as ~/.config/hypr/hyprland.lua.
local hypr_dir = (os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config")) .. "/hypr"
----------------
--- MONITORS ---
----------------
hl.monitor({
output = "",
mode = "preferred",
position = "auto",
scale = "auto",
})
dofile(hypr_dir .. "/monitors.lua")
-------------------
--- MY PROGRAMS ---
-------------------
local terminal = "ghostty"
local fileManager = "nemo"
local menu = "qs ipc call appLauncher open"
local clipboard = "qs ipc call clipboardPicker open"
local lock = "hyprlock"
local powermenu = "qs ipc call powerMenu open"
-----------------
--- AUTOSTART ---
-----------------
hl.on("hyprland.start", function()
hl.exec_cmd("hypridle")
hl.exec_cmd("trayscale --hide-window")
hl.exec_cmd("owncloud")
hl.exec_cmd("wl-paste --watch cliphist store")
hl.exec_cmd("quickshell")
hl.exec_cmd("easyeffects --service-mode")
hl.exec_cmd("lxqt-polkit-agent")
hl.exec_cmd("/home/johannes/.local/bin/mcpproxy")
hl.exec_cmd("awww-daemon")
end)
-----------------------------
--- ENVIRONMENT VARIABLES ---
-----------------------------
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
hl.env("XCURSOR_THEME", "Bibata-Modern-Classic")
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct:qt6ct")
hl.env("MOZ_ENABLE_WAYLAND", "1")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("MOZ_DBUS_REMOTE", "1")
hl.env("GDK_BACKEND", "wayland")
hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
hl.env("QT_WAYLAND_FORCE_DPI", "physical")
hl.env("OZONE_PLATFORM", "wayland")
hl.env("EGL_PLATFORM", "wayland")
hl.env("CLUTTER_BACKEND", "wayland")
hl.env("TERM", "ghostty")
hl.env("TERMINAL", "ghostty")
hl.env("ELECTRON_OZONE_PLATFORM_HINT", "auto")
hl.env("QT_QPA_PLATFORM", "wayland")
hl.env("GTK_THEME", "catppuccin-mocha-mauve-standard+default")
hl.env("PROTON_DLSS_UPGRADE", "1")
---------------------
--- LOOK AND FEEL ---
---------------------
hl.config({
general = {
gaps_in = 5,
gaps_out = 20,
border_size = 2,
col = {
active_border = "rgb(f38ba8)",
inactive_border = "rgb(45475a)",
},
resize_on_border = false,
allow_tearing = false,
layout = "dwindle",
},
decoration = {
rounding = 2,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 0.9,
shadow = {
enabled = true,
range = 4,
render_power = 3,
color = "rgba(1a1a1aee)",
},
blur = {
enabled = true,
size = 3,
passes = 1,
vibrancy = 0.1696,
},
},
animations = {
enabled = true,
},
dwindle = {
preserve_split = true,
},
master = {
new_status = "slave",
},
scrolling = {
fullscreen_on_one_column = true,
column_width = 0.9,
direction = "right",
},
misc = {
force_default_wallpaper = -1,
disable_hyprland_logo = false,
},
})
hl.curve("wind", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } })
hl.curve("winIn", { type = "bezier", points = { { 0.1, 1.1 }, { 0.1, 1.1 } } })
hl.curve("winOut", { type = "bezier", points = { { 0.3, -0.3 }, { 0, 1 } } })
hl.curve("liner", { type = "bezier", points = { { 1, 1 }, { 1, 1 } } })
hl.animation({ leaf = "windows", enabled = true, speed = 6, bezier = "wind", style = "slide" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 6, bezier = "winIn", style = "slide" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 5, bezier = "winOut", style = "slide" })
hl.animation({ leaf = "windowsMove", enabled = true, speed = 5, bezier = "wind", style = "slide" })
hl.animation({ leaf = "border", enabled = true, speed = 1, bezier = "liner" })
hl.animation({ leaf = "borderangle", enabled = true, speed = 30, bezier = "liner", style = "loop" })
hl.animation({ leaf = "fade", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 5, bezier = "wind" })
hl.workspace_rule({
workspace = "2",
layout_opts = { direction = "right" },
})
-------------
--- INPUT ---
-------------
hl.config({
input = {
kb_layout = "de",
kb_model = "",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = true,
},
},
})
hl.device({
name = "epic-mouse-v1",
sensitivity = -0.5,
})
-------------------
--- KEYBINDINGS ---
-------------------
local mainMod = "SUPER"
-- Apps
hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + Q", hl.dsp.window.close())
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(powermenu))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + H", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + Space", hl.dsp.exec_cmd(menu))
hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" }))
hl.bind(mainMod .. " + L", hl.dsp.exec_cmd(lock))
hl.bind(mainMod .. " + V", hl.dsp.exec_cmd(clipboard))
-- Layout
hl.bind(mainMod .. " + period", hl.dsp.layout("move +col"))
hl.bind(mainMod .. " + comma", hl.dsp.layout("move -col"))
hl.bind(mainMod .. " + SHIFT + period", hl.dsp.layout("swapcol r"))
hl.bind(mainMod .. " + SHIFT + comma", hl.dsp.layout("swapcol l"))
-- Theme / wallpaper switchers
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd("qs ipc call themeSwitcher open"))
hl.bind(mainMod .. " + W", hl.dsp.exec_cmd("qs ipc call wallpaperSwitcher open"))
hl.bind(mainMod .. " + SHIFT + W", hl.dsp.exec_cmd("qs ipc call wallpaperSwitcher random"))
-- Brightness
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl set 10%-"), { locked = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl set 10%-"), { locked = true })
-- Media
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true })
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true })
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioStop", hl.dsp.exec_cmd("playerctl stop"), { locked = true })
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
-- Move focus with mainMod + arrow keys
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
-- Switch workspaces with mainMod + [0-9]
-- Move active window to a workspace with mainMod + SHIFT + [0-9]
for i = 1, 10 do
local key = i % 10
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
end
-- Scratchpad
hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
-- Scroll through existing workspaces with mainMod + scroll
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- Move/resize windows with mainMod + LMB/RMB and dragging
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
------------------------------
--- WINDOWS AND WORKSPACES ---
------------------------------
hl.window_rule({
match = { class = "vivaldi-snapshot" },
opacity = "1.0 override 1.0 override",
})
local quickshell_popups = {
"Theme Switcher",
"Wallpaper Switcher",
"Power Menu",
"Clipboard Picker",
"App Launcher",
}
for _, title in ipairs(quickshell_popups) do
hl.window_rule({
match = { class = "^(org.quickshell)$", title = "^(" .. title .. ")$" },
float = true,
})
hl.window_rule({
match = { class = "^(org.quickshell)$", title = "^(" .. title .. ")$" },
decorate = false,
})
hl.window_rule({
match = { class = "^(org.quickshell)$", title = "^(" .. title .. ")$" },
rounding = 20,
})
end
+108
View File
@@ -0,0 +1,108 @@
source = $HOME/.config/hypr/theme.conf
$accent = $mauve
$accentAlpha = $mauveAlpha
$font = JetBrainsMono Nerd Font
# GENERAL
general {
hide_cursor = true
}
# BACKGROUND
background {
monitor =
path = screenshot
blur_passes = 2
blur_size = 7
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
color = $base
}
# LAYOUT
label {
monitor =
text = Layout: $LAYOUT
color = $text
font_size = 25
font_family = $font
position = 30, -30
halign = left
valign = top
}
# TIME
label {
monitor =
text = $TIME
color = $text
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:43200000] date +"%A, %d %B %Y"
color = $text
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}
# FINGERPRINT
label {
monitor =
text = $FPRINTPROMPT
color = $text
font_size = 14
font_family = $font
position = 0, -107
halign = center
valign = center
}
# USER AVATAR
image {
monitor =
path = $HOME/.face
size = 100
border_size = 4
border_color = $accent
position = 0, 75
halign = center
valign = center
}
# INPUT FIELD
input-field {
monitor =
size = 300, 60
outline_thickness = 4
dots_size = 0.2
dots_spacing = 0.2
dots_center = true
outer_color = $accent
inner_color = $surface0
font_color = $text
fade_on_empty = false
placeholder_text = <span foreground="##$textAlpha"><i>󰌾 Logged in as </i><span foreground="##$accentAlpha">$USER</span></span>
hide_input = false
check_color = $accent
fail_color = $red
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i>
capslock_color = $yellow
position = 0, -47
halign = center
valign = center
rounding = -1
}
+78
View File
@@ -0,0 +1,78 @@
$rosewater = rgb(f5e0dc)
$rosewaterAlpha = f5e0dc
$flamingo = rgb(f2cdcd)
$flamingoAlpha = f2cdcd
$pink = rgb(f5c2e7)
$pinkAlpha = f5c2e7
$mauve = rgb(cba6f7)
$mauveAlpha = cba6f7
$red = rgb(f38ba8)
$redAlpha = f38ba8
$maroon = rgb(eba0ac)
$maroonAlpha = eba0ac
$peach = rgb(fab387)
$peachAlpha = fab387
$yellow = rgb(f9e2af)
$yellowAlpha = f9e2af
$green = rgb(a6e3a1)
$greenAlpha = a6e3a1
$teal = rgb(94e2d5)
$tealAlpha = 94e2d5
$sky = rgb(89dceb)
$skyAlpha = 89dceb
$sapphire = rgb(74c7ec)
$sapphireAlpha = 74c7ec
$blue = rgb(89b4fa)
$blueAlpha = 89b4fa
$lavender = rgb(b4befe)
$lavenderAlpha = b4befe
$text = rgb(cdd6f4)
$textAlpha = cdd6f4
$subtext1 = rgb(bac2de)
$subtext1Alpha = bac2de
$subtext0 = rgb(a6adc8)
$subtext0Alpha = a6adc8
$overlay2 = rgb(9399b2)
$overlay2Alpha = 9399b2
$overlay1 = rgb(7f849c)
$overlay1Alpha = 7f849c
$overlay0 = rgb(6c7086)
$overlay0Alpha = 6c7086
$surface2 = rgb(585b70)
$surface2Alpha = 585b70
$surface1 = rgb(45475a)
$surface1Alpha = 45475a
$surface0 = rgb(313244)
$surface0Alpha = 313244
$base = rgb(1e1e2e)
$baseAlpha = 1e1e2e
$mantle = rgb(181825)
$mantleAlpha = 181825
$crust = rgb(11111b)
$crustAlpha = 11111b
+1
View File
@@ -0,0 +1 @@
../themes/catppuccin/mocha/hypr.conf
+127
View File
@@ -0,0 +1,127 @@
customCommands:
- key: <c-a>
description: AI-powered conventional commit
context: global
prompts:
- type: "menu"
key: "Type"
title: "Type of change"
options:
- name: "AI defined"
description: "Let AI analyze and determine the best commit type"
value: "ai-defined"
- name: "build"
description: "Changes that affect the build system or external dependencies"
value: "build"
- name: "feat"
description: "A new feature"
value: "feat"
- name: "fix"
description: "A bug fix"
value: "fix"
- name: "chore"
description: "Other changes that don't modify src or test files"
value: "chore"
- name: "ci"
description: "Changes to CI configuration files and scripts"
value: "ci"
- name: "docs"
description: "Documentation only changes"
value: "docs"
- name: "perf"
description: "A code change that improves performance"
value: "perf"
- name: "refactor"
description: "A code change that neither fixes a bug nor adds a feature"
value: "refactor"
- name: "revert"
description: "Reverts a previous commit"
value: "revert"
- name: "style"
description: "Changes that do not affect the meaning of the code"
value: "style"
- name: "test"
description: "Adding missing tests or correcting existing tests"
value: "test"
- type: menuFromCommand
title: "AI Generated Commit Messages"
key: CommitMsg
command: |
bash -c "
# Check for staged changes
diff=\$(git diff --cached | head -n 10)
if [ -z \"\$diff\" ]; then
echo \"No changes in staging. Add changes first.\"
exit 1
fi
SELECTED_TYPE=\"{{.Form.Type}}\"
COMMITS_TO_SUGGEST=8
aichat \"
You are an expert at writing Git commits. Your job is to write commit messages that follow the Conventional Commits format.
The user has selected: \$SELECTED_TYPE
Your task is to:
1. Analyze the code changes
2. Determine the most appropriate commit type (if user selected 'ai-defined')
3. Determine an appropriate scope (component/area affected)
4. Decide if this is a breaking change
5. Write clear, concise commit messages
Available commit types:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system or external dependencies
- ci: Changes to CI configuration files and scripts
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
Follow these guidelines:
- Structure: <type>(<scope>): <description>
- If user selected 'ai-defined', analyze the changes and pick the most suitable type
- If user selected a specific type, use that type: \$SELECTED_TYPE
- Add scope in parentheses if applicable (e.g., auth, api, ui, config)
- Use exclamation mark (!) after type/scope for breaking changes: type(scope)!: description
- Use lowercase for description (except proper nouns)
- Use imperative mood (\\\"add\\\", not \\\"added\\\")
- Keep description under 50 characters when possible
- No period at the end of subject line
Examples:
- feat(auth): add OAuth login support
- fix(api): handle null response in user endpoint
- docs(readme): update installation instructions
- style(ui): improve button spacing consistency
- refactor(database): simplify query builder logic
- test(auth): add unit tests for login flow
- build(deps): upgrade React to version 18
- ci(github): fix deployment workflow
- chore(config): update ESLint rules
- perf(api)!: optimize database queries
IMPORTANT:
- Generate exactly \$COMMITS_TO_SUGGEST different commit message options
- If user selected 'ai-defined', you can use different types for different options
- If user selected a specific type, all messages must use that type
- Only return commit messages, no explanations
- Do not use markdown code blocks
- One message per line
Previous commits for context:
\$(git log --oneline -10)
Changes to analyze:
\$(git diff --cached --stat)
\$(git diff --cached)
\"
"
command: "git commit -m \"{{.Form.CommitMsg}}\""
loadingText: "Generating commit messages..."
+1
View File
@@ -0,0 +1 @@
../themes/catppuccin/mocha/mako.conf
+42
View File
@@ -0,0 +1,42 @@
{
"mcpServers": {
"github.com/modelcontextprotocol/servers/tree/main/src/git": {
"args": [
"mcp-server-git"
],
"command": "uvx"
},
"github.com/upstash/context7-mcp": {
"args": [
"@upstash/context7-mcp"
],
"command": "pnpx"
},
"memory": {
"args": [
"@modelcontextprotocol/server-memory"
],
"command": "pnpx"
},
"searxng": {
"args": [
"mcp-searxng"
],
"autoApprove": [
"search"
],
"command": "pnpx",
"disabled": false,
"env": {
"SEARXNG_URL": "https://search.jokresner.de"
}
},
"sequentialthinking": {
"args": [
"@modelcontextprotocol/server-sequential-thinking"
],
"command": "pnpx"
}
},
"nativeMCPServers": []
}
+349
View File
@@ -0,0 +1,349 @@
input {
keyboard {
xkb {
layout "de"
}
repeat-delay 300
repeat-rate 30
}
touchpad {
tap
natural-scroll
}
mouse {
accel-profile "flat"
}
focus-follows-mouse max-scroll-amount="0%"
}
output "Samsung Electric Company C49HG9x H4ZRC02847" {
mode "3840x1080@144"
scale 1
transform "normal"
variable-refresh-rate on-demand=true
position x=0 y=0
}
output "Samsung Electric Company SAMSUNG 0x01000E00" {
//off
scale 2
}
output "Samsung Electric Company Odyssey G85SB H1AK500000" {
mode "3440x1440@174.962"
scale 1.33
transform "normal"
variable-refresh-rate
position x=1920 y=0
}
output "Iiyama North America PL2730H 1153680901995" {
mode "1920x1080@74.973"
scale 1
transform "normal"
position x=0 y=0
}
layout {
gaps 10
center-focused-column "never"
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
proportion 1.0
}
focus-ring {
off
}
background-color "transparent"
default-column-width { proportion 0.66667; }
border {
width 2
//active-gradient from="#0DB7D4" to="#9778D0" angle=90
//inactive-color "#04404A"
active-color "#f38ba8"
inactive-color "#45475a"
}
struts {
left 2
right 2
top 2
bottom 2
}
}
layer-rule {
match namespace="^swww-daemon$"
place-within-backdrop true
}
spawn-at-startup "systemctl" "--user" "enable" "--now" "hypridle"
spawn-at-startup "awww-daemon"
spawn-at-startup "trayscale" "--hide-window"
spawn-at-startup "owncloud"
spawn-at-startup "wl-paste" "--watch" "cliphist" "store"
spawn-at-startup "quickshell"
spawn-at-startup "mcpproxy" "serve"
spawn-at-startup "lxqt-policykit-agent"
environment {
LD_PRELOAD ""
MOZ_ENABLE_WAYLAND "1"
XDG_SESSION_TYPE "wayland"
XDG_CURRENT_DESKTOP "niri"
XDG_SESSION_DESKTOP "niri"
MOZ_DBUS_REMOTE "1"
GDK_BACKEND "wayland,x11"
QT_AUTO_SCREEN_SCALE_FACTOR "1"
QT_WAYLAND_FORCE_DPI "physical"
OZONE_PLATFORM "wayland"
EGL_PLATFORM "wayland"
CLUTTER_BACKEND "wayland"
TERM "ghostty"
TERMINAL "ghostty"
_JAVA_AWT_WM_NONREPARENTING "1"
ELECTRON_OZONE_PLATFORM_HINT "wayland"
QT_QPA_PLATFORMTHEME "qt5ct:qt6ct"
QT_QPA_PLATFORM "wayland"
QT_STYLE_OVERRIDE "kvantum"
GTK_THEME "catppuccin-mocha-mauve-standard+default"
XCURSOR_SIZE "24"
XCURSOR_THEME "Bibata-Modern-Classic"
__GL_THREADED_OPTIMIZATIONS "0"
PROTON_DLSS_UPGRADE "1"
//nv __GL_VRR_ALLOWED "1"
//nv __GL_GSYNC_ALLOWED "1"
}
prefer-no-csd
hotkey-overlay {
skip-at-startup
}
//screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
screenshot-path null
//screenshot-notification-disable
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
// slowdown 3.0
}
window-rule {
match app-id="^(steam_app_.*)$"
variable-refresh-rate true
open-fullscreen true
}
window-rule {
match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"#
default-floating-position x=10 y=10 relative-to="bottom-right"
}
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
// Quickshell popups from Hyprland rules.
window-rule {
match app-id=r#"^org\.quickshell$"# title="^Theme Switcher$"
match app-id=r#"^org\.quickshell$"# title="^Wallpaper Switcher$"
match app-id=r#"^org\.quickshell$"# title="^Power Menu$"
match app-id=r#"^org\.quickshell$"# title="^Clipboard Picker$"
match app-id=r#"^org\.quickshell$"# title="^App Launcher$"
open-floating true
geometry-corner-radius 34
clip-to-geometry true
border {
off
}
shadow {
off
}
}
window-rule {
match app-id=r#"^org\.quickshell$"# title="^App Launcher$"
match app-id=r#"^org\.quickshell$"# title="^Clipboard Picker$"
default-column-width { fixed 720; }
default-window-height { fixed 520; }
}
window-rule {
match app-id=r#"^org\.quickshell$"# title="^Wallpaper Switcher$"
default-column-width { fixed 900; }
default-window-height { fixed 560; }
}
window-rule {
match app-id=r#"^org\.quickshell$"# title="^Theme Switcher$"
default-column-width { fixed 640; }
default-window-height { fixed 480; }
}
window-rule {
match app-id=r#"^org\.quickshell$"# title="^Power Menu$"
default-column-width { fixed 420; }
default-window-height { fixed 320; }
}
binds {
Mod+Shift+7{ show-hotkey-overlay; }
Mod+Return { spawn "ghostty"; }
Super+Space { spawn "qs" "ipc" "call" "appLauncher" "open"; }
Super+L { spawn "hyprlock"; }
Super+M { spawn "qs" "ipc" "call" "powerMenu" "open"; }
Super+V { spawn "qs" "ipc" "call" "clipboardPicker" "open"; }
Super+T { spawn "qs" "ipc" "call" "themeSwitcher" "open"; }
Super+W { spawn "qs" "ipc" "call" "wallpaperSwitcher" "open"; }
Super+Shift+W { spawn "qs" "ipc" "call" "wallpaperSwitcher" "random"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%-"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioStop allow-when-locked=true { spawn "playerctl" "stop"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "5%+"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; }
Mod+Q { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
Mod+Ctrl+Left { move-column-left; }
Mod+Ctrl+Down { move-window-down; }
Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; }
Mod+Ctrl+H { move-column-left; }
Mod+Ctrl+J { move-window-down; }
Mod+Ctrl+K { move-window-up; }
Mod+Ctrl+L { move-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Shift+Left { focus-monitor-left; }
Mod+Shift+Down { focus-monitor-down; }
Mod+Shift+Up { focus-monitor-up; }
Mod+Shift+Right { focus-monitor-right; }
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+J { focus-monitor-down; }
Mod+Shift+K { focus-monitor-up; }
Mod+Shift+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Shift+U { move-workspace-down; }
Mod+Shift+I { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
Mod+Shift+WheelScrollDown { focus-column-right; }
Mod+Shift+WheelScrollUp { focus-column-left; }
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Ctrl+1 { move-column-to-workspace 1; }
Mod+Ctrl+2 { move-column-to-workspace 2; }
Mod+Ctrl+3 { move-column-to-workspace 3; }
Mod+Ctrl+4 { move-column-to-workspace 4; }
Mod+Ctrl+5 { move-column-to-workspace 5; }
Mod+Ctrl+6 { move-column-to-workspace 6; }
Mod+Ctrl+7 { move-column-to-workspace 7; }
Mod+Ctrl+8 { move-column-to-workspace 8; }
Mod+Ctrl+9 { move-column-to-workspace 9; }
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; }
Mod+Shift+F { maximize-column; }
Mod+F { fullscreen-window; }
Mod+C { center-column; }
Mod+Minus { set-column-width "-10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+Shift+Minus { set-window-height "-10%"; }
Mod+Shift+Equal { set-window-height "+10%"; }
Mod+V { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+Shift+E { quit; }
Ctrl+Alt+Delete { quit; }
}
+10
View File
@@ -0,0 +1,10 @@
def "nu-complete pm" [spans: list<string>] {
let args = ($spans | skip 1)
let index = (($args | length) - 1)
^pm completion query --json --index $index -- ...$args
| from json
| each {|it| {value: $it.value description: ($it | get -o description | default "")}}
}
@complete 'nu-complete pm'
export extern "pm" []
+177
View File
@@ -0,0 +1,177 @@
#-----------------
# History Settings
#-----------------
$env.config.history.file_format = "sqlite"
$env.config.history.max_size = 5_000_000
#-----------------------
# Miscellaneous Settings
#-----------------------
$env.config.show_banner = false
#-----------------------------
# Command Line Editor Settings
#-----------------------------
$env.config.edit_mode = "vi"
$env.config.buffer_editor = "nvim"
$env.config.cursor_shape.vi_insert = "line"
$env.config.cursor_shape.vi_normal = "block"
#---------------------
# Completions Settings
#---------------------
$env.config.completions.algorithm = "fuzzy"
$env.config.completions.sort = "smart"
$env.config.completions.partial = true
$env.config.completions.use_ls_colors = true
#---------------------
# External Completions
#---------------------
$env.config.completions.external.enable = true
$env.config.completions.external.max_results = 50
#------------------
# Terminal Settings
#------------------
$env.config.use_kitty_protocol = true
#----------------
# Datetime Format
#----------------
$env.config.datetime_format.table = "%d-%m-%Y %H:%M:%S"
$env.config.datetime_format.normal = "%d-%m-%Y %H:%M:%S"
#-----------------
# Filesize Display
#-----------------
$env.config.filesize.unit = "metric"
#------------
# Alias setup
#------------
alias ll = ls -l
alias la = ls -la
alias lm = ls -l | sort-by modified
alias lsd = ls -l | where type == dir
alias lg = lazygit
alias cocker = docker compose
alias ff = fastfetch
alias lj = lazyjj
alias vi = nvim
alias vim = nvim
alias v = nvim
alias vd = chezmoi edit # edit dotfiles
alias t = task
alias ag = ast-grep
alias zdev = zellij --layout yazineo
alias zterm = zellij --layout terminal
if ( which task | is-empty ) {
alias task = go tool task
}
if ($nu.os-info.name == 'macos') {
alias tailscale = /Applications/Tailscale.app/Contents/MacOS/Tailscale
}
#----------------------
# Environment Variables
#----------------------
$env.GCM_CREDENTIAL_STORE = "gpg"
let gpg_tty = (tty | complete)
if $gpg_tty.exit_code == 0 {
$env.GPG_TTY = ($gpg_tty.stdout | str trim)
}
$env.EDITOR = "nvim"
#----------------------
# External Dependencies
#----------------------
source $"($nu.cache-dir)/starship.nu"
source $"($nu.cache-dir)/carapace.nu"
source $"($nu.cache-dir)/zoxide.nu"
source $"($nu.cache-dir)/atuin.nu"
#--------
# Scripts
# -------
overlay use ~/.config/nushell/scripts/git/mod.nu
overlay use ~/.config/nushell/scripts/alias-finder.nu
source ~/.config/nushell/scripts/commands.nu
#source ~/.config/nushell/vendor/autoload/wt.nu
#-----------------
# Completion files
#-----------------
source ~/.config/nushell/completions/pm.nu
#----------------
# Custom Banner
#----------------
def banner [] {
# Catppuccin Mocha Palette Mappings (assuming terminal theme is set, otherwise approximations)
let rosewater = (ansi -e '38;2;245;224;220m')
let flamingo = (ansi -e '38;2;242;205;205m')
let pink = (ansi -e '38;2;245;194;231m')
let mauve = (ansi -e '38;2;203;166;247m')
let red = (ansi -e '38;2;243;139;168m')
let maroon = (ansi -e '38;2;235;160;172m')
let peach = (ansi -e '38;2;250;179;135m')
let yellow = (ansi -e '38;2;249;226;175m')
let green = (ansi -e '38;2;166;227;161m')
let teal = (ansi -e '38;2;148;226;213m')
let sky = (ansi -e '38;2;137;220;235m')
let sapphire = (ansi -e '38;2;116;199;236m')
let blue = (ansi -e '38;2;137;180;250m')
let lavender = (ansi -e '38;2;180;190;254m')
let text = (ansi -e '38;2;205;214;244m')
let overlay1 = (ansi -e '38;2;127;132;156m')
let overlay0 = (ansi -e '38;2;108;112;134m')
let reset = (ansi reset)
# Dynamic accent choice
let accent = ([$mauve, $pink, $sapphire, $green, $peach] | shuffle | first)
let sys_info = (sys host)
let uptime = $sys_info.uptime
let kernel = $sys_info.kernel_version
# Calculate config load time (env.nu + config.nu execution)
let startup = ((date now) - ($env.__NU_START_TIME? | default (date now)))
let version = (version | get version)
# Styling elements
let pipe = $"($overlay0)│($reset)"
let sep = $"($overlay1)::($reset)"
let header_line = $"($overlay0)──────────────────────────────────($reset)"
print ""
print $" ($overlay0)╭──($reset) ($accent)SYSTEM_READY($reset) ($header_line)"
print $" ($pipe)"
print $" ($pipe) ($lavender)HOST_ID($reset) ($sep) ($text)($sys_info.hostname)($reset)"
print $" ($pipe) ($lavender)KERNEL_VER($reset) ($sep) ($text)($kernel)($reset)"
print $" ($pipe) ($lavender)UPTIME_DUR($reset) ($sep) ($text)($uptime)($reset)"
print $" ($pipe)"
print $" ($pipe) ($lavender)SHELL_ENV($reset) ($sep) ($text)nu ($version)($reset)"
print $" ($pipe) ($lavender)LOAD_TIME($reset) ($sep) ($accent)($startup)($reset)"
print $" ($pipe)"
print $" ($overlay0)╰──($reset) ($header_line) ($accent)[OK]($reset)"
print ""
}
banner
+100
View File
@@ -0,0 +1,100 @@
$env.__NU_START_TIME = (date now)
use std *
path add ~/.cargo/bin
path add ~/.local/bin
path add ~/go/bin
path add ~/.local/share/bob/nvim-bin
$env.SHELL = '/usr/bin/nu'
$env.ZELLIJ_SOCKET_DIR = '/tmp/zellij'
$env.RAINFROG_CONFIG = '~/.config/rainfrog'
if ($nu.os-info.name == 'macos') {
path add /opt/homebrew/bin
path add /opt/nanobrew/prefix/bin
path add ~/.orbstack/bin
path add ~/.rustup/toolchains/nightly-aarch64-apple-darwin/bin
path add /Applications/lux-cli.app/Contents/MacOS
path add /nix/var/nix/profiles/default/bin
$env.SHELL = '/opt/homebrew/bin/nu'
$env.XDG_RUNTIME_DIR = "/tmp/"
}
if not ($nu.cache-dir | path exists) {
mkdir $"($nu.cache-dir)"
}
def create_cache [name: string, generator: closure] {
let file = $"($nu.cache-dir)/($name).nu"
if not ($file | path exists) {
do $generator | save -f $file
}
}
create_cache starship { starship init nu }
create_cache zoxide { zoxide init nushell }
create_cache atuin { atuin init nu }
create_cache carapace {
$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense';
^carapace _carapace nushell | str replace '$env.config = $current' '$env.config = ($env.config? | default {} | merge $current)'
}
def --env apply_mise_env [mise_bin: string] {
let vars = (
^$mise_bin hook-env -s nu
| from csv --noheaders --no-infer
| rename 'op' 'name' 'value'
)
for var in $vars {
if $var.op == "set" {
if ($var.name | str uppercase) == "PATH" {
$env.PATH = ($var.value | split row (char esep))
} else {
load-env {($var.name): $var.value}
}
} else if $var.op == "hide" and $var.name in $env {
hide-env -i $var.name
}
}
}
def --env add-hook [field: cell-path new_hook: any] {
let field = $field | split cell-path | update optional true | into cell-path
let old_config = $env.config? | default {}
let old_hooks = $old_config | get $field | default []
$env.config = ($old_config | upsert $field ($old_hooks ++ [$new_hook]))
}
let mise_candidates = if ($nu.os-info.name == "macos") {
["/opt/homebrew/bin/mise" "~/.local/bin/mise" "mise"]
} else {
["~/.local/bin/mise" "/home/linuxbrew/.linuxbrew/bin/mise" "mise"]
}
let mise_bin = (
$mise_candidates
| each {|candidate|
if $candidate == "mise" {
if (which mise | is-empty) { null } else { "mise" }
} else {
let expanded = ($candidate | path expand)
if ($expanded | path exists) { $expanded } else { null }
}
}
| compact
| get 0?
)
if $mise_bin != null {
$env.MISE_SHELL = "nu"
apply_mise_env $mise_bin
let mise_hook = {
condition: { "MISE_SHELL" in $env }
code: { apply_mise_env $mise_bin }
}
add-hook hooks.pre_prompt $mise_hook
add-hook hooks.env_change.PWD $mise_hook
}
+46
View File
@@ -0,0 +1,46 @@
export-env {
def get_prefix [] {
if ($env.NU_ALIAS_FINDER_PREFIX? | is-empty) == true {
return " Alias Tip:"
}
return $env.NU_ALIAS_FINDER_PREFIX
}
def check_if_command_in_ignored [cmd: string] {
if ($env.NU_ALIAS_FINDER_IGNORED? | is-empty) == true {
return false
}
let $ignored = ($env.NU_ALIAS_FINDER_IGNORED | split row ",")
return ($ignored | any { |item| $item | str contains $cmd })
if ($ignored | any { |item| $item | str contains $cmd }) {
return true
}
return false
}
# functions
export def check_if_aliased [cmd: string] {
if (check_if_command_in_ignored $cmd) == true {
return
}
if (help aliases | where name == '($cmd)' | length ) > 0 {
return
}
if (help aliases | where expansion == ($cmd) | length ) > 0 {
print $"(ansi blue_bold)(get_prefix)(ansi reset) (help aliases | where expansion == ($cmd) | get 0 | get name)"
return
}
if (help aliases | where {|it| $cmd | str contains $it.expansion} | length ) > 0 {
print $"(ansi blue_bold)(get_prefix)(ansi reset) (help aliases | where {|it| $cmd | str contains $it.expansion} | get 0 | get name)"
return
}
}
# hook
$env.config = (
$env.config
| upsert hooks.pre_execution (
$env.config.hooks?.pre_execution? | default [] | append {||
$env.repl_commandline = (commandline)
check_if_aliased $env.repl_commandline
}
)
)
}
+84
View File
@@ -0,0 +1,84 @@
# Returns a record of changed env variables after running a non-nushell script's contents (passed via stdin), e.g. a bash script you want to "source"
def capture-foreign-env [
--shell (-s): string = /bin/sh
# The shell to run the script in
# (has to support '-c' argument and POSIX 'env', 'echo', 'eval' commands)
--arguments (-a): list<string> = []
# Additional command line arguments to pass to the foreign shell
] {
let script_contents = $in;
let env_out = with-env { SCRIPT_TO_SOURCE: $script_contents } {
^$shell ...$arguments -c `
env
echo '<ENV_CAPTURE_EVAL_FENCE>'
eval "$SCRIPT_TO_SOURCE"
echo '<ENV_CAPTURE_EVAL_FENCE>'
env`
}
| split row '<ENV_CAPTURE_EVAL_FENCE>'
| {
before: ($in | first | str trim | lines)
after: ($in | last | str trim | lines)
}
# Unfortunate Assumption:
# No changed env var contains newlines (not cleanly parseable)
$env_out.after
| where { |line| $line not-in $env_out.before } # Only get changed lines
| parse "{key}={value}"
| where key not-in [ "_" "SHLVL" "_AST_FEATURES" ] # Filter out shell internal vars
| transpose --header-row --as-record
| if $in == [] { {} } else { $in }
}
def --env y [...args] {
let tmp = ($nu.temp-dir | path join $"yazi-cwd.(random chars).txt")
touch $tmp
yazi ...$args --cwd-file $tmp
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}
rm -fp $tmp
}
# zj: "Smart Zellij"
# 1. If argument provided: cd there, then open zellij
# 2. If no argument: open zellij in current dir
def --env zj [path?: string] {
if ($path != null) {
cd $path
}
let session_name = ($env.PWD | path basename)
# Use -c to attach if exists (including EXITED) or create if it doesn't
zellij attach -c $session_name
}
def man [topic: string] {
^man $topic | bat -l man -p
}
def chezmoi-add [] {
let externals = (
open ~/.local/share/chezmoi/.chezmoiexternal.toml
| transpose path _
| get path
)
chezmoi status
| lines
| each { |line| $line | str substring 3.. | str trim }
| where { |path|
not ($externals | any { |ext| ($path == $ext) or ($path | str starts-with $"($ext)/") })
}
| each { |path| chezmoi add $"($env.HOME)/($path)" }
}
def gopass-save [msg = "update password store"] {
gopass git status
gopass git add .
gopass git commit -m $msg
gopass git pull --rebase
gopass git push
}
+15
View File
@@ -0,0 +1,15 @@
export def agree [
prompt
--default-not (-n)
] {
let prompt = if ($prompt | str ends-with '!') {
$'(ansi red)($prompt)(ansi reset)'
} else {
$'($prompt)'
}
(if $default_not { [no yes] } else { [yes no] } | input list $prompt) == 'yes'
}
export def tips [msg] {
print -e $"(ansi light_gray)($msg)(ansi reset)"
}
+35
View File
@@ -0,0 +1,35 @@
export def cmpl-git-log [] {
git log -n 32 --pretty=%h»¦«%s
| lines
| split column "»¦«" value description
#| each { $"($in.value) # ($in.description)"}
| { completions: $in, options: { sort: false } }
}
export def cmpl-git-log-all [] {
git log --all -n 32 --pretty=%h»¦«%d»¦«%s
| lines
| split column "»¦«" value branch description
| each {|x| $x | update description $"($x.branch) ($x.description)" }
| { completions: $in, options: { sort: false } }
}
export def cmpl-git-branch-files [context: string, offset:int] {
let token = $context | split row ' '
let branch = $token | get 1
let files = $token | skip 2
git ls-tree -r --name-only $branch
| lines
| where {|x| not ($x in $files)}
}
export def cmpl-git-branches [] {
git branch
| lines
| where {|x| not ($x | str starts-with '*')}
| each {|x| $"($x|str trim)"}
}
export def cmpl-git-remotes [] {
^git remote | lines | each { |line| $line | str trim }
}
+544
View File
@@ -0,0 +1,544 @@
use common.nu *
use complete.nu *
use stat.nu *
def sum_prefix [p] {
$in | items {|k,v| if ($k | str starts-with $p) { $v } else { 0 } } | math sum
}
# git stash
export def git-stash [
--apply (-a)
--clear (-c)
--drop (-d)
--list (-l)
--pop (-p)
--show (-s)
--all (-A)
--include-untracked (-i)
] {
if $apply {
git stash apply
} else if $clear {
git stash clear
} else if $drop {
git stash drop
} else if $list {
git stash list
} else if $pop {
git stash pop
} else if $show {
git stash show --text
} else if $all {
git stash --all ...(if $include_untracked {[--include-untracked]} else {[]})
} else {
let s = _git_status
if ($s | sum_prefix 'wt_') > 0 {
git stash
} else {
git stash pop
}
}
}
# git branch
export def git-branch [
branch?: string@cmpl-git-branches
--remote (-r)='origin': string@cmpl-git-remotes
--delete (-d)
--no-merged (-n)
] {
let bs = git branch | lines | each {|x| $x | str substring 2..}
if $delete {
let remote_branches = remote_branches
if ($branch | is-empty) {
let dels = if $no_merged { gb } else {
gb
| where { $in.merged | is-not-empty }
}
| where { ($in.remote | is-empty) and ($in.current | is-empty) }
| each {|x|
let pf = if ($x.current | is-empty) { " " } else { $"(ansi cyan)* " }
let nm = if ($x.merged | is-not-empty ) { $"(ansi green)☑ " } else { " " }
$x | insert display $"($nm)($pf)(ansi reset)($x.branch)"
}
if ($dels | is-empty) {
tips "no branches to delete"
return
}
let $dels = $dels
| input list -d display --multi
| get branch
for b in $dels {
tips $"delete (ansi yellow)($b)"
git branch -D $b
}
if ($dels | is-not-empty) and (agree 'delete remote branch?!') {
for b in ($dels | where { $"($remote)/($in)" in $remote_branches }) {
tips $"delete (ansi yellow)($remote)/($b)"
git branch -D -r $'($remote)/($b)'
git push $remote -d $b
}
}
} else {
if $branch in $bs and (agree $'branch `($branch)` will be delete!') {
git branch -D $branch
}
if $"($remote)/($branch)" in $remote_branches and (agree $'remote branch `($branch)` will be delete!') {
git branch -D -r $'($remote)/($branch)'
git push $remote -d $branch
}
}
} else if ($branch | is-empty) {
let merged = git branch --merged
| lines
| each { $in | parse -r '\s*\*?\s*(?<b>[^\s]+)' | get 0.b }
{
local: (git branch)
remote: (git branch --remote)
}
| transpose k v
| each {|x|
$x.v | lines
| each {|n|
let n = $n | parse -r '\s*(?<c>\*)?\s*(?<b>[^\s]+)( -> )?(?<r>[^\s]+)?' | get 0
let c = if ($n.c | is-empty) { null } else { true }
let r = if ($n.r | is-empty) { null } else { $n.r }
let m = if $n.b in $merged { true } else { null }
let rm = if $x.k == 'remote' { true } else { null }
{ current: $c, remote: $rm, branch: $n.b, ref: $r, merged: $m }
}
}
| flatten
} else if $branch in $bs {
git checkout $branch
} else {
if (agree 'create new branch?') {
git checkout -b $branch
}
}
}
# git clone, init
export def --env git-new [
repo?: string@cmpl-git-branches
local?: path
--submodule (-s) # git submodule
--init (-i) # git init
] {
if $init {
if ($repo | is-empty) {
git init --initial-branch main
} else {
git init $repo --initial-branch main
cd $repo
}
if $submodule {
git submodule init
}
} else {
let local = if ($local | is-empty) {
$repo | path basename | split row '.' | get 0
} else {
$local
}
git clone ...(if $submodule {[--recurse-submodules]} else {[]}) $repo $local
cd $local
}
}
# edit .gitignore
export def git-ignore [--empty-dir] {
if $empty_dir {
[
'# Ignore everything in this directory'
'*'
'# Except this file'
'!.gitignore'
] | str join (char newline) | save .gitignore
} else {
^$env.EDITOR ([(git rev-parse --show-toplevel) .gitignore] | path join)
}
}
# git pull, push and switch
export def git-pull-push [
branch?: string@cmpl-git-branches # branch
--remote (-r)='origin': string@cmpl-git-remotes # remote
--rebase
--force (-f) # git push -f
--empty: string
--submodule (-s) # git submodule
--init (-i) # git init
--autostash (-a) # git pull --autostash
--back-to-prev (-b) # back to branch
] {
if $submodule {
git submodule update
} else if $rebase {
git pull --rebase
} else if ($empty | is-not-empty) {
git pull --rebase
git add --all
git commit --allow-empty -m $"🫙($empty)"
git push
} else {
# git fetch --prune
let m = if $rebase { [--rebase] } else { [] }
let a = if $autostash {[--autostash]} else {[]}
let prev = (_git_status).branch
let branch = if ($branch | is-empty) { $prev } else { $branch }
let branch_repr = $'(ansi yellow)($branch)(ansi light_gray)'
let lbs = git branch | lines | each { $in | str substring 2..}
let rbs = remote_branches
if $"($remote)/($branch)" in $rbs {
if $branch in $lbs {
let bmsg = $'both local and remote have ($branch_repr) branch'
if $force {
tips $'($bmsg), with `--force`, push'
git branch -u $'($remote)/($branch)' $branch
git push --force
} else {
tips $'($bmsg), pull'
if $prev != $branch {
tips $'switch to ($branch_repr)'
git checkout $branch
}
git pull ...$m ...$a
}
} else {
tips $"local doesn't have ($branch_repr) branch, fetch"
git fetch $remote $"($branch):($branch)"
git checkout $branch
git branch -u $'($remote)/($branch)' $branch
git pull ...$m ...$a -v
}
} else {
let bmsg = $"remote doesn't have ($branch_repr) branch"
let force = if $force {[--force]} else {[]}
if $branch in $lbs {
tips $'($bmsg), set upstream and push'
git checkout $branch
} else {
tips $'($bmsg), create and push'
git checkout -b $branch
}
git push ...$force --set-upstream $remote $branch
}
if $back_to_prev {
git checkout $prev
}
let s = _git_status
if $s.ahead > 0 {
tips 'remote is behind, push'
git push
}
}
}
# git add and restore
export def git-add [
...file: path
--all (-A)
--patch (-p)
--update (-u)
--verbose (-v)
--delete (-d) # git rm
--cached (-c)
--force (-f)
--restore (-r) # git restore
--staged (-s)
--source (-o): string
] {
mut args = []
if $restore {
if ($source | is-not-empty) { $args ++= [--source $source] }
if $staged { $args ++= [--staged]}
$args ++= if ($file | is-empty) { [.] } else { $file }
git restore ...$args
} else {
if $all { $args ++= [--all] }
if $patch { $args ++= [--patch] }
if $update { $args ++= [--update] }
if $verbose { $args ++= [--verbose] }
if $force { $args ++= [--force] }
$args ++= if ($file | is-empty) { [.] } else { $file }
git add ...$args
}
}
# git delete
export def git-delete [
...file: path
--force (-f)
--cached (-c)
--history (-h)
] {
mut args = []
if $history {
let f = $file | str join " "
(git filter-branch --force --index-filter
$'git rm --cached --ignore-unmatch ($f)'
--prune-empty --tag-name-filter cat
-- --all)
rm -rf ([(git rev-parse --show-toplevel) .git/refs/original/] | path join)
ggc
} else {
if $cached { $args ++= [--cached] }
if $force { $args ++= [--force] }
git rm ...$args -r ...$file
}
}
def cmpl-commit-type [] {
$env.GIT_COMMIT_TYPE | columns
}
# git commit
export def git-commit [
...message: string
--type (-t): string@cmpl-commit-type
--all (-A)
--amend (-a)
--keep (-k)
] {
mut args = []
if ($message | is-not-empty) {
let message = $message | str join ' '
let message = if ($type | is-empty) {
$message
} else {
$env.GIT_COMMIT_TYPE | get $type | str replace '{}' $message
}
$args ++= [-m $message]
} else {
if ($type | is-not-empty) {
let message = $env.GIT_COMMIT_TYPE | get $type | str replace '{}' ''
$args ++= [-m $message -e]
}
}
if $all { $args ++= [--all] }
if $amend { $args ++= [--amend] }
if $keep { $args ++= [--no-edit] }
git commit -v ...$args
}
# git diff
export def git-diff [
commit?: string@cmpl-git-log-all
commit2?: string@cmpl-git-log-all
--cached (-c) # cached
--unstashed (-u) # unstashed
--word-diff (-w) # word-diff
--staged (-s) # staged
] {
mut args = []
if $word_diff { $args ++= [--word-diff] }
if $cached { $args ++= [--cached] }
if $staged { $args ++= [--staged] }
let s = _git_status
if ($commit | is-empty) {
if ($s | sum_prefix 'wt_') > 0 {
git diff ...$args
} else if ($s | sum_prefix 'idx_') > 0 {
git diff ...$args --staged
}
} else {
if ($commit2 | is-empty) {
git diff ...$args $s.branch $commit
} else {
git diff ...$args $commit $commit2
}
}
}
# git merge
export def git-merge [
branch?: string@cmpl-git-branches
--abort (-a)
--continue (-c)
--quit (-q)
--squash (-s)
--fast-farward (-f)
--remote (-r)='origin': string@cmpl-git-remotes
] {
mut args = []
if $squash { $args ++= [--squash] }
if $fast_farward { $args ++= [--ff] } else { $args ++= [--no-ff] }
if ($branch | is-empty) {
git merge ...$args $"($remote)/(git_main_branch)"
} else {
git merge ...$args $branch
}
if $squash {
git commit -v
}
}
# git rebase
# TODO: --onto: (commit_id)
export def git-rebase [
branch?: string@cmpl-git-branches
--interactive (-i)
--onto (-o): string
--abort (-a)
--continue (-c)
--skip (-s)
--quit (-q)
] {
if $abort {
git rebase --abort
} else if $continue {
git rebase --continue
} else if $skip {
git rebase --skip
} else if $quit {
git rebase --quit
} else if ($onto | is-not-empty) {
git rebase --onto $branch
} else {
let i = if $interactive {[--interactive]} else {[]}
if ($branch | is-empty) {
git rebase ...$i (git_main_branch)
} else {
git rebase ...$i $branch
}
}
}
# git cherry-pick
export def git-cherry-pick [
commit?: string@cmpl-git-log-all
--abort (-a)
--continue (-c)
--skip (-s)
--quit (-q)
--no-commit (-n)
] {
mut args = []
if $abort {
$args ++= [--abort]
} else if $continue {
$args ++= [--continue]
} else if $skip {
$args ++= [--skip]
} else if $quit {
$args ++= [--quit]
} else {
if $no_commit {
$args ++= [--no-commit]
}
$args ++= [$commit]
}
git cherry-pick ...$args
}
# copy file from other branch
export def git-copy-file [
branch: string@cmpl-git-branches
...file: string@cmpl-git-branch-files
] {
^git checkout $branch $file
}
# git reset
export def git-reset [
commit?: string@cmpl-git-log
--hard (-h)
--soft (-s)
--clean (-c)
] {
mut args = []
if $hard { $args ++= [--hard] }
if $soft { $args ++= [--soft] }
if ($commit | is-not-empty) { $args ++= [$commit] }
git reset ...$args
if $clean {
git clean -fd
}
}
# git remote
export def git-remote [
remote?: string@cmpl-git-remotes
uri?: string
--add (-a)
--rename (-r)
--delete (-d)
--update (-u)
--set (-s)
] {
if ($remote | is-empty) {
git remote -v
} else if $add {
git remote add $remote $uri
} else if $set {
git remote set-url $remote $uri
} else if $rename {
let old = $remote
let new = $uri
git remote rename $old $new
} else if $delete {
git remote remove $remote
} else if $update {
git remote update $remote
} else {
git remote show $remote
}
}
# git bisect
export def git-bisect [
--bad (-b)
--good (-g)
--reset (-r)
--start (-s)
] {
if $good {
git bisect good
} else if $bad {
git bisect bad
} else if $reset {
git bisect reset
} else if $start {
git bisect start
} else {
git bisect
}
}
export def git-garbage-collect [] {
git reflog expire --all --expire=now
git gc --aggressive --prune=now
}
export def git-truncate-history [
retain:int=10
--message:string="Truncate history"
] {
let h = git log --pretty=%H --reverse -n $retain | lines | first
let s = _git_status
git checkout -f --orphan temp $h
git add .
git commit -m $message
git rebase --onto temp $h $s.branch
}
export def git-squash-last [
num:int
] {
let l = git log --pretty=»»¦««%s»¦«%b -n $num
| split row '»»¦««' | slice 1..
| split column '»¦«' message body
| each { $"($in.message)\n\n($in.body)" }
| str join "\n===\n"
git reset --soft $"HEAD~($num)"
git commit --edit -m $l
}
+20
View File
@@ -0,0 +1,20 @@
export def Q [...t --sep:string=''] {
let s = $t | str join $sep | str replace -a "'" "''"
$"'($s)'"
}
export def sqlx [s] {
open $env.GIT_FLOW_STATE | query db $s
}
export def --env init-db [env_name:string, file:string, hook: closure] {
let begin = date now
if $env_name not-in $env {
{$env_name: $file} | load-env
}
if ($file | path exists) { return }
{_: '.'} | into sqlite -t _ $file
open $file | query db "DROP TABLE _;"
do $hook {|s| open $file | query db $s } {|...t| Q ...$t }
print $"(ansi grey)created database: $env.($env_name), takes ((date now) - $begin)(ansi reset)"
}
+256
View File
@@ -0,0 +1,256 @@
use utils.nu *
use core.nu *
use complete.nu *
use stat.nu *
export-env {
$env.GIT_FLOW = {
branches: {
dev: dev
main: main
release: release
hotfix: hotfix
feature: feature
}
separator: '/'
}
}
def git-kind-select [kind] {
git branch
| lines
| where { $in | str starts-with '*' | not $in }
| each {|x| $"($x|str trim)"}
| where {|x|
let branches = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
$x | str starts-with $"($branches | get $kind)($sep)"
}
}
def cmpl-git-features [] {
git-kind-select feature
}
export def git-kind-branches [kind] {
let branches = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
let curr = (_git_status).branch
mut obj = $curr
if not ($obj | str starts-with $"($branches | get $kind)($sep)") {
let r = git-kind-select $kind
$obj = if ($r | is-empty) { $r } else { $r | input list $"There are no ($kind) currently, pick?" }
}
{
curr: $curr
$kind: $obj
dev: $branches.dev
main: $branches.main
}
}
export def gitflow-open-feature [
name: string
] {
let b = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
git checkout -b $"($b.feature)($sep)($name)" $b.dev
}
export def gitflow-close-feature [
--fast-farward (-f)
] {
let b = git-kind-branches feature
if ($b.feature | is-empty) {
print $"(ansi grey)There are no feature branches.(ansi reset)"
return
}
git checkout $b.dev
let f = if $fast_farward {[--ff]} else {[--no-ff]}
git merge ...$f $b.feature
let remote = git remote show
git push -u $remote $b.dev
git branch -d $b.feature
git checkout $b.dev
}
export def gitflow-resolve-feature [
] {
git checkout $env.GIT_FLOW.branches.dev
git add .
git commit
git push
}
export def gitflow-release [
tag?: string
--action(-a): closure
] {
let b = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
let remote = git remote show
git checkout $b.dev
git push -u $remote $b.dev
let rb = if ($tag | is-empty) {
$b.dev
} else {
let rb = $"($b.release)($sep)($tag)"
git checkout -b $rb $b.dev
if ($action | is-not-empty) {
do $action $tag
}
do -i { git commit -a -m $"Bumped version number to ($tag)" }
$rb
}
git checkout $b.main
let f = if ($tag | is-empty) {[--ff]} else {[--no-ff]}
git merge ...$f $rb
git push -u $remote $b.main
if ($tag | is-not-empty) {
git tag -a $tag
git push $remote tag $tag
do -i { git branch -d $rb }
}
git checkout $b.dev
}
export def gitflow-open-hotfix [
tag: string
] {
let b = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
let rb = $"($b.hotfix)($sep)($tag)"
git checkout -b $rb $b.main
# ... bump
git commit -a -m $"Bumped version number to ($tag)"
}
export def gitflow-close-hotfix [
message?: string
] {
let b = git-kind-branches hotfix
if ($b.hotfix | is-empty) {
print $"(ansi grey)There are no hotfix branches.(ansi reset)"
return
}
git checkout $b.hotfix
do -i { git commit -m $"Fixed: ($message)" }
let remote = git remote show
let f = if ($message | is-empty) {[--ff]} else {[--no-ff]}
git checkout $b.main
git merge ...$f $b.hotfix
git push -u $remote $b.main
if ($message | is-not-empty) {
let sep = $env.GIT_FLOW.separator
let t = $b.hotfix | split row $sep | slice 1.. | str join $sep
git tag -a $t
git push $remote tag $t
}
git checkout $b.dev
git merge ...$f $b.hotfix
git branch -d $b.hotfix
}
export def gitlab-open-feature [
name: string
--local(-l)
] {
let b = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
let remote = git remote show
let f = $"($b.feature)($sep)($name)"
git checkout -b $f $b.main
if not $local {
git push -u $remote $f
}
}
export def gitlab-close-feature [
--fast-farward (-f)
--local(-l)
] {
let b = git-kind-branches feature
if ($b.feature | is-empty) {
print $"(ansi grey)There are no feature branches.(ansi reset)"
return
}
let remote = git remote show
git checkout $b.main
if $local {
let f = if $fast_farward {[--ff]} else {[--no-ff]}
git merge ...$f $b.feature
git push
} else {
git pull
}
git branch -D $b.feature
let rb = $'($remote)/($b.feature)'
if $rb in (remote_branches) {
git branch -D -r $rb
git push $remote -d $b.feature
}
}
export def gitlab-resolve-feature [
] {
git checkout $env.GIT_FLOW.branches.main
git add .
git commit
git push
}
export def gitlab-release [
tag?: string
--from(-f): string
--to(-t): string = 'pre-production'
--action(-a): closure
] {
let b = $env.GIT_FLOW.branches
let sep = $env.GIT_FLOW.separator
let remote = git remote show
let $from = if ($from | is-empty) { $b.main } else { $from }
git checkout $from
git push -u $remote $from
let rb = if ($tag | is-empty) {
$from
} else {
let rb = $"($b.release)($sep)($tag)"
git checkout -b $rb $from
if ($action | is-not-empty) {
do $action $tag
}
do -i { git commit -a -m $"Bumped version number to ($tag)" }
$rb
}
git checkout $to
let f = if ($tag | is-empty) {[--ff]} else {[--no-ff]}
git merge ...$f $rb
git push -u $remote $rb
if ($tag | is-not-empty) {
git tag -a $tag
git push $remote tag $tag
do -i { git branch -d $rb }
}
git checkout $b.main
}
+76
View File
@@ -0,0 +1,76 @@
def 'precent' [] {
($in * 10000 | math round) / 100
}
def 'frequency' [-w: int] {
let o = $in
'' | fill -c '*' -w ($o * $w | math round)
}
def 'histogram-column' [column --len(-l):int = 50] {
let o = $in
let total = $o | get $column | math sum
let max = $o | get $column | math max | ($in / $total)
$o
| each {|x|
let c = $x | get $column | $in / $total
$x
| insert precent $"($c | precent)%"
| insert frequency ($c / $max | frequency -w $len)
}
}
def git_log [] {
git log --pretty=%h»¦«%aN»¦«%s»¦«%aD
| lines
| split column "»¦«" sha1 committer desc merged_at
}
export def git-histogram-merger [] {
git_log
| group-by committer
| items {|k, v| {committer: $k, count: ($v | length)} }
| histogram-column count
}
def cmpl-author [] {
git_log | group-by committer | columns
}
def cmpl-interval [] {
[hour day month year]
}
export def git-histogram-activities [
author:string@cmpl-author
--interval(-i): string@cmpl-interval
--builtin-histogram
] {
let dfs = match $interval {
'hour' => '%Y-%m-%d %H'
'day' => '%Y-%m-%d'
'month' => '%Y-%m'
'year' => '%Y'
_ => '%Y-%m-%d'
}
let d = git_log
| group-by committer
| get $author
| get merged_at
| into datetime
| format date $dfs
if $builtin_histogram {
$d
| histogram
| rename date
| sort-by date
} else {
$d
| wrap date
| sort-by date
| group-by date
| items {|k, v| {date: $k, count: ($v | length)} }
| histogram-column count
}
}
+20
View File
@@ -0,0 +1,20 @@
export use stat.nu *
export use utils.nu *
export use core.nu *
export use histogram.nu *
export use git-flow.nu *
export-env {
$env.GIT_COMMIT_TYPE = {
feat: 'feat: {}'
fix: 'fix: {}'
docs: 'docs: {}'
style: 'style: {}'
refactor: 'refactor: {}'
perf: 'perf: {}'
test: 'test: {}'
chore: 'chore: {}'
}
export use git-flow.nu
}
+40
View File
@@ -0,0 +1,40 @@
export alias gl = git-log
export alias gst = git-stash
export alias gb = git-branch
export alias gn = git-new
export alias gig = git-ignore
export alias gp = git-pull-push
export alias ga = git-add
export alias gdel = git-delete
export alias gc = git-commit
export alias gd = git-diff
export alias gm = git-merge
export alias gr = git-rebase
export alias gcp = git-cherry-pick
export alias gcpf = git-copy-file
export alias grs = git-reset
export alias grm = git-remote
export alias gbs = git-bisect
export alias ggc = git-garbage-collect
export alias ghm = git-histogram-merger
export alias gha = git-histogram-activities
export alias gcl = git config --list
export alias gsw = git switch
export alias gswc = git switch -c
export alias gts = git tag -s
export alias gfof = gitflow-open-feature
export alias gfcf = gitflow-close-feature
export alias gfrf = gitflow-resolve-feature
export alias gfrl = gitflow-release
export alias gfoh = gitflow-open-hotfix
export alias gfch = gitflow-close-hotfix
export alias gof = gitlab-open-feature
export alias gcf = gitlab-close-feature
export alias grf = gitlab-resolve-feature
export alias grl = gitlab-release
export alias goh = gitflow-open-hotfix
export alias gch = gitflow-close-hotfix
+226
View File
@@ -0,0 +1,226 @@
use complete.nu *
# git status
export def gs [] {
git status
}
export def _git_status [] {
# TODO: show-stash
let raw_status = do -i { git --no-optional-locks status --porcelain=2 --branch | lines }
let stashes = do -i { git stash list | lines | length }
mut status = {
idx_added_staged : 0
idx_modified_staged : 0
idx_deleted_staged : 0
idx_renamed : 0
idx_type_changed : 0
wt_untracked : 0
wt_modified : 0
wt_deleted : 0
wt_type_changed : 0
wt_renamed : 0
ignored : 0
conflicts : 0
ahead : 0
behind : 0
stashes : $stashes
repo_name : no_repository
tag : no_tag
branch : no_branch
remote : ''
}
if ($raw_status | is-empty) { return $status }
for s in $raw_status {
let r = $s | split row ' '
match $r.0 {
'#' => {
match ($r.1 | str substring 7..) {
'oid' => {
$status.commit_hash = ($r.2 | str substring 0..<8)
}
'head' => {
$status.branch = $r.2
}
'upstream' => {
$status.remote = $r.2
}
'ab' => {
$status.ahead = ($r.2 | into int)
$status.behind = ($r.3 | into int | math abs)
}
}
}
'1'|'2' => {
match ($r.1 | str substring 0..<1) {
'A' => {
$status.idx_added_staged += 1
}
'M' => {
$status.idx_modified_staged += 1
}
'R' => {
$status.idx_renamed += 1
}
'D' => {
$status.idx_deleted_staged += 1
}
'T' => {
$status.idx_type_changed += 1
}
}
match ($r.1 | str substring 1..<2) {
'M' => {
$status.wt_modified += 1
}
'R' => {
$status.wt_renamed += 1
}
'D' => {
$status.wt_deleted += 1
}
'T' => {
$status.wt_type_changed += 1
}
}
}
'?' => {
$status.wt_untracked += 1
}
'u' => {
$status.conflicts += 1
}
}
}
$status
}
def git-parse-stat [o: list<string>] {
mut r = { file:0, ins:0, del:0, change:[] }
for i in $o {
if ($i | is-empty) { continue }
if ($i | find -r '[0-9]+ file.+change' | is-not-empty) {
for j in ($i
| split row ','
| each {|x| $x | str trim | parse -r "(?<num>[0-9]+) (?<col>.+)" | first }
) {
let col = if ($j.col | str starts-with 'file') {
'file'
} else {
$j.col | str substring ..<3
}
let num = $j.num | into int
$r = $r | upsert $col $num
}
} else {
$r.change ++= [ ($i | split row '|' | first | str trim) ]
}
}
$r
}
export def _git_log [
--num(-n):int = 9
--reverse(-r)
--verbose(-v)
] {
let s = $"»(random chars -l 4)«"
let S = $"»(random chars -l 6)«"
let p = $"($S)($s)%h($s)%s($s)%aN($s)%aE($s)%aD($s)%D($s)%b"
mut a = [-n $num $"--pretty=($p)"]
if $reverse { $a ++= [--reverse] }
if $verbose { $a ++= [--stat] }
git log ...$a
| split row $S | slice 1..
| append $s
| reduce -f {c: { payload: [] }, r: [] } {|it, acc|
if ($it | str starts-with $s) {
let c = if $verbose {
$acc.c | merge (git-parse-stat $acc.c.payload)
} else {
$acc.c
}
| reject payload
$acc
| upsert r ($acc.r | append $c)
| update c (
$it
| split column $s _ sha message author email date refs body
| first
| reject _
| insert payload []
)
} else {
$acc | update c.payload {|x| $x.c.payload | append $it }
}
}
| get r | slice 1..
| each {|x|
let refs = if ($x.refs | is-empty) {
$x.refs
} else {
$x.refs | split row ", "
}
$x
| update date { $x.date | into datetime }
| update refs $refs
}
}
# git log
export def git-log [
commit?: string@cmpl-git-log
--markdown(-m)
--verbose(-v)
--reverse(-r)
--num(-n):int=32
] {
if ($commit|is-empty) {
let r = _git_log --reverse=(not $reverse) --verbose=$verbose -n $num
if $markdown {
mut m = []
for i in $r {
if ($i.refs | is-not-empty) {
let t = $i.refs
| where {|x| $x | str starts-with 'tag: ' }
| each {|x| $x | str substring 5.. }
for j in $t {
$m ++= [$"## ($j)"]
}
}
$m ++= [$"###### ($i.message)\n"]
$m ++= [$"> ($i.date | format date '%y-%m-%d/%w/%H:%M:%S') ($i.sha)\n"]
if ($i.body | str trim | is-not-empty) {
$m ++= [$"($i.body)"]
}
}
$m | str join "\n"
} else {
$r | update body {|x| $x.body | str trim}
}
} else {
git log --stat -p -n 1 $commit
}
}
export def remote_branches [] {
git branch -r
| lines
| str trim
| where {|x| not ($x | str starts-with 'origin/HEAD') }
}
export def git_main_branch [] {
git remote show origin
| lines
| str trim
| find --regex 'HEAD .*?[:: ].+'
| first
| str replace --regex 'HEAD .*?[:: ](.+)' '$1'
}
+102
View File
@@ -0,0 +1,102 @@
use stat.nu *
export def git-init [remote] {
git init --initial-branch main
git add .
git commit -m 'init'
git remote add origin $remote
}
export def git-is-repo [] {
(git rev-parse --is-inside-work-tree | complete).exit_code == 0
}
export def git-commit-changes [commit:string] {
git diff-tree --no-commit-id --name-only -r $commit | lines
}
export def git-last-changes [] {
let d = git log -n 9 --pretty=%h»¦«%s | lines | split column '»¦«' hash message
for i in $d {
let r = git-commit-changes $i.hash
if ($r | is-not-empty) {
return $r
}
}
[]
}
export def git-changes [] {
do -i { git --no-optional-locks status --porcelain=1 | lines }
}
export def git-last-commit [] {
let d = git log -n 9 --pretty=»»¦««%h»¦«%s»¦«%b
| split row '»»¦««' | slice 1..
| split column '»¦«' hash message body
for i in $d {
if (git-commit-changes $i.hash | is-not-empty) {
return $i
}
}
}
export def git-cdup [] {
let r = git rev-parse --show-cdup | complete
if $r.exit_code == 0 {
$r.stdout | str trim
}
}
export def git-repo-path [] {
let c = git-cdup
if ($c | describe) == nothing { return }
[$env.PWD (git-cdup)] | path join | path expand
}
export def git-sync [
src dest
--no-file
--push
--init: string
--post-sync: closure
--init-post-sync: closure
--trans-msg: closure
] {
let src = $src | path expand
cd $src
let l = git-last-commit
let msg = if ($trans_msg | is-empty) {
$"($l.message)\n\n($l.body)"
} else {
do $trans_msg $l
}
let dest = $dest | path expand
if not ($dest | path exists) { mkdir $dest }
cd $dest
if not $no_file {
rsync -a --delete --exclude='.git' $'($src)/' $dest
if ($post_sync | is-not-empty) and (git-is-repo) {
do $post_sync $src $dest $l
}
if ($init_post_sync | is-not-empty) {
do $init_post_sync $src $dest $l
}
}
if ($init | is-not-empty) and not (git-is-repo) {
git init .
git remote add origin $init
git add .
git commit -m $msg
if $push {
git push --set-upstream origin main
}
}
if (git-changes | is-not-empty) {
git add .
git commit -m $msg
if $push {
git push
}
}
}
+108
View File
@@ -0,0 +1,108 @@
#!/usr/bin/env nu
def apply-theme [selected: string] {
let choice = if $selected == "auto" {
let color_scheme = (bash -lc "gsettings get org.gnome.desktop.interface color-scheme 2>/dev/null || true" | str trim)
if ($color_scheme | str contains "prefer-dark") {
"mocha"
} else if ($color_scheme | str contains "prefer-light") {
"latte"
} else {
let hour = (date now | format date "%H" | into int)
if ($hour >= 19 or $hour < 7) { "mocha" } else { "latte" }
}
} else {
$selected
}
let home = $env.HOME
let base = $"($home)/.config/themes/catppuccin/($choice)"
if not ($base | path exists) {
notify-send "Theme not found" $base
exit 1
}
let gtk_theme = (open $"($base)/gtk-theme-name" | str trim)
$choice | save -f $"($home)/.config/current-theme"
# Hypr palette. Configs must source ~/.config/hypr/theme.conf to use this.
ln -sfn $"($base)/hypr.conf" $"($home)/.config/hypr/theme.conf"
# Quickshell singleton theme.
cp -f $"($base)/quickshell/Theme.qml" $"($home)/.config/quickshell/Theme/Theme.qml"
# Wofi colors.
if ($"($home)/.config/wofi" | path exists) {
ln -sfn $"($base)/wofi.css" $"($home)/.config/wofi/style.css"
}
# Mako colors, only if mako config dir exists.
if ($"($home)/.config/mako" | path exists) {
ln -sfn $"($base)/mako.conf" $"($home)/.config/mako/config"
if (which makoctl | is-not-empty) { makoctl reload }
}
# Btop theme
if ($"($home)/.config/btop/btop.conf" | path exists) {
bash -lc $"sed -i 's|color_theme = \".*\"|color_theme = \"($home)/.config/btop/themes/catppuccin_($choice).theme\"|' \"($home)/.config/btop/btop.conf\""
if ($"($home)/.local/share/chezmoi/dot_config/btop/btop.conf" | path exists) {
bash -lc $"sed -i 's|color_theme = \".*\"|color_theme = \"($home)/.config/btop/themes/catppuccin_($choice).theme\"|' \"($home)/.local/share/chezmoi/dot_config/btop/btop.conf\""
}
}
# Helix theme
if ($"($home)/.config/helix/config.toml" | path exists) {
bash -lc $"sed -i 's/theme = \"catppuccin_.*_transparent\"/theme = \"catppuccin_($choice)_transparent\"/' \"($home)/.config/helix/config.toml\""
if ($"($home)/.local/share/chezmoi/dot_config/helix/config.toml" | path exists) {
bash -lc $"sed -i 's/theme = \"catppuccin_.*_transparent\"/theme = \"catppuccin_($choice)_transparent\"/' \"($home)/.local/share/chezmoi/dot_config/helix/config.toml\""
}
}
# Yazi theme
if ($"($home)/.config/yazi" | path exists) {
$"[flavor]\nuse = \"catppuccin-($choice)\"\n" | save -f $"($home)/.config/yazi/theme.toml"
}
# GTK theme, only if installed.
if ($"/usr/share/themes/($gtk_theme)" | path exists) {
gsettings set org.gnome.desktop.interface gtk-theme $gtk_theme
let color_scheme = if $choice == "mocha" { "prefer-dark" } else { "prefer-light" }
gsettings set org.gnome.desktop.interface color-scheme $color_scheme
if ($"($home)/.config/gtk-3.0/settings.ini" | path exists) {
bash -lc $'sed -i "s/^gtk-theme-name=.*/gtk-theme-name=($gtk_theme)/" "$HOME/.config/gtk-3.0/settings.ini"'
}
} else {
notify-send "GTK theme not installed" $gtk_theme
}
hyprctl reload
bash -lc "pkill quickshell 2>/dev/null; setsid quickshell >/tmp/quickshell-theme-switch.log 2>&1 < /dev/null &"
notify-send "Theme applied" $"($choice) via ($selected)"
}
def main [
mode?: string
--auto
--mocha
--latte
] {
let valid = ["auto" "mocha" "latte"]
let selected = if $auto {
"auto"
} else if $mocha {
"mocha"
} else if $latte {
"latte"
} else if $mode == null {
($valid | str join "\n" | wofi --dmenu --prompt "Theme")
} else {
$mode
}
if ($selected not-in $valid) { exit }
apply-theme $selected
}
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/env nu
const image_exts = ["jpg" "jpeg" "png" "webp"]
def wallpaper-dirs [] {
[
($"($env.HOME)/Nextcloud/Wallpaper")
($"($env.HOME)/Nextcloud/Wallpaper_32x9")
] | where {|dir| $dir | path exists }
}
def list-wallpapers [] {
wallpaper-dirs
| each {|dir| ls $dir }
| flatten
| where type == file
| where {|file| (($file.name | path parse | get extension | str downcase) in $image_exts) }
| sort-by name
}
def set-wallpaper [path: string] {
if not ($path | path exists) {
notify-send "Wallpaper not found" $path
exit 1
}
awww img $path --transition-type grow --transition-duration 1
$path | save -f $"($env.HOME)/.config/current-wallpaper"
notify-send "Wallpaper applied" ($path | path basename)
}
def choose-wallpaper [] {
let files = (list-wallpapers)
if ($files | is-empty) {
notify-send "No wallpapers found" "~/Nextcloud/Wallpaper or ~/Nextcloud/Wallpaper_32x9"
exit 1
}
let choice = ($files | get name | path basename | str join "\n" | wofi --dmenu --prompt "Wallpaper")
if ($choice == "") { exit }
let selected = ($files | where {|file| ($file.name | path basename) == $choice } | get name | first)
set-wallpaper $selected
}
def random-wallpaper [] {
let files = (list-wallpapers)
if ($files | is-empty) {
notify-send "No wallpapers found" "~/Nextcloud/Wallpaper or ~/Nextcloud/Wallpaper_32x9"
exit 1
}
let selected = ($files | shuffle | get name | first)
set-wallpaper $selected
}
def current-wallpaper [] {
let file = $"($env.HOME)/.config/current-wallpaper"
if ($file | path exists) { open $file | str trim }
}
def main [
path?: string
--menu
--random
--set: string
--current
--list
] {
if $list {
list-wallpapers | get name | to json --raw
} else if $current {
current-wallpaper
} else if $random {
random-wallpaper
} else if $set != null {
set-wallpaper $set
} else if $path != null {
set-wallpaper $path
} else {
choose-wallpaper
}
}
+8
View File
@@ -0,0 +1,8 @@
keychain --eval --quiet ...(ls ~/.ssh | where name !~ '.pub$' and name !~ 'known_hosts' and name !~ 'config' and name !~ 'sockets' | get name)
| lines
| where not ($it | is-empty)
| parse "{k}={v}; export {k2};"
| select k v
| transpose --header-row
| into record
| load-env
+16
View File
@@ -0,0 +1,16 @@
You are the developer subagent.
Your task:
- Implement the current increment from the PM output.
Rules:
- Make the minimum necessary code and config changes.
- Preserve existing style and architecture.
- Run relevant tests when possible.
- If a test fails, fix the issue or clearly report the blocker.
- Do not expand scope beyond the PM increment.
- Return:
1. files changed
2. summary of implementation
3. tests run
4. known limitations
+49
View File
@@ -0,0 +1,49 @@
You are the orchestration agent.
Goal:
- Run an implementation loop using these subagents in this exact order:
1. pm
2. dev
3. qa
4. git
Loop contract:
- Start by asking the pm subagent to convert the user's request into:
- a concise problem statement
- implementation scope
- acceptance criteria
- edge cases
- a smallest useful increment
- Then ask the dev subagent to implement only the current increment.
- Then ask the qa subagent to verify the result against the acceptance criteria.
Decision rules:
- If qa passes, determine whether the full user request is complete.
- If complete, report completion and wait for the next user instruction.
- If incomplete, start the next PM -> DEV -> QA loop for the next increment.
- If qa fails, start another PM -> DEV -> QA loop focused only on the defects or missing acceptance criteria.
- After major changes, start the GIT subagent to commit the changes.
- Continue iterating until:
- the user explicitly says stop, pause, cancel, or otherwise instructs you to stop, or
- the work is fully complete and qa passes.
Output rules:
- Do not dump all subagent reasoning.
- After each loop, give a compact status update with:
- current increment
- what changed
- qa result
- next action
- Keep the team aligned on the latest acceptance criteria.
- Prefer small safe iterations over large rewrites.
Operational rules:
- Always use the Task tool to invoke pm, dev, qa and git.
- Never skip qa.
- Never let dev define scope; scope comes from pm and user intent.
- If requirements are ambiguous, ask pm to produce assumptions and pick the safest minimal assumption unless the ambiguity blocks implementation.
+22
View File
@@ -0,0 +1,22 @@
You are the product manager subagent.
Your task:
- Turn the user request into a developer-ready implementation slice.
Return exactly these sections:
1. Problem
2. Scope
3. Out of scope
4. Acceptance criteria
5. Edge cases
6. Suggested smallest increment
7. Notes for developer
8. Notes for qa
Rules:
- Be concrete.
- Prefer minimal viable scope.
- Resolve ambiguity with explicit assumptions.
- Do not write code.
- Do not edit files.
- Keep acceptance criteria testable and binary.
+25
View File
@@ -0,0 +1,25 @@
You are the QA subagent.
Your task:
- Validate the developer output against the PM acceptance criteria.
Check:
- functional correctness
- edge cases
- regressions
- missing tests
- mismatches with scope
- obvious quality issues
Return exactly:
1. Verdict: PASS | FAIL
2. Acceptance criteria status
3. Defects found
4. Regression risks
5. Recommended next step
Rules:
- Be strict.
- Do not edit files.
- Prefer reproducible findings.
- If evidence is insufficient, fail with the missing evidence listed explicitly.
+362
View File
@@ -0,0 +1,362 @@
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-openai-codex-auth",
"context-mode",
"cursor-acp"
],
"mcp": {
"metamcp": {
"type": "remote",
"url": "https://mcp.home.jokresner.de/metamcp/all/mcp"
},
"context-mode": {
"type": "local",
"command": [
"context-mode"
]
}
},
"provider": {
"openai": {
"options": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
},
"models": {
"gpt-5.2": {
"name": "GPT 5.2 (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"none": {
"reasoningEffort": "none",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
}
}
},
"gpt-5.2-codex": {
"name": "GPT 5.2 Codex (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
}
}
},
"gpt-5.1-codex-max": {
"name": "GPT 5.1 Codex Max (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"low": {
"reasoningEffort": "low",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
}
}
},
"gpt-5.1-codex": {
"name": "GPT 5.1 Codex (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
}
}
},
"gpt-5.1-codex-mini": {
"name": "GPT 5.1 Codex Mini (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium"
}
}
},
"gpt-5.1": {
"name": "GPT 5.1 (OAuth)",
"limit": {
"context": 272000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"variants": {
"none": {
"reasoningEffort": "none",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "low"
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium"
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "high"
}
}
}
}
}
},
"agent": {
"orchestrator": {
"mode": "primary",
"description": "Orchestrates PM -> DEV -> QA implementation loops until the user says to stop.",
"model": "openai/gpt-5.4",
"maxSteps": 50,
"permission": {
"edit": "allow",
"webfetch": "allow",
"bash": {
"*": "ask",
"git status*": "allow",
"git diff*": "allow",
"npm test*": "allow",
"pnpm test*": "allow",
"bun test*": "allow"
},
"task": {
"*": "deny",
"pm": "allow",
"dev": "allow",
"qa": "allow",
"git": "allow"
}
},
"prompt": "{file:./agents/orchestrator.md}"
},
"pm": {
"mode": "subagent",
"hidden": true,
"description": "Breaks requests into implementable requirements, acceptance criteria, scope and priorities.",
"model": "openai/gpt-5.4",
"permission": {
"edit": "deny",
"webfetch": "allow",
"bash": {
"*": "deny",
"git status*": "allow",
"git diff*": "allow",
"grep *": "allow",
"rg *": "allow"
}
},
"prompt": "{file:./agents/pm.md}"
},
"dev": {
"mode": "subagent",
"hidden": true,
"description": "Implements the PM plan with minimal, correct code changes.",
"model": "openai/gpt-5.4",
"permission": {
"edit": "allow",
"webfetch": "allow",
"bash": {
"*": "ask",
"git status*": "allow",
"git diff*": "allow",
"npm test*": "allow",
"pnpm test*": "allow",
"bun test*": "allow",
"vitest*": "allow",
"jest*": "allow"
}
},
"prompt": "{file:./agents/dev.md}"
},
"qa": {
"mode": "subagent",
"hidden": true,
"description": "Validates behavior against acceptance criteria, tests, regressions and quality risks.",
"model": "openai/gpt-5.4",
"permission": {
"edit": "deny",
"webfetch": "allow",
"bash": {
"*": "ask",
"git status*": "allow",
"git diff*": "allow",
"npm test*": "allow",
"pnpm test*": "allow",
"bun test*": "allow",
"vitest*": "allow",
"jest*": "allow"
}
},
"prompt": "{file:./agents/qa.md}"
},
"git": {
"mode": "subagent",
"hidden": true,
"description": "Conventional git workflow.",
"model": "openai/gpt-5.4",
"permission": {
"edit": "allow",
"webfetch": "allow",
"bash": {
"*": "ask",
"git status*": "allow",
"git diff*": "allow",
"npm test*": "allow",
"pnpm test*": "allow",
"bun test*": "allow",
"vitest*": "allow",
"jest*": "allow"
}
},
"prompt": "Create a git commit message using conventional commits for all changes in the current branch."
}
}
}
+32
View File
@@ -0,0 +1,32 @@
# Quickshell panel – agent guide
This repo is a **Quickshell** config: a Qt/QML Wayland panel (bar + widgets). It uses Quickshell APIs and a shared theme.
## Layout
- **`shell.qml`** – Entry. Uses `Bar` and enables `Quickshell.watchFiles` for reload on change.
- **`Bar/`** – Panel window and bar UI:
- `Bar.qml` – `PanelWindow` with a `RowLayout`; left/center/right sections use `BarPill`.
- `BarPill.qml` – Rounded container for a group of widgets (default property `content`).
- **`Theme/`** – Singleton `Theme` (Catppuccin Mocha): colors, `barHeight`, `padding`, `spacing`, `fontPixelSize`, `fontFamily`, `sectionRadius`, etc. All widgets and bar UI should use `Theme` only (no hardcoded colors/sizes).
- **`Widgets/`** – Bar widgets. Each has a `qmldir` entry; Bar imports `qs.Widgets` and instantiates them inside `BarPill`s.
## Conventions
1. **Theme** – Use `import qs.Theme` and reference `Theme.*` for colors, fonts, and layout constants.
2. **Widget root** – Widgets are typically `Item` with `implicitWidth`/`implicitHeight` from a main child (e.g. a `Text`).
3. **Icons** – Nerd Font codepoints in `Text` (e.g. `"\uF017 "` for clock). Font: `Theme.fontFamily` ("Fira Code Nerd Font").
4. **Popup/panel** – Widgets that open a popup (e.g. Clock, Tray) take `property var panelWindow: null` and receive the Bar’s `PanelWindow` from `Bar.qml`.
5. **CLI data** – Use Quickshell’s `Process` plus `StdioCollector` on stdout; use a `Timer` to refresh (e.g. every 30s). See `MemoryWidget.qml`.
6. **Bar placement** – To add/move widgets, edit `Bar/Bar.qml`: left section, center (e.g. clock), or right section; each group lives in one `BarPill`.
## Adding a widget
1. Add `YourWidget 1.0 YourWidget.qml` to `Widgets/qmldir`.
2. Implement the widget in `Widgets/YourWidget.qml` (Item root, Theme, implicit size).
3. In `Bar/Bar.qml`, add `YourWidget {}` inside the desired `BarPill` (and set `panelWindow: panel` if it needs a popup).
## Tech
- **Runtime**: Quickshell (Qt 6, QML, Wayland). Entry is `shell.qml`; pragmas at top (e.g. `UseQApplication`, `Env QT_QPA_PLATFORM=wayland`).
- **Modules**: `qs.Bar`, `qs.Theme`, `qs.Widgets` – each has a `qmldir` in its folder.
+51
View File
@@ -0,0 +1,51 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Theme
import qs.Widgets
PanelWindow {
id: panel
anchors.top: true
anchors.left: true
anchors.right: true
implicitHeight: Theme.barHeight + Theme.barMargin * 2
exclusionMode: ExclusionMode.Normal
exclusiveZone: implicitHeight
color: "transparent"
RowLayout {
anchors.fill: parent
anchors.leftMargin: Theme.barMargin
anchors.rightMargin: Theme.barMargin
anchors.topMargin: Theme.barMargin
anchors.bottomMargin: Theme.barMargin
spacing: Theme.spacing
BarPill {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
HyprlandWorkspaceWidget {}
NiriWorkspaceWidget {}
NetTrafficWidget {}
}
Item { Layout.fillWidth: true }
BarPill {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Clock { panelWindow: panel }
}
Item { Layout.fillWidth: true }
BarPill {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
StorageWidget {}
MemoryWidget {}
CpuWidget {}
TemperatureWidget {}
AudioWidget {}
TrayWidget { panelWindow: panel }
}
}
}
+27
View File
@@ -0,0 +1,27 @@
import QtQuick
import QtQuick.Layouts
import qs.Theme
Item {
id: root
default property alias content: sectionContent.data
property real pillRadius: Theme.sectionRadius
property real pillPadding: Theme.sectionPadding
implicitWidth: sectionContent.implicitWidth + pillPadding * 2
implicitHeight: Theme.barHeight - 2
Rectangle {
anchors.fill: parent
radius: pillRadius
color: Theme.base
opacity: 0.6
}
RowLayout {
id: sectionContent
anchors.centerIn: parent
spacing: Theme.widgetSpacing
height: parent.height - 2
}
}
+7
View File
@@ -0,0 +1,7 @@
import QtQuick
import QtQuick.Layouts
RowLayout {
spacing: 6
Layout.fillHeight: true
}
+4
View File
@@ -0,0 +1,4 @@
module Bar
Bar 1.0 Bar.qml
BarSection 1.0 BarSection.qml
BarPill 1.0 BarPill.qml
+36
View File
@@ -0,0 +1,36 @@
pragma Singleton
import QtQuick
QtObject {
// Catppuccin Mocha
property color base: "#1e1e2e"
property color mantle: "#181825"
property color crust: "#11111b"
property color surface0: "#313244"
property color surface1: "#45475a"
property color surface2: "#585b70"
property color overlay0: "#6c7086"
property color overlay1: "#7f849c"
property color overlay2: "#9399b2"
property color text: "#cdd6f4"
property color subtext0: "#a6adc8"
property color subtext1: "#bac2de"
property color mauve: "#cba6f7"
property color flamingo: "#f2cdcd"
property color peach: "#fab387"
property color sky: "#89dceb"
property color green: "#a6e3a1"
property color yellow: "#f9e2af"
property color red: "#f38ba8"
property color rosewater: "#f5e0dc"
property real barHeight: 36
property real padding: 10
property real spacing: 10
property real fontPixelSize: 14
property string fontFamily: "Fira Code Nerd Font"
property real sectionRadius: 14
property real sectionPadding: 12
property real barMargin: 16
property real widgetSpacing: 8
}
+1
View File
@@ -0,0 +1 @@
singleton Theme 1.0 Theme.qml
@@ -0,0 +1,185 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import Quickshell.Widgets as QSW
import qs.Theme
FloatingWindow {
id: win
title: "App Launcher"
visible: false
implicitWidth: 760
implicitHeight: 560
color: "transparent"
property var apps: []
property string query: ""
property int selectedIndex: 0
property bool mouseWasInside: false
property var filteredApps: apps.filter(function(app) {
const q = query.toLowerCase()
return q.length === 0 || app.name.toLowerCase().indexOf(q) >= 0 || app.comment.toLowerCase().indexOf(q) >= 0 || app.id.toLowerCase().indexOf(q) >= 0
})
function shellQuote(s) { return "'" + String(s).replace(/'/g, "'\\''") + "'" }
function focusSearch() { Qt.callLater(function() { search.focus = true; search.forceActiveFocus(); search.cursorPosition = search.text.length }) }
function clampIndex(index) { if (filteredApps.length === 0) return 0; return Math.max(0, Math.min(filteredApps.length - 1, index)) }
function selectIndex(index) { selectedIndex = clampIndex(index) }
function open() { mouseWasInside = false; query = ""; visible = true; refresh(); focusSearch() }
function toggle() { visible = !visible; if (visible) { mouseWasInside = false; query = ""; refresh(); focusSearch() } }
function refresh() { appList.running = true }
function launchSelected() {
if (filteredApps.length === 0) return
const id = filteredApps[selectedIndex].id
const hist = Quickshell.env("HOME") + "/.cache/quickshell/app-launcher-history"
launchProcess.command = ["bash", "-lc", "mkdir -p ~/.cache/quickshell; { printf '%s\\n' " + shellQuote(id) + "; grep -vxF " + shellQuote(id) + " " + shellQuote(hist) + " 2>/dev/null | head -n 29; } > " + shellQuote(hist + ".tmp") + " && mv " + shellQuote(hist + ".tmp") + " " + shellQuote(hist) + "; gtk-launch " + shellQuote(id)]
launchProcess.running = true
visible = false
}
onQueryChanged: { selectedIndex = 0; focusSearch() }
onFilteredAppsChanged: selectedIndex = clampIndex(selectedIndex)
onSelectedIndexChanged: if (visible) Qt.callLater(function() { list.positionViewAtIndex(selectedIndex, ListView.Contain) })
IpcHandler {
target: "appLauncher"
function open() { win.open() }
function toggle() { win.toggle() }
function refresh() { win.refresh() }
}
FocusScope {
id: root
anchors.fill: parent
focus: win.visible
function handleKey(event) {
if (event.text && event.text.length > 0 && event.text >= " " && !(event.modifiers & (Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier))) {
if (!search.activeFocus) {
win.query += event.text
win.focusSearch()
event.accepted = true
}
return
}
if (event.key === Qt.Key_Backspace && !search.activeFocus && win.query.length > 0) { win.query = win.query.slice(0, -1); win.focusSearch(); event.accepted = true }
else if (event.key === Qt.Key_Down || event.key === Qt.Key_J) { win.selectIndex(win.selectedIndex + 1); event.accepted = true }
else if (event.key === Qt.Key_Up || event.key === Qt.Key_K) { win.selectIndex(win.selectedIndex - 1); event.accepted = true }
else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { win.launchSelected(); event.accepted = true }
else if (event.key === Qt.Key_Escape) { win.visible = false; event.accepted = true }
}
Keys.onPressed: function(event) { root.handleKey(event) }
MouseArea { anchors.fill: parent; hoverEnabled: true; acceptedButtons: Qt.NoButton; onEntered: win.mouseWasInside = true; onExited: if (win.mouseWasInside) win.visible = false }
Rectangle { anchors.fill: parent; radius: 34; color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.13); border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.38); border.width: 1 }
Rectangle {
anchors.left: parent.left; anchors.right: parent.right; anchors.top: parent.top
anchors.margins: 28; height: 52; radius: 21
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.50)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
Text { anchors.left: parent.left; anchors.verticalCenter: parent.verticalCenter; anchors.leftMargin: 16; text: "󰍉"; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 5; color: Theme.mauve }
TextInput {
id: search
focus: true
activeFocusOnTab: true
anchors.left: parent.left; anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 50; anchors.rightMargin: 16
text: win.query
onTextChanged: win.query = text
clip: true
font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 2
color: Theme.text
selectionColor: Theme.mauve
selectedTextColor: Theme.base
Text { visible: search.text.length === 0; text: "Launch app…"; font: search.font; color: Theme.overlay1 }
Keys.onPressed: function(event) { root.handleKey(event) }
}
}
Timer {
interval: 60
repeat: true
running: win.visible && !search.activeFocus
onTriggered: win.focusSearch()
}
ListView {
id: list
anchors.left: parent.left; anchors.right: parent.right; anchors.top: parent.top; anchors.bottom: footer.top
anchors.leftMargin: 28; anchors.rightMargin: 28; anchors.topMargin: 96; anchors.bottomMargin: 14
model: win.filteredApps
spacing: 10
clip: true
currentIndex: win.selectedIndex
delegate: Rectangle {
id: card
width: list.width
height: 68
radius: 20
color: index === win.selectedIndex ? Qt.rgba(Theme.mauve.r, Theme.mauve.g, Theme.mauve.b, 0.22) : Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.45)
border.color: index === win.selectedIndex ? Theme.mauve : Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
border.width: index === win.selectedIndex ? 2 : 1
antialiasing: true
Rectangle {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 12
width: 44
height: 44
radius: 14
color: Qt.rgba(Theme.surface0.r, Theme.surface0.g, Theme.surface0.b, 0.72)
QSW.IconImage {
id: appIcon
anchors.centerIn: parent
width: 32
height: 32
source: modelData.icon ? "image://icon/" + modelData.icon : ""
asynchronous: true
mipmap: true
}
Text {
visible: appIcon.status === Image.Error || appIcon.source === ""
anchors.centerIn: parent
text: modelData.name.length ? modelData.name[0].toUpperCase() : "?"
font.family: Theme.fontFamily
font.bold: true
font.pixelSize: Theme.fontPixelSize + 7
color: Theme.mauve
}
}
ColumnLayout {
anchors.left: parent.left; anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 70; anchors.rightMargin: 14
spacing: 2
Text { Layout.fillWidth: true; text: modelData.name; elide: Text.ElideRight; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 1; font.bold: true; color: Theme.text }
Text { Layout.fillWidth: true; text: (modelData.used ? "Recent · " : "") + (modelData.comment || modelData.id); elide: Text.ElideRight; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize - 2; color: modelData.used ? Theme.green : Theme.overlay2 }
}
MouseArea { anchors.fill: parent; onClicked: { if (index === win.selectedIndex) win.launchSelected(); else win.selectIndex(index); search.forceActiveFocus() } }
}
}
Rectangle {
id: footer
anchors.left: parent.left; anchors.right: parent.right; anchors.bottom: parent.bottom
anchors.leftMargin: 42; anchors.rightMargin: 42; anchors.bottomMargin: 22
height: 44; radius: 18
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.42)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
Text { anchors.centerIn: parent; text: win.filteredApps.length + " apps · type search · ↑/↓ select · Enter launch · Esc"; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize - 2; color: Theme.overlay2 }
}
}
Process {
id: appList
running: false
command: ["python3", "-c", "import configparser,glob,os,json;\nseen={};\nhist_path=os.path.expanduser('~/.cache/quickshell/app-launcher-history');\nhist=[]\ntry:\n hist=[x.strip() for x in open(hist_path, encoding='utf-8') if x.strip()]\nexcept Exception:\n pass\nrank={v:i for i,v in enumerate(hist)}\npaths=glob.glob('/usr/share/applications/*.desktop')+glob.glob(os.path.expanduser('~/.local/share/applications/*.desktop'));\nfor p in paths:\n cp=configparser.ConfigParser(interpolation=None); cp.optionxform=str\n try: cp.read(p, encoding='utf-8')\n except Exception: continue\n if not cp.has_section('Desktop Entry'): continue\n d=cp['Desktop Entry']\n if d.get('Type','Application')!='Application' or d.get('NoDisplay','false').lower()=='true' or d.get('Hidden','false').lower()=='true': continue\n name=d.get('Name','').strip()\n if not name: continue\n did=os.path.basename(p)\n appid=did[:-8] if did.endswith('.desktop') else did\n seen[appid]={'id':appid,'name':name,'comment':d.get('Comment','').strip(),'icon':d.get('Icon','').strip(),'used': appid in rank}\nprint(json.dumps(sorted(seen.values(), key=lambda x:(rank.get(x['id'],999999), x['name'].lower()))))"]
stdout: StdioCollector { onStreamFinished: { try { win.apps = JSON.parse(text) } catch(e) { win.apps = [] }; win.selectedIndex = 0 } }
}
Process { id: launchProcess; running: false }
}
+58
View File
@@ -0,0 +1,58 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uF028 —%"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
}
Process {
id: process
command: ["sh", "-c", "wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var s = text.trim()
var muted = s.indexOf("MUTED") >= 0
var m = s.match(/[\d.]+/)
var vol = m ? parseFloat(m[0]) : 0
var pct = Math.round(vol * 100)
label.text = (muted ? "\uF6A9 " : "\uF028 ") + pct + "%"
label.color = muted ? Theme.overlay0 : Theme.peach
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 2000
repeat: false
onTriggered: process.running = true
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: function(mouse) {
if (mouse.button === Qt.RightButton)
Quickshell.execDetached(["wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle"])
else
Quickshell.execDetached(["pavucontrol"])
process.running = false
process.running = true
}
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,159 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Theme
FloatingWindow {
id: win
title: "Clipboard Picker"
visible: false
implicitWidth: 760
implicitHeight: 520
color: "transparent"
property var items: []
property string query: ""
property int selectedIndex: 0
property bool mouseWasInside: false
property var filteredItems: items.filter(function(x) { return query.length === 0 || x.toLowerCase().indexOf(query.toLowerCase()) >= 0 })
function shellQuote(s) { return "'" + String(s).replace(/'/g, "'\\''") + "'" }
function focusSearch() { Qt.callLater(function() { search.focus = true; search.forceActiveFocus(); search.cursorPosition = search.text.length }) }
function clampIndex(index) { if (filteredItems.length === 0) return 0; return Math.max(0, Math.min(filteredItems.length - 1, index)) }
function selectIndex(index) { selectedIndex = clampIndex(index) }
function open() { mouseWasInside = false; query = ""; visible = true; refresh(); focusSearch() }
function toggle() { visible = !visible; if (visible) { mouseWasInside = false; query = ""; refresh(); focusSearch() } }
function refresh() { listProcess.running = true }
function choose() {
if (filteredItems.length === 0) return
copyProcess.command = ["bash", "-lc", "printf %s " + shellQuote(filteredItems[selectedIndex]) + " | cliphist decode | wl-copy"]
copyProcess.running = true
visible = false
}
function removeSelected() {
if (filteredItems.length === 0) return
deleteProcess.command = ["bash", "-lc", "printf %s " + shellQuote(filteredItems[selectedIndex]) + " | cliphist delete"]
deleteProcess.running = true
}
onQueryChanged: { selectedIndex = 0; focusSearch() }
onFilteredItemsChanged: selectedIndex = clampIndex(selectedIndex)
onSelectedIndexChanged: if (visible) Qt.callLater(function() { list.positionViewAtIndex(selectedIndex, ListView.Contain) })
IpcHandler {
target: "clipboardPicker"
function open() { win.open() }
function toggle() { win.toggle() }
function refresh() { win.refresh() }
}
FocusScope {
id: root
anchors.fill: parent
focus: win.visible
function handleKey(event) {
if (event.text && event.text.length > 0 && event.text >= " " && !(event.modifiers & (Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier))) {
if (!search.activeFocus) {
win.query += event.text
win.focusSearch()
event.accepted = true
}
return
}
if (event.key === Qt.Key_Down || event.key === Qt.Key_J) { win.selectIndex(win.selectedIndex + 1); event.accepted = true }
else if (event.key === Qt.Key_Up || event.key === Qt.Key_K) { win.selectIndex(win.selectedIndex - 1); event.accepted = true }
else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { win.choose(); event.accepted = true }
else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) {
if (event.key === Qt.Key_Backspace && search.activeFocus && search.text.length > 0) return
win.removeSelected(); event.accepted = true
}
else if (event.key === Qt.Key_Escape) { win.visible = false; event.accepted = true }
}
Keys.onPressed: function(event) { root.handleKey(event) }
MouseArea { anchors.fill: parent; hoverEnabled: true; acceptedButtons: Qt.NoButton; onEntered: win.mouseWasInside = true; onExited: if (win.mouseWasInside) win.visible = false }
Rectangle { anchors.fill: parent; radius: 34; color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.13); border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.38); border.width: 1 }
Rectangle {
anchors.left: parent.left; anchors.right: parent.right; anchors.top: parent.top
anchors.margins: 28; height: 48; radius: 20
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.50)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
Text { anchors.left: parent.left; anchors.verticalCenter: parent.verticalCenter; anchors.leftMargin: 16; text: "󰅌"; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 3; color: Theme.mauve }
TextInput {
id: search
focus: true
activeFocusOnTab: true
anchors.left: parent.left; anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 48; anchors.rightMargin: 16
text: win.query
onTextChanged: win.query = text
clip: true
font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 1
color: Theme.text
selectionColor: Theme.mauve
selectedTextColor: Theme.base
Text { visible: search.text.length === 0; text: "Search clipboard…"; font: search.font; color: Theme.overlay1 }
Keys.onPressed: function(event) { root.handleKey(event) }
}
}
Timer {
interval: 60
repeat: true
running: win.visible && !search.activeFocus
onTriggered: win.focusSearch()
}
ListView {
id: list
anchors.left: parent.left; anchors.right: parent.right; anchors.top: parent.top; anchors.bottom: footer.top
anchors.leftMargin: 28; anchors.rightMargin: 28; anchors.topMargin: 90; anchors.bottomMargin: 14
model: win.filteredItems
spacing: 10
clip: true
currentIndex: win.selectedIndex
delegate: Rectangle {
id: card
width: list.width
height: 62
radius: 18
color: index === win.selectedIndex ? Qt.rgba(Theme.mauve.r, Theme.mauve.g, Theme.mauve.b, 0.22) : Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.45)
border.color: index === win.selectedIndex ? Theme.mauve : Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
border.width: index === win.selectedIndex ? 2 : 1
antialiasing: true
Text {
anchors.fill: parent; anchors.margins: 14
text: String(modelData).replace(/^\S+\s+/, "")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize
color: Theme.text
}
MouseArea { anchors.fill: parent; onClicked: { if (index === win.selectedIndex) win.choose(); else win.selectIndex(index); search.forceActiveFocus() } }
}
}
Rectangle {
id: footer
anchors.left: parent.left; anchors.right: parent.right; anchors.bottom: parent.bottom
anchors.leftMargin: 42; anchors.rightMargin: 42; anchors.bottomMargin: 22
height: 44; radius: 18
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.42)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
Text { anchors.centerIn: parent; text: win.filteredItems.length + " items · type search · ↑/↓ select · Enter copy · Backspace remove · Esc"; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize - 2; color: Theme.overlay2 }
}
}
Process {
id: listProcess
command: ["bash", "-lc", "cliphist list 2>/dev/null || true"]
running: false
stdout: StdioCollector { onStreamFinished: { win.items = text.trim().length ? text.trim().split('\n') : []; win.selectedIndex = 0 } }
}
Process { id: copyProcess; running: false }
Process { id: deleteProcess; running: false; onExited: win.refresh() }
}
+231
View File
@@ -0,0 +1,231 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Theme
Item {
id: clockRoot
property bool popupOpen: false
property var panelWindow: null
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uF017 " + Qt.formatDateTime(new Date(), "HH:mm d MMM")
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.mauve
verticalAlignment: Text.AlignVCenter
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: label.text = "\uF017 " + Qt.formatDateTime(new Date(), "HH:mm d MMM")
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: clockRoot.popupOpen = !clockRoot.popupOpen
}
PopupWindow {
id: popup
visible: clockRoot.popupOpen
implicitWidth: 280
implicitHeight: 320
anchor.item: clockRoot
anchor.rect: Qt.rect(0, clockRoot.height, clockRoot.width, 1)
anchor.edges: Qt.AlignTop | Qt.AlignLeft
anchor.gravity: Qt.AlignBottom | Qt.AlignRight
Rectangle {
anchors.fill: parent
color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.85)
border.color: Theme.surface1
radius: 8
ColumnLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 6
// Header: close only
RowLayout {
Layout.fillWidth: true
Item { Layout.fillWidth: true }
Text {
text: "×"
font.pixelSize: Theme.fontPixelSize + 4
font.family: Theme.fontFamily
color: Theme.subtext0
MouseArea {
anchors.fill: parent
anchors.margins: -4
onClicked: clockRoot.popupOpen = false
}
}
}
// Month navigation
RowLayout {
Layout.fillWidth: true
Layout.topMargin: 4
spacing: 4
Text {
text: "‹"
font.pixelSize: Theme.fontPixelSize + 2
font.family: Theme.fontFamily
color: Theme.subtext0
MouseArea {
anchors.fill: parent
anchors.margins: -6
onClicked: calendar.prevMonth()
}
}
Text {
Layout.fillWidth: true
text: Qt.formatDate(calendar.viewDate, "MMMM yyyy")
font.pixelSize: Theme.fontPixelSize + 1
font.family: Theme.fontFamily
color: Theme.text
horizontalAlignment: Text.AlignHCenter
}
Text {
text: "›"
font.pixelSize: Theme.fontPixelSize + 2
font.family: Theme.fontFamily
color: Theme.subtext0
MouseArea {
anchors.fill: parent
anchors.margins: -6
onClicked: calendar.nextMonth()
}
}
}
RowLayout {
Layout.fillWidth: true
Item { Layout.fillWidth: true }
Text {
text: "Today"
font.pixelSize: Theme.fontPixelSize - 2
font.family: Theme.fontFamily
color: Theme.sky
MouseArea {
anchors.fill: parent
anchors.margins: -4
onClicked: {
calendar.viewDate = new Date()
calendar.refresh()
}
}
}
Item { Layout.fillWidth: true }
}
// Day names (Mon–Sun)
RowLayout {
Layout.fillWidth: true
Repeater {
model: ["M", "T", "W", "T", "F", "S", "S"]
Text {
Layout.preferredWidth: 32
Layout.alignment: Qt.AlignHCenter
text: modelData
font.pixelSize: Theme.fontPixelSize - 2
font.family: Theme.fontFamily
color: Theme.overlay0
}
}
}
// Calendar grid
GridLayout {
id: calGrid
Layout.fillWidth: true
Layout.fillHeight: true
columns: 7
rowSpacing: 2
columnSpacing: 2
Repeater {
model: calendar.daysModel
Rectangle {
Layout.preferredWidth: 32
Layout.preferredHeight: 24
Layout.alignment: Qt.AlignHCenter
color: modelData.isToday ? Theme.surface1 : "transparent"
radius: 4
border.color: modelData.isToday ? Theme.mauve : "transparent"
border.width: 1
Text {
anchors.centerIn: parent
text: modelData.day > 0 ? modelData.day : ""
font.pixelSize: Theme.fontPixelSize - 1
font.family: Theme.fontFamily
color: modelData.isCurrentMonth ? Theme.text : Theme.overlay0
}
}
}
}
}
}
}
QtObject {
id: calendar
property date viewDate: new Date()
property var daysModel: []
function refresh() {
var d = new Date(viewDate.getFullYear(), viewDate.getMonth(), 1)
var year = d.getFullYear(), month = d.getMonth()
var firstWeekday = (d.getDay() + 6) % 7 // Mon=0
var daysInMonth = new Date(year, month + 1, 0).getDate()
var today = new Date()
var todayDate = today.getDate()
var todayMonth = today.getMonth()
var todayYear = today.getFullYear()
var list = []
var i
for (i = 0; i < firstWeekday; i++)
list.push({ day: 0, isToday: false, isCurrentMonth: false })
for (i = 1; i <= daysInMonth; i++)
list.push({
day: i,
isToday: i === todayDate && month === todayMonth && year === todayYear,
isCurrentMonth: true
})
var total = list.length
var remainder = total % 7
if (remainder) {
for (i = 0; i < 7 - remainder; i++)
list.push({ day: 0, isToday: false, isCurrentMonth: false })
}
daysModel = list
}
function prevMonth() {
viewDate = new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)
refresh()
}
function nextMonth() {
viewDate = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)
refresh()
}
Component.onCompleted: refresh()
onViewDateChanged: refresh()
}
Connections {
target: clockRoot
function onPopupOpenChanged() {
if (clockRoot.popupOpen)
calendar.viewDate = new Date()
calendar.refresh()
}
}
}
+41
View File
@@ -0,0 +1,41 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
id: root
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uE266 —%"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.rosewater
verticalAlignment: Text.AlignVCenter
}
Process {
id: process
command: ["sh", "-c", "read cpu user nice sys idle iowait irq softirq steal guest guest_nice < /proc/stat; idle1=$((idle+iowait)); nonidle1=$((user+nice+sys+irq+softirq+steal)); total1=$((idle1+nonidle1)); sleep 1; read cpu user nice sys idle iowait irq softirq steal guest guest_nice < /proc/stat; idle2=$((idle+iowait)); nonidle2=$((user+nice+sys+irq+softirq+steal)); total2=$((idle2+nonidle2)); totald=$((total2-total1)); idled=$((idle2-idle1)); [ \"$totald\" -gt 0 ] && printf '%s\\n' $(((1000*(totald-idled)/totald + 5)/10)) || printf '0\\n'"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var v = text.trim()
label.text = "\uE266 " + (v || "—") + "%"
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 2000
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,71 @@
import QtQuick
import Quickshell.Io
import qs.Theme
Row {
id: root
spacing: Theme.spacing
property ListModel workspaces: ListModel {}
Process {
id: process
command: ["sh", "-c", "hyprctl activeworkspace -j | jq .id; hyprctl workspaces -j | jq -c ."]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var lines = text.trim().split('\n');
if (lines.length < 2) return;
var activeId = parseInt(lines[0], 10);
var workspacesData = JSON.parse(lines[1]);
workspaces.clear();
workspacesData.forEach(workspace => {
workspaces.append({
"tagId": workspace.id,
"output": workspace.monitor,
"isOccupied": workspace.windows > 0,
"isActive": workspace.id === activeId,
"isUrgent": false
});
});
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 500
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
Repeater {
model: workspaces
delegate: Rectangle {
height: Theme.barHeight - 16
width: height
radius: width / 2
color: model.isActive ? Theme.mauve : (model.isOccupied ? Theme.surface1 : Theme.surface0)
border.color: model.isUrgent ? Theme.red : "transparent"
border.width: 2
Text {
anchors.centerIn: parent
text: model.tagId
color: Theme.text
font.pixelSize: Theme.fontPixelSize
}
MouseArea {
anchors.fill: parent
onClicked: {
Quickshell.execDetached(["hyprctl", "dispatch", "workspace", model.tagId]);
}
}
}
}
}
@@ -0,0 +1,41 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uF2DB —/—GB"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.rosewater
verticalAlignment: Text.AlignVCenter
}
Process {
id: process
command: ["sh", "-c", "free -g | awk '/^Mem:/ {print $3 \" \" $2}'"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var parts = text.trim().split(/\s+/)
var used = parts[0] || "—", total = parts[1] || "—"
label.text = "\uF2DB " + used + "/" + total + "GB"
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 30000
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,119 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
id: root
implicitWidth: row.implicitWidth
implicitHeight: row.implicitHeight
property string downText: "—"
property string upText: "—"
// Internal state for delta calculation
property real prevRx: 0
property real prevTx: 0
property var lastUpdate: 0
RowLayout {
id: row
anchors.fill: parent
spacing: 8
Text {
text: "\uF437"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
}
Text {
text: "\uF0AB"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
}
Text {
Layout.preferredWidth: 44
Layout.alignment: Qt.AlignVCenter
text: downText
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
}
Text {
text: "\uF0AA"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
}
Text {
Layout.preferredWidth: 44
Layout.alignment: Qt.AlignVCenter
text: upText
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.peach
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
}
}
Process {
id: process
command: ["sh", "-c", "awk 'NR>2 && $1!~/^lo:/ {rx+=$2; tx+=$10} END{print rx+0, tx+0}' /proc/net/dev"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var now = Date.now();
var parts = text.trim().split(/\s+/);
if (parts.length >= 2) {
var rx = parseInt(parts[0], 10) || 0;
var tx = parseInt(parts[1], 10) || 0;
// Only calculate speed if we have a previous data point
if (root.prevRx > 0) {
var elapsed = (now - root.lastUpdate) / 1000;
if (elapsed <= 0) elapsed = 1; // Prevent division by zero
var down = (rx - root.prevRx) / elapsed;
var up = (tx - root.prevTx) / elapsed;
function fmt(bytesPerSec) {
var bps = bytesPerSec * 8; // Convert to bits per second
if (bps >= 1e6) return (bps / 1e6).toFixed(1) + "Mb";
if (bps >= 1e3) return (bps / 1e3).toFixed(0) + "Kb";
return bps.toFixed(0) + "b";
}
root.downText = fmt(down);
root.upText = fmt(up);
}
root.prevRx = rx;
root.prevTx = tx;
root.lastUpdate = now;
}
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 2000
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,79 @@
import QtQuick
import Quickshell.Io
import qs.Theme
Row {
id: root
spacing: Theme.spacing
property ListModel workspaces: ListModel {}
Process {
id: workspaceProcess
running: true
command: ["mmsg", "-w"]
stdout: SplitParser {
onRead: line => {
parseWorkspaceLine(line);
}
}
}
function parseWorkspaceLine(line) {
const tagBinary = /^(\S+)\s+tags\s+([01]+)\s+([01]+)\s+([01]+)$/
const match = line.match(tagBinary);
if (match) {
const outputName = match[1];
const occ = match[2];
const sel = match[3];
const urg = match[4];
workspaces.clear();
for (let i = 0; i < occ.length; i++) {
const tagId = i + 1;
const charIdx = occ.length - 1 - i;
const isOccupied = occ[charIdx] === '1';
const isActive = sel[charIdx] === '1';
const isUrgent = urg[charIdx] === '1';
workspaces.append({
"tagId": tagId,
"output": outputName,
"isOccupied": isOccupied,
"isActive": isActive,
"isUrgent": isUrgent
});
}
}
}
Repeater {
model: workspaces
delegate: Rectangle {
height: Theme.barHeight - 16
width: height
radius: width / 2
color: model.isActive ? Theme.mauve : (model.isOccupied ? Theme.surface1 : Theme.surface0)
border.color: model.isUrgent ? Theme.red : "transparent"
border.width: 2
Text {
anchors.centerIn: parent
text: model.tagId
color: Theme.text
font.pixelSize: Theme.fontPixelSize
}
MouseArea {
anchors.fill: parent
onClicked: {
Quickshell.execDetached(["mmsg", "-s", "-t", model.tagId]);
}
}
}
}
}
@@ -0,0 +1,115 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Theme
FloatingWindow {
id: win
title: "Power Menu"
visible: false
implicitWidth: 820
implicitHeight: 340
color: "transparent"
property int selectedIndex: 0
property int armedIndex: -1
property bool mouseWasInside: false
readonly property var actions: [
{ name: "Lock", icon: "", hint: "hyprlock", cmd: "hyprlock", danger: false },
{ name: "Logout", icon: "󰗼", hint: "Hyprland exit", cmd: "hyprctl dispatch exit", danger: true },
{ name: "Suspend", icon: "󰤄", hint: "systemctl suspend", cmd: "systemctl suspend", danger: false },
{ name: "Reboot", icon: "󰜉", hint: "systemctl reboot", cmd: "systemctl reboot", danger: true },
{ name: "Shutdown", icon: "󰐥", hint: "systemctl poweroff", cmd: "systemctl poweroff", danger: true }
]
function clampIndex(index) { return ((index % actions.length) + actions.length) % actions.length }
function selectIndex(index) { selectedIndex = clampIndex(index); armedIndex = -1 }
function open() { mouseWasInside = false; armedIndex = -1; visible = true; keyScope.forceActiveFocus() }
function toggle() { visible = !visible; if (visible) { mouseWasInside = false; armedIndex = -1; keyScope.forceActiveFocus() } }
function runAction(index) {
const action = actions[index]
if (action.danger && armedIndex !== index) { armedIndex = index; return }
actionProcess.command = ["bash", "-lc", action.cmd]
actionProcess.running = true
visible = false
armedIndex = -1
}
IpcHandler {
target: "powerMenu"
function open() { win.open() }
function toggle() { win.toggle() }
function lock() { win.runAction(0) }
function logout() { win.runAction(1) }
function suspend() { win.runAction(2) }
function reboot() { win.runAction(3) }
function shutdown() { win.runAction(4) }
}
Item {
id: keyScope
anchors.fill: parent
focus: win.visible
Keys.onPressed: function(event) {
if (event.key === Qt.Key_Left || event.key === Qt.Key_H) { win.selectIndex(win.selectedIndex - 1); event.accepted = true }
else if (event.key === Qt.Key_Right || event.key === Qt.Key_L) { win.selectIndex(win.selectedIndex + 1); event.accepted = true }
else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) { win.runAction(win.selectedIndex); event.accepted = true }
else if (event.key === Qt.Key_Escape) { win.visible = false; event.accepted = true }
}
MouseArea { anchors.fill: parent; hoverEnabled: true; acceptedButtons: Qt.NoButton; onEntered: win.mouseWasInside = true; onExited: if (win.mouseWasInside) win.visible = false }
Rectangle { anchors.fill: parent; radius: 34; color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.13); border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.38); border.width: 1 }
Row {
id: row
anchors.centerIn: parent
spacing: 16
Repeater {
model: win.actions.length
Rectangle {
id: card
property var action: win.actions[index]
property bool selected: index === win.selectedIndex
property bool armed: index === win.armedIndex
width: selected ? 150 : 126
height: selected ? 190 : 162
radius: selected ? 28 : 24
y: selected ? -10 : 4
color: armed ? Qt.rgba(Theme.red.r, Theme.red.g, Theme.red.b, 0.28) : Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.70)
border.color: armed ? Theme.red : selected ? Theme.mauve : Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.60)
border.width: selected ? 3 : 1
antialiasing: true
Behavior on width { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
Behavior on height { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
Behavior on y { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
Behavior on border.color { ColorAnimation { duration: 100 } }
ColumnLayout {
anchors.fill: parent
anchors.margins: 14
spacing: 8
Text { Layout.alignment: Qt.AlignHCenter; text: card.action.icon; font.family: Theme.fontFamily; font.pixelSize: card.selected ? 46 : 36; color: card.armed ? Theme.red : Theme.text }
Text { Layout.alignment: Qt.AlignHCenter; text: card.action.name; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize + 2; font.bold: true; color: Theme.text }
Text { Layout.fillWidth: true; text: card.armed ? "Press Enter again" : card.action.hint; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.WordWrap; font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize - 3; color: card.armed ? Theme.red : Theme.overlay2 }
}
MouseArea { anchors.fill: parent; onClicked: { if (card.selected) win.runAction(index); else win.selectIndex(index); keyScope.forceActiveFocus() } }
}
}
}
Rectangle {
anchors.left: parent.left; anchors.right: parent.right; anchors.bottom: parent.bottom
anchors.leftMargin: 42; anchors.rightMargin: 42; anchors.bottomMargin: 22
height: 44; radius: 18
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.42)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
Text { anchors.centerIn: parent; text: "←/→ select · Enter apply" + (win.armedIndex >= 0 ? " again · Esc cancel" : " · Esc close"); font.family: Theme.fontFamily; font.pixelSize: Theme.fontPixelSize - 1; color: Theme.text }
}
}
Process { id: actionProcess; running: false }
}
@@ -0,0 +1,48 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uF0A0 —"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.text
verticalAlignment: Text.AlignVCenter
}
Process {
id: process
command: ["sh", "-c", "df -h -P -l / | awk 'NR==2 {gsub(/%/,\"\",$5); print $5 \" \" $4}'"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var parts = text.trim().split(/\s+/)
var pct = parts[0] || "—"
var avail = parts[1] || ""
label.text = "\uF0A0 " + (avail ? avail : pct + "%")
var n = parseInt(pct, 10)
if (!isNaN(n)) {
if (n >= 90) label.color = Theme.red
else if (n >= 80) label.color = Theme.yellow
else label.color = Theme.text
}
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 60000
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,42 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Theme
Item {
id: root
property string hwmonPath: "" // e.g. /sys/class/hwmon/hwmon2/temp1_input
implicitWidth: label.implicitWidth
implicitHeight: label.implicitHeight
Text {
id: label
text: "\uF2C8 —°C"
font.pixelSize: Theme.fontPixelSize
font.family: Theme.fontFamily
color: Theme.rosewater
verticalAlignment: Text.AlignVCenter
}
Process {
id: process
command: root.hwmonPath ? ["bash", "/home/johannes/.config/quickshell/scripts/cpu-temp.sh", root.hwmonPath] : ["bash", "/home/johannes/.config/quickshell/scripts/cpu-temp.sh"]
running: false
stdout: StdioCollector {
onStreamFinished: function() {
var v = text.trim()
label.text = "\uF2C8 " + (v ? v + "°C" : "—°C")
}
}
onExited: restartTimer.start()
}
Timer {
id: restartTimer
interval: 4000
repeat: false
onTriggered: process.running = true
}
Component.onCompleted: process.running = true
}
@@ -0,0 +1,383 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Theme
FloatingWindow {
id: win
title: "Theme Switcher"
visible: false
implicitWidth: 920
implicitHeight: 460
color: "transparent"
property string scriptsDir: Quickshell.env("HOME") + "/.config/nushell/scripts"
property string currentTheme: "—"
property int selectedIndex: currentTheme === "latte" ? 2 : currentTheme === "mocha" ? 1 : 0
property bool mouseWasInside: false
readonly property var modes: ["auto", "mocha", "latte"]
readonly property var names: ["Auto", "Mocha", "Latte"]
readonly property var subtitles: ["Follow darkman / system", "Catppuccin dark", "Catppuccin light"]
function clampIndex(index) {
return ((index % modes.length) + modes.length) % modes.length
}
function selectIndex(index) {
selectedIndex = clampIndex(index)
}
function selectedMode() {
return modes[selectedIndex]
}
function selectedName() {
return names[selectedIndex]
}
function modeForOffset(offset) {
return modes[clampIndex(selectedIndex + offset)]
}
function nameForMode(mode) {
const idx = modes.indexOf(mode)
return idx >= 0 ? names[idx] : mode
}
function subtitleForMode(mode) {
const idx = modes.indexOf(mode)
return idx >= 0 ? subtitles[idx] : ""
}
function open() {
mouseWasInside = false
visible = true
refresh()
keyScope.forceActiveFocus()
}
function toggle() {
visible = !visible
if (visible) {
mouseWasInside = false
refresh()
keyScope.forceActiveFocus()
}
}
function refresh() { themeState.running = true }
function runTheme(mode) {
themeApply.command = [scriptsDir + "/theme-switch.nu", "--" + mode]
themeApply.running = true
visible = false
}
function applySelected() {
runTheme(selectedMode())
}
IpcHandler {
target: "themeSwitcher"
function open() { win.open() }
function toggle() { win.toggle() }
function autoTheme() { win.runTheme("auto") }
function mocha() { win.runTheme("mocha") }
function latte() { win.runTheme("latte") }
}
Item {
id: keyScope
anchors.fill: parent
focus: win.visible
Keys.onPressed: function(event) {
if (event.key === Qt.Key_Left || event.key === Qt.Key_H) {
win.selectIndex(win.selectedIndex - 1)
event.accepted = true
} else if (event.key === Qt.Key_Right || event.key === Qt.Key_L) {
win.selectIndex(win.selectedIndex + 1)
event.accepted = true
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) {
win.applySelected()
event.accepted = true
} else if (event.key === Qt.Key_Escape) {
win.visible = false
event.accepted = true
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
onEntered: win.mouseWasInside = true
onExited: if (win.mouseWasInside) win.visible = false
}
Rectangle {
anchors.fill: parent
radius: 34
color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.13)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.38)
border.width: 1
}
Item {
id: carousel
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 24
anchors.bottomMargin: 76
clip: false
Repeater {
model: [-1, 0, 1]
ThemeCard {
id: card
property int offset: modelData
property string mode: win.modeForOffset(offset)
property bool centered: offset === 0
width: centered ? 430 : 330
height: centered ? 300 : 230
x: carousel.width / 2 - width / 2 + offset * 260
y: carousel.height / 2 - height / 2
z: centered ? 20 : 10
modeName: win.nameForMode(mode)
subtitle: win.subtitleForMode(mode)
themeMode: mode
active: mode === win.currentTheme
selected: centered
Behavior on x { NumberAnimation { duration: 140; easing.type: Easing.OutCubic } }
Behavior on y { NumberAnimation { duration: 140; easing.type: Easing.OutCubic } }
Behavior on width { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
Behavior on height { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
onClicked: {
if (centered) win.applySelected()
else win.selectIndex(win.selectedIndex + offset)
keyScope.forceActiveFocus()
}
}
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.leftMargin: 42
anchors.rightMargin: 42
anchors.bottomMargin: 22
height: 48
radius: 20
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.42)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
RowLayout {
anchors.fill: parent
anchors.leftMargin: 14
anchors.rightMargin: 14
spacing: 12
Text {
Layout.fillWidth: true
text: win.selectedName() + " · Current: " + win.currentTheme
elide: Text.ElideMiddle
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize
color: Theme.text
}
Text {
text: (win.selectedIndex + 1) + " / 3 · ←/→ select · Enter apply · Esc"
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize - 2
color: Theme.overlay2
}
}
}
}
component ThemeCard: Rectangle {
id: card
property string modeName: ""
property string subtitle: ""
property string themeMode: "mocha"
property bool active: false
property bool selected: false
signal clicked()
radius: selected ? 30 : 26
color: card.themeMode === "latte" ? "#eff1f5" : card.themeMode === "mocha" ? "#1e1e2e" : Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.88)
border.color: selected ? Theme.mauve : active ? Theme.green : Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.65)
border.width: selected ? 3 : 1
opacity: selected ? 1.0 : 0.86
antialiasing: true
property color fg: themeMode === "latte" ? "#4c4f69" : "#cdd6f4"
property color sub: themeMode === "latte" ? "#6c6f85" : "#bac2de"
property color base: themeMode === "latte" ? "#eff1f5" : "#1e1e2e"
property color crust: themeMode === "latte" ? "#dce0e8" : "#11111b"
property color surface: themeMode === "latte" ? "#ccd0da" : "#313244"
property color accent: themeMode === "latte" ? "#8839ef" : "#cba6f7"
property color blue: themeMode === "latte" ? "#1e66f5" : "#89b4fa"
property color green: themeMode === "latte" ? "#40a02b" : "#a6e3a1"
property color peach: themeMode === "latte" ? "#fe640b" : "#fab387"
property int dotSize: selected ? 28 : 18
property int dotGap: selected ? 8 : 5
Behavior on opacity { NumberAnimation { duration: 120; easing.type: Easing.OutCubic } }
Behavior on border.color { ColorAnimation { duration: 100 } }
Rectangle {
anchors.fill: parent
anchors.margins: 12
radius: card.radius - 8
color: Qt.rgba(card.crust.r, card.crust.g, card.crust.b, 0.72)
border.color: Qt.rgba(card.surface.r, card.surface.g, card.surface.b, 0.88)
ColumnLayout {
anchors.fill: parent
anchors.margins: card.selected ? 18 : 14
spacing: card.selected ? 12 : 9
RowLayout {
Layout.fillWidth: true
spacing: 10
Text {
Layout.fillWidth: true
text: card.modeName
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize + (card.selected ? 8 : 3)
font.bold: true
color: card.fg
}
Rectangle {
visible: card.active
width: 34
height: 34
radius: 17
color: Qt.rgba(card.green.r, card.green.g, card.green.b, 0.92)
Text {
anchors.centerIn: parent
text: "✓"
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize + 2
color: card.base
}
}
}
Text {
text: card.subtitle
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize - 1
color: card.sub
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
Rectangle {
anchors.fill: parent
radius: 18
color: card.base
border.color: card.surface
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: 12
width: parent.width * 0.24
radius: 13
color: card.crust
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 12
height: 26
radius: 13
color: card.surface
}
Column {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: parent.width * 0.32
anchors.rightMargin: 16
anchors.topMargin: 52
anchors.bottomMargin: 16
spacing: 10
Rectangle { width: parent.width * 0.78; height: 18; radius: 9; color: card.accent }
Rectangle { width: parent.width; height: 16; radius: 8; color: card.surface }
Rectangle { width: parent.width * 0.64; height: 16; radius: 8; color: card.surface }
}
Row {
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.rightMargin: 16
anchors.bottomMargin: card.selected ? 16 : 30
spacing: card.dotGap
Rectangle { width: card.dotSize; height: card.dotSize; radius: card.dotSize / 2; color: card.accent }
Rectangle { width: card.dotSize; height: card.dotSize; radius: card.dotSize / 2; color: card.blue }
Rectangle { width: card.dotSize; height: card.dotSize; radius: card.dotSize / 2; color: card.green }
Rectangle { width: card.dotSize; height: card.dotSize; radius: card.dotSize / 2; color: card.peach }
}
Rectangle {
visible: card.themeMode === "auto"
anchors.fill: parent
radius: 18
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "#eff1f5" }
GradientStop { position: 0.48; color: "#eff1f5" }
GradientStop { position: 0.52; color: "#1e1e2e" }
GradientStop { position: 1.0; color: "#1e1e2e" }
}
opacity: 0.28
}
}
}
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: card.clicked()
}
}
Process { id: themeApply; running: false; onExited: win.refresh() }
Process {
id: themeState
command: ["sh", "-c", "cat ~/.config/current-theme 2>/dev/null || echo unknown"]
running: false
stdout: StdioCollector {
onStreamFinished: {
win.currentTheme = text.trim()
win.selectedIndex = win.currentTheme === "latte" ? 2 : win.currentTheme === "mocha" ? 1 : win.selectedIndex
}
}
}
}
+58
View File
@@ -0,0 +1,58 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.SystemTray
import qs.Theme
Item {
id: root
property var panelWindow: null
implicitWidth: trayRow.implicitWidth
implicitHeight: trayRow.implicitHeight
RowLayout {
id: trayRow
anchors.fill: parent
spacing: 4
Repeater {
model: SystemTray.items
delegate: Item {
Layout.preferredWidth: 24
Layout.preferredHeight: 24
Layout.alignment: Qt.AlignVCenter
Image {
id: icon
anchors.centerIn: parent
width: 20
height: 20
source: modelData.icon || ""
sourceSize: Qt.size(width, height)
smooth: true
mipmap: true
visible: !!modelData.icon
}
MouseArea {
id: ma
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: function(mouse) {
if (mouse.button === Qt.LeftButton)
modelData.activate()
else if (mouse.button === Qt.RightButton && root.panelWindow) {
var p = ma.mapToItem(root.panelWindow.contentItem, mouse.x, mouse.y)
modelData.display(root.panelWindow, p.x, p.y)
} else if (mouse.button === Qt.MiddleButton)
modelData.secondaryActivate()
}
onWheel: function(wheel) {
modelData.scroll(wheel.angleDelta.y, false)
}
}
}
}
}
}
@@ -0,0 +1,285 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets as QSW
import Quickshell.Io
import qs.Theme
FloatingWindow {
id: win
title: "Wallpaper Switcher"
visible: false
implicitWidth: 1120
implicitHeight: 520
color: "transparent"
property string scriptsDir: Quickshell.env("HOME") + "/.config/nushell/scripts"
property var wallpapers: []
property string currentWallpaper: "—"
property int selectedIndex: 0
property string selectedWallpaper: wallpapers.length > 0 ? wallpapers[selectedIndex] : ""
readonly property int cellWidth: 520
property bool mouseWasInside: false
function fileUrl(path) {
if (!path || path === "—") return ""
return "file://" + path
}
function clampIndex(index) {
if (wallpapers.length === 0) return 0
return ((index % wallpapers.length) + wallpapers.length) % wallpapers.length
}
function selectIndex(index) {
if (wallpapers.length === 0) return
selectedIndex = clampIndex(index)
}
function selectPath(path) {
const idx = wallpapers.indexOf(path)
if (idx >= 0) selectIndex(idx)
}
function open() {
mouseWasInside = false
visible = true
refresh()
keyScope.forceActiveFocus()
}
function toggle() {
visible = !visible
if (visible) {
mouseWasInside = false
refresh()
keyScope.forceActiveFocus()
}
}
function refresh() {
wallpaperState.running = true
wallpaperList.running = true
}
function applySelected() {
if (selectedWallpaper) runWallpaper(["--set", selectedWallpaper])
}
function runWallpaper(args) {
wallpaperApply.command = [scriptsDir + "/wallpaper-switch.nu"].concat(args)
wallpaperApply.running = true
}
IpcHandler {
target: "wallpaperSwitcher"
function open() { win.open() }
function toggle() { win.toggle() }
function random() { win.runWallpaper(["--random"]) }
}
Item {
id: keyScope
anchors.fill: parent
focus: win.visible
Keys.onPressed: function(event) {
if (event.key === Qt.Key_Left || event.key === Qt.Key_H) {
win.selectIndex(win.selectedIndex - 1)
event.accepted = true
} else if (event.key === Qt.Key_Right || event.key === Qt.Key_L) {
win.selectIndex(win.selectedIndex + 1)
event.accepted = true
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter || event.key === Qt.Key_Space) {
win.applySelected()
event.accepted = true
} else if (event.key === Qt.Key_Escape) {
win.visible = false
event.accepted = true
} else if (event.key === Qt.Key_R) {
win.runWallpaper(["--random"])
event.accepted = true
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
onEntered: win.mouseWasInside = true
onExited: if (win.mouseWasInside) win.visible = false
}
// Transparent glass layer: Hyprland blur handles the background behind this window.
Rectangle {
anchors.fill: parent
radius: 34
color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.13)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.38)
border.width: 1
}
Item {
id: carousel
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 24
anchors.bottomMargin: 70
clip: false
function pathForOffset(offset) {
if (win.wallpapers.length === 0) return ""
return win.wallpapers[win.clampIndex(win.selectedIndex + offset)]
}
Repeater {
model: [-1, 0, 1]
Item {
id: cell
property int offset: modelData
property bool centered: offset === 0
property string wallpaperPath: carousel.pathForOffset(offset)
property bool current: wallpaperPath === win.currentWallpaper
width: centered ? 610 : 500
height: centered ? 390 : 320
x: carousel.width / 2 - width / 2 + offset * 300
y: carousel.height / 2 - height / 2
z: centered ? 20 : 10
Behavior on x { NumberAnimation { duration: 140; easing.type: Easing.OutCubic } }
Behavior on y { NumberAnimation { duration: 140; easing.type: Easing.OutCubic } }
Behavior on width { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
Behavior on height { NumberAnimation { duration: 130; easing.type: Easing.OutCubic } }
QSW.ClippingRectangle {
id: card
anchors.fill: parent
radius: centered ? 30 : 26
color: Theme.crust
border.color: centered ? Theme.mauve : Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.55)
border.width: centered ? 3 : 1
antialiasing: true
contentUnderBorder: true
contentInsideBorder: false
Behavior on border.color { ColorAnimation { duration: 100 } }
Image {
anchors.fill: parent
source: win.fileUrl(cell.wallpaperPath)
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: true
retainWhileLoading: true
smooth: true
mipmap: true
}
Rectangle {
visible: cell.current
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 16
width: 36
height: 36
radius: 18
color: Qt.rgba(Theme.green.r, Theme.green.g, Theme.green.b, 0.92)
Text {
anchors.centerIn: parent
text: "✓"
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize + 3
color: Theme.base
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
if (cell.centered) win.applySelected()
else win.selectIndex(win.selectedIndex + cell.offset)
keyScope.forceActiveFocus()
}
}
}
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.leftMargin: 42
anchors.rightMargin: 42
anchors.bottomMargin: 22
height: 48
radius: 20
color: Qt.rgba(Theme.crust.r, Theme.crust.g, Theme.crust.b, 0.42)
border.color: Qt.rgba(Theme.surface1.r, Theme.surface1.g, Theme.surface1.b, 0.45)
RowLayout {
anchors.fill: parent
anchors.leftMargin: 14
anchors.rightMargin: 14
spacing: 12
Text {
Layout.fillWidth: true
text: win.selectedWallpaper ? win.selectedWallpaper.split('/').pop() : "No wallpapers found"
elide: Text.ElideMiddle
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize
color: Theme.text
}
Text {
text: (win.wallpapers.length > 0 ? (win.selectedIndex + 1) + " / " + win.wallpapers.length + " · " : "") + "←/→ · Enter apply · R random · Esc"
font.family: Theme.fontFamily
font.pixelSize: Theme.fontPixelSize - 2
color: Theme.overlay2
}
}
}
}
Process {
id: wallpaperApply
running: false
onExited: win.refresh()
}
Process {
id: wallpaperState
command: [scriptsDir + "/wallpaper-switch.nu", "--current"]
running: false
stdout: StdioCollector {
onStreamFinished: {
win.currentWallpaper = text.trim() || "—"
if (win.wallpapers.length > 0) win.selectPath(win.currentWallpaper)
}
}
}
Process {
id: wallpaperList
command: [scriptsDir + "/wallpaper-switch.nu", "--list"]
running: false
stdout: StdioCollector {
onStreamFinished: {
try {
const oldSelection = win.selectedWallpaper
win.wallpapers = JSON.parse(text.trim())
win.selectedIndex = win.clampIndex(win.selectedIndex)
if (oldSelection && win.wallpapers.indexOf(oldSelection) >= 0) win.selectPath(oldSelection)
else win.selectPath(win.currentWallpaper)
} catch (e) {
win.wallpapers = []
win.selectedIndex = 0
}
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
module Widgets
Clock 1.0 Clock.qml
CpuWidget 1.0 CpuWidget.qml
MemoryWidget 1.0 MemoryWidget.qml
NetTrafficWidget 1.0 NetTrafficWidget.qml
StorageWidget 1.0 StorageWidget.qml
TemperatureWidget 1.0 TemperatureWidget.qml
AudioWidget 1.0 AudioWidget.qml
TrayWidget 1.0 TrayWidget.qml
NiriWorkspaceWidget 1.0 NiriWorkspaceWidget.qml
HyprlandWorkspaceWidget 1.0 HyprlandWorkspaceWidget.qml
ThemeSwitcherWindow 1.0 ThemeSwitcherWindow.qml
WallpaperSwitcherWindow 1.0 WallpaperSwitcherWindow.qml
PowerMenuWindow 1.0 PowerMenuWindow.qml
ClipboardPickerWindow 1.0 ClipboardPickerWindow.qml
AppLauncherWindow 1.0 AppLauncherWindow.qml
+82
View File
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
set -u
read_temp() {
local sensor=$1
[ -n "$sensor" ] || return 1
[ -f "$sensor" ] || return 1
awk '{print int(($1 + 500) / 1000)}' "$sensor" 2>/dev/null
}
pick_sensor() {
local d name f label_file label
local sensor=""
local cpu_like=""
local k10=""
local any=""
for d in /sys/class/hwmon/hwmon* /sys/devices/platform/coretemp.0/hwmon/hwmon*; do
[ -f "$d/name" ] || continue
name=$(<"$d/name")
for f in "$d"/temp*_input; do
[ -f "$f" ] || continue
[ -n "$any" ] || any="$f"
label_file=${f%_input}_label
label=""
[ -f "$label_file" ] && label=$(<"$label_file")
case "$label" in
Package\ id*|Tdie*|SoC\ Temperature*)
printf '%s\n' "$f"
return 0
;;
esac
case "$label" in
*[Cc][Pp][Uu]*)
[ -n "$cpu_like" ] || cpu_like="$f"
;;
esac
case "$name" in
*cpu*|*CPU*)
[ -n "$cpu_like" ] || cpu_like="$f"
;;
k10temp)
[ -n "$k10" ] || k10="$f"
;;
esac
done
done
sensor=${cpu_like:-${k10:-$any}}
if [ -n "$sensor" ]; then
printf '%s\n' "$sensor"
return 0
fi
for d in /sys/class/thermal/thermal_zone*; do
[ -f "$d/temp" ] || continue
printf '%s\n' "$d/temp"
return 0
done
return 1
}
main() {
local sensor=${1:-}
if [ -n "$sensor" ]; then
read_temp "$sensor"
return
fi
sensor=$(pick_sensor) || exit 0
read_temp "$sensor"
}
main "$@"
+44
View File
@@ -0,0 +1,44 @@
//@ pragma UseQApplication
//@ pragma Env QT_QPA_PLATFORM=wayland
import QtQuick
import Quickshell
import qs.Bar
import qs.Widgets
ShellRoot {
id: root
property var barInstances: []
Component {
id: barComponent
Bar {}
}
function updateBars() {
for (var i = 0; i < barInstances.length; i++)
barInstances[i].destroy()
barInstances = []
var screens = Quickshell.screens
if (screens.length === 0) {
var bar = barComponent.createObject(root, {})
if (bar) barInstances.push(bar)
} else {
for (var i = 0; i < screens.length; i++) {
var bar = barComponent.createObject(root, { screen: screens[i] })
if (bar) barInstances.push(bar)
}
}
}
ThemeSwitcherWindow {}
WallpaperSwitcherWindow {}
PowerMenuWindow {}
ClipboardPickerWindow {}
AppLauncherWindow {}
Component.onCompleted: {
Quickshell.watchFiles = true
Qt.callLater(updateBars)
}
Connections {
target: Quickshell
function onScreensChanged() { updateBars() }
}
}
+61
View File
@@ -0,0 +1,61 @@
"$schema" = 'https://starship.rs/config-schema.json'
add_newline = false
format = """
$nix_shell\
$directory\
${custom.git}\
${custom.jj}\
$cmd_duration\
$line_break\
$character"""
[character]
success_symbol = "❯(yellow)"
error_symbol = "❯(yellow)"
[git_status]
disabled = true
[git_branch]
disabled = true
[custom.git]
when = "jj root >/dev/null 2>&1 && exit 1 || git rev-parse --is-inside-work-tree >/dev/null 2>&1"
command = "starship module git_branch && starship module git_status"
shell = ["sh", "--norc", "--noprofile"]
style = "bold purple"
[custom.jj]
description = "The current jj status"
when = "jj root >/dev/null 2>&1"
symbol = " "
style = "bold blue"
shell = ["sh", "--norc", "--noprofile"]
command = '''
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
separate(" ",
change_id.shortest(4),
bookmarks,
"|",
concat(
if(conflict, "💥"),
if(divergent, "🚧"),
if(hidden, "👻"),
if(immutable, "🔒"),
),
raw_escape_sequence("\x1b[1;32m") ++ if(empty, "(empty)"),
raw_escape_sequence("\x1b[1;32m") ++ coalesce(
truncate_end(29, description.first_line(), "…"),
"(no description set)",
) ++ raw_escape_sequence("\x1b[0m"),
)
'
'''
[directory]
truncation_length = 4
style = "bold cyan"
@@ -0,0 +1 @@
catppuccin-latte-mauve-standard+default
+77
View File
@@ -0,0 +1,77 @@
$rosewater = rgb(dc8a78)
$rosewaterAlpha = dc8a78
$flamingo = rgb(dd7878)
$flamingoAlpha = dd7878
$pink = rgb(ea76cb)
$pinkAlpha = ea76cb
$mauve = rgb(8839ef)
$mauveAlpha = 8839ef
$red = rgb(d20f39)
$redAlpha = d20f39
$maroon = rgb(e64553)
$maroonAlpha = e64553
$peach = rgb(fe640b)
$peachAlpha = fe640b
$yellow = rgb(df8e1d)
$yellowAlpha = df8e1d
$green = rgb(40a02b)
$greenAlpha = 40a02b
$teal = rgb(179299)
$tealAlpha = 179299
$sky = rgb(04a5e5)
$skyAlpha = 04a5e5
$sapphire = rgb(209fb5)
$sapphireAlpha = 209fb5
$blue = rgb(1e66f5)
$blueAlpha = 1e66f5
$lavender = rgb(7287fd)
$lavenderAlpha = 7287fd
$text = rgb(4c4f69)
$textAlpha = 4c4f69
$subtext1 = rgb(5c5f77)
$subtext1Alpha = 5c5f77
$subtext0 = rgb(6c6f85)
$subtext0Alpha = 6c6f85
$overlay2 = rgb(7c7f93)
$overlay2Alpha = 7c7f93
$overlay1 = rgb(8c8fa1)
$overlay1Alpha = 8c8fa1
$overlay0 = rgb(9ca0b0)
$overlay0Alpha = 9ca0b0
$surface2 = rgb(acb0be)
$surface2Alpha = acb0be
$surface1 = rgb(bcc0cc)
$surface1Alpha = bcc0cc
$surface0 = rgb(ccd0da)
$surface0Alpha = ccd0da
$base = rgb(eff1f5)
$baseAlpha = eff1f5
$mantle = rgb(e6e9ef)
$mantleAlpha = e6e9ef
$crust = rgb(dce0e8)
$crustAlpha = dce0e8
+7
View File
@@ -0,0 +1,7 @@
background-color=#eff1f5
text-color=#4c4f69
border-color=#8839ef
progress-color=over #ccd0da
[urgency=high]
border-color=#d20f39
@@ -0,0 +1,36 @@
pragma Singleton
import QtQuick
QtObject {
// Catppuccin Latte
property color base: "#eff1f5"
property color mantle: "#e6e9ef"
property color crust: "#dce0e8"
property color surface0: "#ccd0da"
property color surface1: "#bcc0cc"
property color surface2: "#acb0be"
property color overlay0: "#9ca0b0"
property color overlay1: "#8c8fa1"
property color overlay2: "#7c7f93"
property color text: "#4c4f69"
property color subtext0: "#6c6f85"
property color subtext1: "#5c5f77"
property color mauve: "#8839ef"
property color flamingo: "#dd7878"
property color peach: "#fe640b"
property color sky: "#04a5e5"
property color green: "#40a02b"
property color yellow: "#df8e1d"
property color red: "#d20f39"
property color rosewater: "#dc8a78"
property real barHeight: 36
property real padding: 10
property real spacing: 10
property real fontPixelSize: 14
property string fontFamily: "Fira Code Nerd Font"
property real sectionRadius: 14
property real sectionPadding: 12
property real barMargin: 16
property real widgetSpacing: 8
}
+61
View File
@@ -0,0 +1,61 @@
/* Catppuccin Latte + Mauve */
* {
all: unset;
font-family: "Inter", "JetBrainsMono Nerd Font", "Noto Sans", sans-serif;
font-size: 14px;
}
window {
background: rgba(220, 224, 232, 0.94);
color: #4c4f69;
border-radius: 18px;
border: 1px solid rgba(136, 57, 239, 0.28);
padding: 12px;
box-shadow: 0 18px 50px rgba(76, 79, 105, 0.22);
margin-left: auto;
margin-right: auto;
margin-top: auto;
margin-bottom: auto;
}
#outer-box { padding: 6px; }
#input {
background: rgba(230, 233, 239, 0.96);
color: #4c4f69;
border-radius: 14px;
padding: 10px 12px;
border: 1px solid rgba(188, 192, 204, 0.95);
margin: 6px 6px 10px 6px;
}
#input:focus {
border: 1px solid rgba(136, 57, 239, 0.75);
box-shadow: 0 0 0 3px rgba(136, 57, 239, 0.14);
}
#prompt { color: #8839ef; margin-right: 8px; }
#scroll { margin: 0 4px 4px 4px; }
#entry {
border-radius: 14px;
padding: 10px 10px;
margin: 4px 2px;
background: transparent;
}
#entry image { margin-right: 10px; opacity: 0.95; }
#entry #text { color: #5c5f77; }
#entry:selected {
background: rgba(204, 208, 218, 0.95);
border: 1px solid rgba(136, 57, 239, 0.55);
}
#entry:selected #text { color: #4c4f69; }
#entry:hover { background: rgba(204, 208, 218, 0.65); }
#entry:selected #text, #entry:selected image { opacity: 1; }
#text { margin-left: 2px; }
#inner-box { padding: 2px; }
#img { border-radius: 10px; }
@@ -0,0 +1 @@
catppuccin-mocha-mauve-standard+default
+77
View File
@@ -0,0 +1,77 @@
$rosewater = rgb(f5e0dc)
$rosewaterAlpha = f5e0dc
$flamingo = rgb(f2cdcd)
$flamingoAlpha = f2cdcd
$pink = rgb(f5c2e7)
$pinkAlpha = f5c2e7
$mauve = rgb(cba6f7)
$mauveAlpha = cba6f7
$red = rgb(f38ba8)
$redAlpha = f38ba8
$maroon = rgb(eba0ac)
$maroonAlpha = eba0ac
$peach = rgb(fab387)
$peachAlpha = fab387
$yellow = rgb(f9e2af)
$yellowAlpha = f9e2af
$green = rgb(a6e3a1)
$greenAlpha = a6e3a1
$teal = rgb(94e2d5)
$tealAlpha = 94e2d5
$sky = rgb(89dceb)
$skyAlpha = 89dceb
$sapphire = rgb(74c7ec)
$sapphireAlpha = 74c7ec
$blue = rgb(89b4fa)
$blueAlpha = 89b4fa
$lavender = rgb(b4befe)
$lavenderAlpha = b4befe
$text = rgb(cdd6f4)
$textAlpha = cdd6f4
$subtext1 = rgb(bac2de)
$subtext1Alpha = bac2de
$subtext0 = rgb(a6adc8)
$subtext0Alpha = a6adc8
$overlay2 = rgb(9399b2)
$overlay2Alpha = 9399b2
$overlay1 = rgb(7f849c)
$overlay1Alpha = 7f849c
$overlay0 = rgb(6c7086)
$overlay0Alpha = 6c7086
$surface2 = rgb(585b70)
$surface2Alpha = 585b70
$surface1 = rgb(45475a)
$surface1Alpha = 45475a
$surface0 = rgb(313244)
$surface0Alpha = 313244
$base = rgb(1e1e2e)
$baseAlpha = 1e1e2e
$mantle = rgb(181825)
$mantleAlpha = 181825
$crust = rgb(11111b)
$crustAlpha = 11111b
+7
View File
@@ -0,0 +1,7 @@
background-color=#1e1e2e
text-color=#cdd6f4
border-color=#cba6f7
progress-color=over #313244
[urgency=high]
border-color=#f38ba8
@@ -0,0 +1,36 @@
pragma Singleton
import QtQuick
QtObject {
// Catppuccin Mocha
property color base: "#1e1e2e"
property color mantle: "#181825"
property color crust: "#11111b"
property color surface0: "#313244"
property color surface1: "#45475a"
property color surface2: "#585b70"
property color overlay0: "#6c7086"
property color overlay1: "#7f849c"
property color overlay2: "#9399b2"
property color text: "#cdd6f4"
property color subtext0: "#a6adc8"
property color subtext1: "#bac2de"
property color mauve: "#cba6f7"
property color flamingo: "#f2cdcd"
property color peach: "#fab387"
property color sky: "#89dceb"
property color green: "#a6e3a1"
property color yellow: "#f9e2af"
property color red: "#f38ba8"
property color rosewater: "#f5e0dc"
property real barHeight: 36
property real padding: 10
property real spacing: 10
property real fontPixelSize: 14
property string fontFamily: "Fira Code Nerd Font"
property real sectionRadius: 14
property real sectionPadding: 12
property real barMargin: 16
property real widgetSpacing: 8
}
+61
View File
@@ -0,0 +1,61 @@
/* Catppuccin Mocha + Mauve */
* {
all: unset;
font-family: "Inter", "JetBrainsMono Nerd Font", "Noto Sans", sans-serif;
font-size: 14px;
}
window {
background: rgba(17, 17, 27, 0.92);
color: #cdd6f4;
border-radius: 18px;
border: 1px solid rgba(203, 166, 247, 0.25);
padding: 12px;
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
margin-left: auto;
margin-right: auto;
margin-top: auto;
margin-bottom: auto;
}
#outer-box { padding: 6px; }
#input {
background: rgba(24, 24, 37, 0.95);
color: #cdd6f4;
border-radius: 14px;
padding: 10px 12px;
border: 1px solid rgba(69, 71, 90, 0.9);
margin: 6px 6px 10px 6px;
}
#input:focus {
border: 1px solid rgba(203, 166, 247, 0.75);
box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.16);
}
#prompt { color: #cba6f7; margin-right: 8px; }
#scroll { margin: 0 4px 4px 4px; }
#entry {
border-radius: 14px;
padding: 10px 10px;
margin: 4px 2px;
background: transparent;
}
#entry image { margin-right: 10px; opacity: 0.95; }
#entry #text { color: #bac2de; }
#entry:selected {
background: rgba(49, 50, 68, 0.95);
border: 1px solid rgba(203, 166, 247, 0.55);
}
#entry:selected #text { color: #cdd6f4; }
#entry:hover { background: rgba(49, 50, 68, 0.65); }
#entry:selected #text, #entry:selected image { opacity: 1; }
#text { margin-left: 2px; }
#inner-box { padding: 2px; }
#img { border-radius: 10px; }
+337
View File
@@ -0,0 +1,337 @@
{
// -------------------------------------------------------------------------
// Global configuration
// -------------------------------------------------------------------------
"layer": "top",
"position": "top",
//"height": 20,
"margin-left": 10,
"margin-bottom": 0,
"margin-right": 10,
"spacing": 5, // Gaps between modules (4px)
"modules-left": [
//"custom/rofi",
"hyprland/workspaces",
//"hyprland/submap",
//"temperature",
//"idle_inhibitor",
//"mpd"
"custom/spotify"
],
"modules-center": [
//"hyprland/window"
"clock#date",
"custom/weather"
//"custom/gammastep"
],
"modules-right": [
"backlight",
"custom/storage",
"memory",
"cpu",
"temperature",
"battery",
//"pulseaudio",
"wireplumber",
"tray",
],
// -------------------------------------------------------------------------
// Modules
// -------------------------------------------------------------------------
"custom/sp1": {
"format": " | ",
"tooltip": false
},
"custom/sp2": {
"format": " |",
"tooltip": false
},
"custom/rofi": {
"format": "",
"tooltip": false,
"on-click-right": "nwg-drawer",
"on-click": "wofi --show run",
"on-click-middle": "pkill -9 wofi"
},
"custom/screenshot_t": {
"format": " ",
"on-click": "~/.config/hypr/scripts/screenshot_full",
"on-click-right": "~/.config/hypr/scripts/screenshot_area"
},
"clock#1": {
"format": " {:%a}",
"tooltip": false,
"on-click": "gsimplecal"
},
"clock#2": {
"format": " {:%d-%h-%Y}",
"tooltip": false,
"on-click": "gsimplecal"
},
"clock#3": {
"format": " {:%H:%M:%S %p}",
"tooltip": false,
"on-click": "gsimplecal"
},
"temperature": {
// "thermal-zone": 1,
"interval": 4,
"hwmon-path": "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": " {temperatureC}°C",
"format-critical": " {temperatureC}°C",
"format": "{icon} {temperatureC}°C",
"format-icons": [
"",
"",
""
],
"max-length": 7,
"min-length": 7,
"on-click": "xsensors"
},
"memory": {
"interval": 30,
"format": " {used:0.2f} / {total:0.0f} GB",
"on-click": "alacritty -e btop"
},
"battery": {
"interval": 2,
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-icons": [
"",
"",
"",
"",
""
]
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ",
"format": "",
"format-disconnected": "",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"on-click": "wl-copy $(ip address show up scope global | grep inet | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c5-)",
"on-click-right": "wl-copy $(ip address show up scope global | grep inet6 | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c6-)",
"tooltip-format": " {bandwidthUpBits}  {bandwidthDownBits}\n{ifname}\n{ipaddr}/{cidr}\n",
"tooltip-format-wifi": " {essid} {frequency}MHz\nStrength: {signaldBm}dBm ({signalStrength}%)\nIP: {ipaddr}/{cidr}\n {bandwidthUpBits}  {bandwidthDownBits}",
"interval": 10
},
"custom/storage": {
"format": " {}",
"format-alt": "{percentage}% ",
"format-alt-click": "click-right",
"return-type": "json",
"interval": 60,
"exec": "~/.config/waybar/modules/storage.sh"
},
"backlight": {
"device": "intel_backlight",
"format": "{icon} {percent}%",
"format-alt": "{percent}% {icon}",
"format-alt-click": "click-right",
//"format-icons": ["", ""],
"format-icons": [
"",
""
],
"on-scroll-down": "brightnessctl s 5%-",
"on-scroll-up": "brightnessctl s +5%"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
},
"tooltip": "true"
},
"custom/weather": {
"format": "{}",
"format-alt": "{alt}: {}",
"format-alt-click": "click-right",
"interval": 3600,
"exec": "curl -s 'https://wttr.in/?format=1'",
//"return-type": "json",
//"exec": "~/.config/waybar/modules/weather.sh",
"exec-if": "ping wttr.in -c1"
},
"custom/pacman": {
"format": "<big>􏆲</big> {}",
"interval": 3600, // every hour
"exec": "checkupdates | wc -l", // # of updates
"exec-if": "exit 0", // always run; consider advanced run conditions
"on-click": "alacritty -e 'paru'; pkill -SIGRTMIN+8 waybar", // update system
"signal": 8,
"max-length": 5,
"min-length": 3
},
"custom/spotify": {
"exec": "~/.config/waybar/mediaplayer.py --player spotify",
"format": "{} ",
"return-type": "json",
"on-click": "playerctl play-pause",
"on-scroll-up": "playerctl next",
"on-scroll-down": "playerctl previous"
},
"custom/media": {
"format": "{0} {1}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
//"exec": "~/.config/waybar/mediaplayer.py" // Script in resources folder
// "exec": "~/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/power": {
"format": " 󰐥 ",
"tooltip": false,
"on-click": "wlogout"
},
"clock": {
"format": " {:%H:%M  %e %b}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"today-format": "<b>{}</b>"
},
"clock#date": {
"format": "󰥔 {:%H:%M \n %e %b}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"today-format": "<b>{}</b>"
},
"custom/gammastep": {
"interval": 5,
"return-type": "json",
"exec": {
"pre": "if unit_status=\"$(systemctl --user is-active gammastep)\"; then\nstatus=\"$unit_status ($(journalctl --user -u gammastep.service -g 'Period: ' | tail -1 | cut -d ':' -f6 | xargs))\"\nelse\nstatus=\"$unit_status\"\nfi",
"alt": "${status:-inactive}",
"tooltip": "Gammastep is $status",
},
"format": "{icon}",
"format-icons": {
"activating": "󰁪 ",
"deactivating": "󰁪 ",
"inactive": "? ",
"active (Night)": " ",
"active (Nighttime)": " ",
"active (Transition (Night)": " ",
"active (Transition (Nighttime)": " ",
"active (Day)": " ",
"active (Daytime)": " ",
"active (Transition (Day)": " ",
"active (Transition (Daytime)": " ",
},
"on-click": "systemctl --user is-active gammastep && systemctl --user stop gammastep || systemctl --user start gammastep",
},
"cpu": {
"interval": 1,
"format": " {usage}%",
//"format": "{max_frequency}GHz <span color=\"darkgray\">| {usage}%</span>",
"max-length": 13,
"min-length": 13
},
"mpd": {
"max-length": 25,
"format": "<span foreground='#bb9af7'></span> {title}",
"format-paused": " {title}",
"format-stopped": "<span foreground='#bb9af7'></span>",
"format-disconnected": "",
"on-click": "mpc --quiet toggle",
"on-click-right": "mpc update; mpc ls | mpc add",
"on-click-middle": "alacritty -e ncmpcpp",
"on-scroll-up": "mpc --quiet prev",
"on-scroll-down": "mpc --quiet next",
"smooth-scrolling-threshold": 5,
"tooltip-format": "{title} - {artist} ({elapsedTime:%M:%S}/{totalTime:%H:%M:%S})"
},
"custom/title": {
"format": "{}",
"interval": 0,
"return-type": "json",
//"max-length": 35,
"tooltip": false
},
"custom/title#name": {
"format": "{}",
"interval": 0,
"return-type": "json",
"max-length": 35,
"exec": "$HOME/.scripts/title"
},
/*"custom/keyboard": {
"format": " {}",
"interval": 1,
"exec": "$HOME/.config/waybar/get_kbdlayout.sh"
},*/
"niri/workspaces": {
"max-length": 100,
"separate-outputs": true
},
"pulseaudio": {
"scroll-step": 3, // %, can be a float
"format": "{icon} {volume}% {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
//"format-source": "{volume}% ",
//"format-source-muted": "",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": [
"",
"",
""
]
},
"on-click": "pavucontrol",
"on-click-right": "amixer sset Master toggle"
},
"wireplumber": {
"on-click": "pavucontrol",
"on-click-right": "amixer sset Master toggle 1>/dev/null",
//on-click: "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
//on-scroll-down: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04+";
//on-scroll-up: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04-";
"format": "<span foreground='#fab387'>{icon}</span> {volume}%",
"format-muted": " ",
"format-source": "",
"format-source-muted": "",
//"format-muted": "<span foreground='#fab387'> </span>",
//"format-icons": [ "<span foreground='#fab387'></span>" ]
"format-icons": {
"headphone": " ",
"hands-free": " ",
"headset": " ",
"phone": " ",
"portable": " ",
"car": " ",
"default": [
" ",
" ",
" "
]
},
},
"tray": {
"icon-size": 15,
"spacing": 5
}
}
+105
View File
@@ -0,0 +1,105 @@
{
"layer": "top",
"position": "top",
"reload_style_on_change": true,
"modules-left": ["custom/notification","clock","custom/pacman","tray"],
"modules-center": ["hyprland/workspaces"],
"modules-right": ["cpu","memory","temperature","bluetooth","network","battery", "custom/spacer"],
"hyprland/workspaces": {
"format": "{icon}",
"format-icons": {
"active": "",
"default": "",
"empty": ""
},
"persistent-workspaces": {
"*": [ 1,2,3,4,5 ]
}
},
"custom/notification": {
"tooltip": false,
"format": "",
"on-click": "swaync-client -t -sw",
"escape": true
},
"clock": {
"format": "{:%H:%M:%S} ",
"interval": 1,
"tooltip-format": "<tt>{calendar}</tt>",
"calendar": {
"format": {
"today": "<span color='#fAfBfC'><b>{}</b></span>"
}
},
"actions": {
"on-click-right": "shift_down",
"on-click": "shift_up"
}
},
"network": {
"format-wifi": " ",
"format-ethernet":" ",
"format-disconnected": " ",
"tooltip-format-disconnected": "Error",
"tooltip-format-wifi": "{essid} ({signalStrength}%) ",
"tooltip-format-ethernet": "{ifname} 🖧 ",
"on-click": "kitty nmtui"
},
"bluetooth": {
"format-on": "󰂯",
"format-off": "BT-off",
"format-disabled": "󰂲",
"format-connected-battery": "{device_battery_percentage}% 󰂯",
"format-alt": "{device_alias} 󰂯",
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\n{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\n{device_address}\n{device_battery_percentage}%",
"on-click-right": "blueman-manager"
},
"battery": {
"interval":30,
"states": {
"good": 95,
"warning": 30,
"critical": 20
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% 󰂄",
"format-plugged": "{capacity}% 󰂄 ",
"format-alt": "{time} {icon}",
"format-icons": [
"󰁻",
"󰁼",
"󰁾",
"󰂀",
"󰂂",
"󰁹"
]
},
"custom/pacman": {
"format": "󰅢 {}",
"interval": 30,
"exec": "checkupdates | wc -l",
"exec-if": "exit 0",
"on-click": "kitty sh -c 'yay -Syu; echo Done - Press enter to exit; read'; pkill -SIGRTMIN+8 waybar",
"signal": 8,
"tooltip": false
},
"cpu": {
"format": "󰻠 {usage}%",
"tooltip": true
},
"memory": {
"format": " {used}GB"
},
"temperature": {
"critical-threshold": 80,
"format": " {}°C",
"hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input"
},
"tray": {
"icon-size": 14,
"spacing": 10
}
}
+26
View File
@@ -0,0 +1,26 @@
@define-color rosewater #f5e0dc;
@define-color flamingo #f2cdcd;
@define-color pink #f5c2e7;
@define-color mauve #cba6f7;
@define-color red #f38ba8;
@define-color maroon #eba0ac;
@define-color peach #fab387;
@define-color yellow #f9e2af;
@define-color green #a6e3a1;
@define-color teal #94e2d5;
@define-color sky #89dceb;
@define-color sapphire #74c7ec;
@define-color blue #89b4fa;
@define-color lavender #b4befe;
@define-color text #cdd6f4;
@define-color subtext1 #bac2de;
@define-color subtext0 #a6adc8;
@define-color overlay2 #9399b2;
@define-color overlay1 #7f849c;
@define-color overlay0 #6c7086;
@define-color surface2 #585b70;
@define-color surface1 #45475a;
@define-color surface0 #313244;
@define-color base #1e1e2e;
@define-color mantle #181825;
@define-color crust #11111b;
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/python
import os
import imaplib
import mailsecrets
def getmails(username, password, server):
imap = imaplib.IMAP4_SSL(server, 993)
imap.login(username, password)
imap.select('INBOX')
ustatus, uresponse = imap.uid('search', None, 'UNSEEN')
if ustatus == 'OK':
unread_msg_nums = uresponse[0].split()
else:
unread_msg_nums = []
fstatus, fresponse = imap.uid('search', None, 'FLAGGED')
if fstatus == 'OK':
flagged_msg_nums = fresponse[0].split()
else:
flagged_msg_nums = []
return [len(unread_msg_nums), len(flagged_msg_nums)]
ping = os.system("ping " + mailsecrets.server + " -c1 > /dev/null 2>&1")
if ping == 0:
mails = getmails(mailsecrets.username, mailsecrets.password, mailsecrets.server)
text = ''
alt = ''
if mails[0] > 0:
text = alt = str(mails[0])
if mails[1] > 0:
alt = str(mails[1]) + "" + alt
else:
exit(1)
print('{"text":"' + text + '", "alt": "' + alt + '"}')
else:
exit(1)
Loaded 100 of 454 files, more files were not shown because too many files have changed in this diff. Show more