u/Technical_Constant79

Was not picking up modal editors so decided to extensively change the bindings to be simpler to learn/remember, and more ergonomic.

 [keys.normal]
"I" = "append_mode"
a = "collapse_selection"
A = "keep_primary_selection"
S = "remove_primary_selection"
u = "page_cursor_half_up"
d = "page_cursor_half_down"
s = "delete_selection"
z = "undo"
Z = "redo"
F = "goto_word"
e = "select_regex"
E = "split_selection"
t = "copy_selection_on_next_line"
T = "copy_selection_on_prev_line"
f = { f = "goto_file", t = "goto_window_top", c = "goto_window_center", b = "goto_window_bottom", d = "goto_definition", y = "goto_type_definition", r = "goto_reference", i = "goto_implementation", l = "goto_last_modification", n = "goto_line" }
g = "goto_line_start"
";" = "goto_line_end"
U = "goto_file_start"
D = "goto_last_line"
G = "goto_first_nonwhitespace"
w = { h = "move_prev_word_start", H = "move_prev_long_word_start", l = "move_next_word_end", L = "move_next_long_word_end", ";" = "move_next_word_start", ":" = "move_next_long_word_start" }
b = "no_op"
W = "no_op"
B = "no_op"
H = { D = "goto_first_diag", d = "goto_prev_diag", F = "goto_prev_function", C = "goto_prev_class", a = "goto_prev_parameter", c = "goto_prev_comment", T = "goto_prev_test", p = "goto_prev_paragraph", g = "goto_prev_change", G = "goto_first_change", space = "open_above", k = "add_newline_above", j = "add_newline_below", J = "jump_backward", f = "find_prev_char", t = "till_prev_char", b = "goto_previous_buffer" }
L = { D = "goto_last_diag", d = "goto_next_diag", F = "goto_next_function", C = "goto_next_class", a = "goto_next_parameter", c = "goto_next_comment", T = "goto_next_test", p = "goto_next_paragraph", g = "goto_next_change", G = "goto_last_change", space = "open_below", j = "add_newline_below", k = "add_newline_above", J = "jump_forward", f = "find_next_char", t = "find_till_char", b = "goto_next_buffer" }
C = { s = "switch_case", j = "decrement", k = "increment", J = "switch_to_lowercase", K = "switch_to_uppercase", c = "toggle_comments" }
p = { h = "paste_before", l = "paste_after", H = "paste_clipboard_before", L = "paste_clipboard_after" }

Maybe a little slower than just having w/e/b and f/t but I think that mine does simplify a lot of things and make things a little more ergonomic. Also there is W,o/O, P, b/B, ",", and [/] which are now also available for remapping so I can add more useful binds there.

reddit.com
u/Technical_Constant79 — 20 hours ago
▲ 0 r/NixOS

Bad router / bad scripting, fucked me

I spent a month working on nixos in a vm thought I was ready to put it on a ssd and of course right before I was making the last changes such as a few important sops changes and script fixes. DNS stopped resolving, so when I went through my whole install, which was git cloned it was all out of date and had no access to all my changes. It took a while to realise this and then I had to do all them last important changes again but in tty and was still trying to figure out why it didn't backup.

The annoying thing is that ping github.com would work fine then a git pull succeeds then the git push would fail two secs later with Could not resolve hostname github.com: Name or service not known. Nix builds would also fetch half their dependencies then sometimes they would die on a fixed-output derivation with curl: (6) Could not resolve host. Then you could go and retry the same command and then it would work.

I thought the network was just being flakey or something my brother was having issues before with internet as well.

for i in (seq 1 10); getent hosts github.com; end
Instead of just using one lookup I used a loop for 10 and only got 1.

Why was this happening /etc/resolv.conf had this,
search home

nameserver 192.168.20.1
nameserver 2403:5800:100:1::142
nameserver 2403:5800:1:5::242
options edns0

Basically router and two resolvers, what would happen is that glibc tries nameservers in order with short and limited retries where every lookup hit the router first, and glibc would give up rather than reliably falling through to the others. Adding good nameservers to the end did nothing because it would because they would never get reached.

I then tested using this,

for i in {1..20}; do dig +short  @192.168.20.1 github.com; done

the first result was correct but everyone after that produced,

;; Warning: Message parser reports malformed message packet.
10 8 15UPR+w3nxU=

Whilst the same loop with 1.1.1.1 were all correct. So in the end it was not rate limiting or timeouts the router was responding but with malformed packets full of base64 garbage.

Solution

networking.networkmanager.dns = "none";
networking.resolvconf.enable = false;
networking.nameservers = [ "1.1.1.1" "1.0.0.1" ];
environment.etc."resolv.conf".text = ''
  nameserver 1.1.1.1
  nameserver 1.0.0.1
  options edns0
'';

Obviously here you will want to probably add back you router to the bottom of the list.

Why did it not warn me on the VM? My script ran push inside a if ! git diff --cached --quiet block so once a commit did existed locally and the push had failed newer runs had nothing new to commit and skipped the push. So the router caused the first failed push but bad scripting stopped it from fixing itself.

u/Technical_Constant79 — 3 days ago
▲ 0 r/niri

Cannot get a modal mode to work with wlr-which-key, keyd, and niri together does anyone have a solution or something similar?

No matter what I do nothing works I just want a modal mode but turns way too hard for me. Everytime I fix something I run into another bug right now the modal mode opens and reopens every 2 seconds if I fix that capslock no longer closes modal mode. I fix that but now when uses home.sh does not send me back to the main modal menu. I spent wayy too much time on this Does anyone have something similar that works?

# keyd has a marco to convert sapslock into Mod+f12
binds {
    Mod+F12    repeat=false { spawn "/home/willisk/bin/wlr-which-key-toggle.sh"; }

# ~/.config/wlr-which-key/modal.yaml

# Theming  fully transparent, nothing renders
font: JetBrainsMono Nerd Font 11
background: "#00000000"
color: "#00000000"
border: "#00000000"
border_width: 0
corner_r: 0
padding: 0

anchor: bottom-right
margin_right: 20
margin_bottom: 20

menu:
  # Launcher (exits modal)
  - { key: "space", desc: Launcher, cmd: "fuzzel" }

  # Focus  lowercase hjkl
  - { key: "h", desc: Focus left,  cmd: "niri msg action focus-column-left",  keep_open: true }
  - { key: "j", desc: Focus down,  cmd: "niri msg action focus-window-down",  keep_open: true }
  - { key: "k", desc: Focus up,    cmd: "niri msg action focus-window-up",    keep_open: true }
  - { key: "l", desc: Focus right, cmd: "niri msg action focus-column-right", keep_open: true }

  # Move uppercase HJKL
  - { key: "H", desc: Move left,  cmd: "niri msg action move-column-left",  keep_open: true }
  - { key: "J", desc: Move down,  cmd: "niri msg action move-window-down",  keep_open: true }
  - { key: "K", desc: Move up,    cmd: "niri msg action move-window-up",    keep_open: true }
  - { key: "L", desc: Move right, cmd: "niri msg action move-column-right", keep_open: true }

  # Ends  g/; focus, G/: move
  - { key: "g", desc: First column,  cmd: "niri msg action focus-column-first",   keep_open: true }
  - { key: ";", desc: Last column,   cmd: "niri msg action focus-column-last",    keep_open: true }
  - { key: "G", desc: Move to first, cmd: "niri msg action move-column-to-first", keep_open: true }
  - { key: ":", desc: Move to last,  cmd: "niri msg action move-column-to-last",  keep_open: true }

  # Workspace up/down   focus,  move
  - { key: "u", desc: Workspace up,   cmd: "niri msg action focus-workspace-up",            keep_open: true }
  - { key: "U", desc: Move ws up,     cmd: "niri msg action move-column-to-workspace-up",   keep_open: true }
  - { key: "d", desc: Workspace down, cmd: "niri msg action focus-workspace-down",          keep_open: true }
  - { key: "D", desc: Move ws down,   cmd: "niri msg action move-column-to-workspace-down", keep_open: true }

  # Go to workspace  
  - { key: "0", desc: Workspace 0, cmd: "niri msg action focus-workspace 0; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "1", desc: Workspace 1, cmd: "niri msg action focus-workspace 1; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "2", desc: Workspace 2, cmd: "niri msg action focus-workspace 2; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "3", desc: Workspace 3, cmd: "niri msg action focus-workspace 3; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "4", desc: Workspace 4, cmd: "niri msg action focus-workspace 4; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "5", desc: Workspace 5, cmd: "niri msg action focus-workspace 5; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "6", desc: Workspace 6, cmd: "niri msg action focus-workspace 6; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "7", desc: Workspace 7, cmd: "niri msg action focus-workspace 7; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "8", desc: Workspace 8, cmd: "niri msg action focus-workspace 8; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
  - { key: "9", desc: Workspace 9, cmd: "niri msg action focus-workspace 9; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }

  - key: "F10"
    desc: Monitor
    submenu:
      - { key: "h", desc: Focus left,  cmd: "niri msg action focus-monitor-left",           keep_open: true }
      - { key: "j", desc: Focus down,  cmd: "niri msg action focus-monitor-down",           keep_open: true }
      - { key: "k", desc: Focus up,    cmd: "niri msg action focus-monitor-up",             keep_open: true }
      - { key: "l", desc: Focus right, cmd: "niri msg action focus-monitor-right",          keep_open: true }
      - { key: "H", desc: Move left,   cmd: "niri msg action move-column-to-monitor-left",  keep_open: true }
      - { key: "J", desc: Move down,   cmd: "niri msg action move-column-to-monitor-down",  keep_open: true }
      - { key: "K", desc: Move up,     cmd: "niri msg action move-column-to-monitor-up",    keep_open: true }
      - { key: "L", desc: Move right,  cmd: "niri msg action move-column-to-monitor-right", keep_open: true }
      - { key: "'", desc: Back,        cmd: "/home/willisk/bin/wlr-which-key-home.sh",      keep_open: true }

  - key: "r"
    desc: Resize
    submenu:
      - { key: "1", desc: Full width,  cmd: "niri msg action maximize-column; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "2", desc: Half width,  cmd: "niri msg action set-column-width '50%'; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "3", desc: Third width, cmd: "niri msg action set-column-width '33%'; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "f", desc: Fullscreen,  cmd: "niri msg action fullscreen-window; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "h", desc: Width -10%,  cmd: "niri msg action set-column-width '-10%'",  keep_open: true }
      - { key: "l", desc: Width +10%,  cmd: "niri msg action set-column-width '+10%'",  keep_open: true }
      - { key: "j", desc: Height -10%, cmd: "niri msg action set-window-height '-10%'", keep_open: true }
      - { key: "k", desc: Height +10%, cmd: "niri msg action set-window-height '+10%'", keep_open: true }
      - { key: "'", desc: Back,        cmd: "/home/willisk/bin/wlr-which-key-home.sh", keep_open: true }

  - key: "M"
    desc: Set mark
    submenu:
      - { key: "a", desc: Mark a, cmd: "niri-mark-set.sh a; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "b", desc: Mark b, cmd: "niri-mark-set.sh b; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "'", desc: Back,   cmd: "/home/willisk/bin/wlr-which-key-home.sh", keep_open: true }

  - key: "m"
    desc: Jump to mark
    submenu:
      - { key: "a", desc: Jump a, cmd: "niri-mark-jump.sh a; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "b", desc: Jump b, cmd: "niri-mark-jump.sh b; /home/willisk/bin/wlr-which-key-home.sh", keep_open: true }
      - { key: "'", desc: Back,   cmd: "/home/willisk/bin/wlr-which-key-home.sh", keep_open: true }

  # Misc
  - { key: "t",   desc: Terminal,        cmd: "kitty",                                   keep_open: true }
  - { key: "F11", desc: Toggle floating, cmd: "niri msg action toggle-window-floating",  keep_open: true }
  - { key: "b",   desc: Back,            cmd: "niri msg action focus-window-previous",   keep_open: true }
  - { key: "o",   desc: Overview,        cmd: "niri msg action toggle-overview",         keep_open: true }
  - { key: "q",   desc: Close,           cmd: "niri msg action close-window",            keep_open: true }
reddit.com
u/Technical_Constant79 — 17 days ago