repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell: update to 106 hypr: autoscroll script for reading comics

50b498cc075fc9c64f70fed689e70b8516674a24

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (8)

+46 / −21 text lines

Diff layout

hypr/bindings.conf

Modified

+12 / −15 text lines

1212bind = $mainMod SHIFT, s, exec, systemctl suspend # Suspend with lock
1313bind = $mainMod, slash, exec, nu ~/.config/hypr/scripts/show_binds.nu
1414bind = $mainMod, tab, exec, nu ~/.config/hypr/scripts/show_clients.nu
15bind = $mainMod, s, exec, nu ~/.config/hypr/scripts/autoscroll.nu
1617bind = $mainMod, escape, exec, makoctl dismiss
5253bind = $mainMod CTRL, k, resizeactive, 0 -20
5354bind = $mainMod CTRL, j, resizeactive, 0 20
55# Move windows to another monitor
56bind = $mainMod, M, movecurrentworkspacetomonitor, +1 # Move to next monitor
57bind = $mainMod SHIFT, M, movecurrentworkspacetomonitor, -1 # Move to previous monitor
5956# Advanced tiling
60bind = $mainMod ALT, left, swapwindow, l # Swap window left
61bind = $mainMod ALT, right, swapwindow, r # Swap window right
62bind = $mainMod ALT, up, swapwindow, u # Swap window up
63bind = $mainMod ALT, down, swapwindow, d # Swap window down
64bind = $mainMod CTRL, left, splitratio, -0.1 # Decrease split ratio
65bind = $mainMod CTRL, right, splitratio, +0.1 # Increase split ratio
57bind = $mainMod ALT, h, swapwindow, l # Swap window left
58bind = $mainMod ALT, l, swapwindow, r # Swap window right
59bind = $mainMod ALT, k, swapwindow, u # Swap window up
60bind = $mainMod ALT, j, swapwindow, d # Swap window down
61bind = $mainMod ALT CTRL, left, splitratio, -0.1 # Decrease split ratio
62bind = $mainMod ALT CTRL, right, splitratio, +0.1 # Increase split ratio
6764# Window management
6865bind = $mainMod, F11, fullscreen, 0 # Toggle fullscreen
69bind = $mainMod, T, togglefloating # Toggle floating
70bind = $mainMod, P, pseudo # Pseudo-tiling for floating windows
71bind = $mainMod, V, togglesplit,
66bind = $mainMod, t, togglefloating # Toggle floating
67bind = $mainMod, p, pseudo # Pseudo-tiling for floating windows
68bind = $mainMod, v, togglesplit,
7370# Close Hyprland
74bind = $mainMod SHIFT, Q, exit # Exit Hyprland
71bind = $mainMod SHIFT, q, exit # Exit Hyprland
7673# Reload configuration
77bind = $mainMod SHIFT, R, exec, hyprctl reload # Reload Hyprland config
74bind = $mainMod SHIFT, r, exec, hyprctl reload # Reload Hyprland config
7976# Mouse bindings
8077bindm = $mainMod, mouse:272, movewindow # SUPER + left click to move

hypr/scripts/autoscroll.nu

Added
new file mode 100755

+27 / −0 text lines

1# File: ~/.config/hypr/scripts/autoscroll.nu
2
3# Configuration
4let speed = 1000 # millis between scroll events
5let scroll_amount = 1 # Number of scroll ticks
6let pid_file = $"($env.HOME)/.config/hypr/scripts/autoscroll.pid"
7
8# Check if script is already running
9if ($pid_file | path exists) {
10 let pid = (open $pid_file | into int)
11 try {
12 kill $pid
13 rm $pid_file
14 exit 0
15 } catch {
16 rm $pid_file # Remove stale PID file
17 }
18}
20# Save current PID
21($nu.pid | into string) | save --force $pid_file
23# Infinite scroll loop
24loop {
25 wtype -d $speed -k Down # Simulate scroll down via Down arrow key
26 sleep 50ms
27}

nushell/env.nu

Modified

+1 / −1 text lines

4343}
4545# FIXME: what did i need that for?
46# if ($env | get -i TERM_PROGRAM) == WezTerm {
46# if ($env | get --optional TERM_PROGRAM) == WezTerm {
4747# $env.TERM = "xterm-256color"
4848# }

nushell/login.nu

Modified

+1 / −0 text lines

1010use direnv.nu
1111use akku.nu
1212use colors.nu
13use syncthing.nu
1415use package

nushell/modules/direnv.nu

Modified

+1 / −1 text lines

1616export-env {
1717 $env.config = ( $env.config | upsert hooks.env_change.PWD { |config|
18 let o = ($config | get -i hooks.env_change.PWD)
18 let o = ($config | get --optional hooks.env_change.PWD)
1919 let val = (direnv)
2020 if $o == null {
2121 $val

nushell/modules/package/github.nu

Modified

+1 / −1 text lines

1010] {
1111 let url = $"https://api.github.com/repos/($org)/($name)($path)"
1212 mut headers = []
13 if ($env | get --ignore-errors GITHUB_TOKEN | is-not-empty) { $headers = [ Authorization $"Bearer ($env.GITHUB_TOKEN)"] }
13 if ($env | get --optional GITHUB_TOKEN | is-not-empty) { $headers = [ Authorization $"Bearer ($env.GITHUB_TOKEN)"] }
1414 try {
1515 http get --headers $headers $url | get $field
1616 } catch {

nushell/modules/package/lib.nu

Modified

+1 / −1 text lines

1515 record -> any
1616 table -> any
1717] {
18 select -i $column | update $column { if ( $in | is-empty ) { $value } else { $in } } | get $column
18 select --optional $column | update $column { if ( $in | is-empty ) { $value } else { $in } } | get $column
2121# checks if a file is executable

nushell/modules/syncthing.nu

Modified

+2 / −2 text lines

11export def "conflicts list" [] {
22 fd --hidden --no-ignore sync-conflict $env.HOME |
33 lines |
4 filter { |path| not ($path =~ "/Trash/") }
4 where { |path| not ($path =~ "/Trash/") }
55}
77export def "conflicts merge" [] {
4444 ^difft $a $b
4646def merge [ a: path, b: path ] {
47 meld $a $b
47 nvim -d $a $b