{"slug": "mac-style-copy-paste-on-void-linux", "title": "Mac style copy/paste on Void Linux", "summary": "The article describes a user's attempt to unify keybindings between a Mac work laptop and a personal Void Linux system running the dwm window manager. To resolve the frustration of accidentally pressing Alt+C and Alt+V for copy and paste, the author configured sxhkd to use xclip and xdotool commands, which transfer text between the primary selection and clipboard and simulate a middle-click paste. The final solution involves remapping Alt+C to copy the primary selection to the clipboard and Alt+V to paste by copying the clipboard to the primary selection and triggering a middle-click.", "body_md": "Mac style copy/paste on Void Linux\nAnother quick post that may be useful to somebody else. I’ve been working at UKG for about 4 months now. In my work I use a Mac laptop. I’ve tried my best to unify my configurations between my personal Linux system and the Mac dev machine provided by UKG to reduce headaches when having to switch from professional to personal projects. This even went as far as trying to configure OpenBox to be more like the MacOS desktop environment (HA a big failed endeavour). While I ultimately found peace with differences in desktop environments, there was another thing I found very hard to deal with.\nDifferences in Keybindings!!\nI made a lot of changes and compromises when setting up my Mac system and configuring my personal machine.\nOne notable change was swapping my main modkey for dwm\nfrom Meta\nto Alt\nto better mimic the Mac setup.\nI tried doing the reverse of swapping Option\nand Cmd\nin Mac, but that was a really rough time.\nI’ve also tried to keep many other keybindings, associated with things like moving windows or changing workspaces, consistent.\nOne thing that was causing endless headaches was copy and paste.\nI don’t know the exact count of times I’ve pressed Alt+C\nor Alt+V\nat home in vain, but it is certainly significant.\nAs a result I spent some time to figure out how to do this.\nFinal Solution\nI configure my dwm\nspecific keybindings in my config.h\n, but for everything else I use sxhkd\n.\nThis allows me to more easily reload keybindings instead of having to cycle dwm\nand lose all of my window placements.\nI highly recommend this kind of setup.\nMy final solution, added to my sxhkdrc\nis:\nalt + c\nxclip -selection primary -o | xclip -selection clipboard -i\nalt + v\nsh -c 'xclip -selection clipboard -o | xclip -selection primary -i && xdotool click 2'\nI tried several other ways, most notable being just trying to send Ctrl+C\nwhen I pressed Alt+C\n, but nothing else worked.\nHow it works\nA quick description of how it works:\nAlt+C\ntakes the primary selection and copies it to the clipboardAlt+V\ntakes the clipboard and copies it to the primary selection and then emulates a middle mouse button click to paste.\nI was hoping for a more elegant solution but ¯_(ツ)_/¯", "url": "https://wpnews.pro/news/mac-style-copy-paste-on-void-linux", "canonical_source": "https://www.alexselimov.com/posts/mac_style_copy_paste/", "published_at": "2025-09-06 03:49:40+00:00", "updated_at": "2026-05-23 08:35:31.692232+00:00", "lang": "en", "topics": ["developer-tools", "open-source"], "entities": ["UKG", "Mac", "Void Linux", "OpenBox", "dwm", "sxhkd"], "alternates": {"html": "https://wpnews.pro/news/mac-style-copy-paste-on-void-linux", "markdown": "https://wpnews.pro/news/mac-style-copy-paste-on-void-linux.md", "text": "https://wpnews.pro/news/mac-style-copy-paste-on-void-linux.txt", "jsonld": "https://wpnews.pro/news/mac-style-copy-paste-on-void-linux.jsonld"}}