Remix.run Logo
wltr 5 days ago

For those running Sway on a MacBook, here you go:

``` # Copy-Paste re-implementation for Mac Keyboard

set $mod Mod4 bindsym --to-code $mod+z exec wtype -P XF86Undo bindsym --to-code $mod+Shift+z exec wtype -P XF86Redo bindsym --to-code $mod+x exec wtype -P XF86Cut bindsym --to-code $mod+c exec wtype -P XF86Copy bindsym --to-code $mod+v exec wtype -P XF86Paste ```

Where mod is the cmd key. It works well in most apps. At least in those I care about (terminal, browser, vim). Took me a very long time to find this solution, as a macOS refugee.

Not necessarily a MacBook, by the way. I have an Apple Keyboard with my PC (just a great keyboard I enjoy), so it works there too.

tmtvl 5 days ago | parent [-]

For future reference, on HN you can format code snippets by indenting it (that is, to say, indenting every line) by two spaces:

  # Copy-Paste re-implementation for Mac Keyboard
  set $mod Mod4
  bindsym --to-code $mod+z exec wtype -P XF86Undo
  bindsym --to-code $mod+Shift+z exec wtype -P XF86Redo
  bindsym --to-code $mod+x exec wtype -P XF86Cut
  bindsym --to-code $mod+c exec wtype -P XF86Copy
  bindsym --to-code $mod+v exec wtype -P XF86Paste
wltr 5 days ago | parent [-]

Oh, thanks, I didn’t know how to do that, and since you fixed it already, I’m going to keep it as it is, for others to know too.