统一两台Linux机器系统级复制粘贴快捷键的方法咨询
Hey there! Let’s get those two Linux machines on the same page with Ctrl+C/Ctrl+V for copy-paste—nothing’s more frustrating than switching between systems and fumbling with different shortcuts. The fix depends on which desktop environment each machine is using, so let’s break down the most common scenarios:
GNOME (Ubuntu, Fedora default, etc.)
This is one of the most popular desktop environments. Here’s how to adjust the shortcuts:
- Open the Settings app, navigate to Keyboard > Keyboard Shortcuts.
- Scroll down to the Editing section, locate the "Copy" and "Paste" entries.
- Click the current shortcut (like Ctrl+W or Ctrl+Y), press Backspace to clear it, then hit Ctrl+C for Copy and Ctrl+V for Paste. Press Enter to save the change.
- If you prefer command-line tweaks, run these in a terminal:
gsettings set org.gnome.desktop.wm.keybindings copy "['<Control>c']" gsettings set org.gnome.desktop.wm.keybindings paste "['<Control>v']"
KDE Plasma (Kubuntu, openSUSE, etc.)
For KDE users, the process is straightforward:
- Open System Settings > Shortcuts > Global Shortcuts > Plasma Workspace.
- Use the search bar to find "Copy to Clipboard" and "Paste from Clipboard".
- Click the existing shortcut field, press your desired combination (Ctrl+C for copy, Ctrl+V for paste), then hit Apply to save the changes.
Xfce (Xubuntu, etc.)
Xfce uses a slightly different setup for system-wide shortcuts:
- Open Settings Manager > Keyboard > Application Shortcuts.
- Click the Add button to create new shortcuts:
- For copy: Name it "System Copy", set the command to
xsel -ib, then press Ctrl+C when prompted for the shortcut. - For paste: Name it "System Paste", set the command to
xsel -ob, then press Ctrl+V.
- For copy: Name it "System Copy", set the command to
- Hit OK to apply these system-wide bindings.
Tiling Window Managers (i3, Sway, etc.)
If you’re using a tiling window manager, you’ll need to edit your configuration file:
i3 (X11)
- Open
~/.config/i3/configin your favorite text editor. - Add or modify these lines:
bindsym Control+c exec --no-startup-id xclip -selection clipboard -i bindsym Control+v exec --no-startup-id xclip -selection clipboard -o - Reload the config with
Mod+Shift+Cto apply changes.
Sway (Wayland)
- Edit
~/.config/sway/configand add:bindsym Ctrl+c exec wl-copy bindsym Ctrl+v exec wl-paste - Reload using
Mod+Shift+C.
Terminal-Only Tips
If one machine is running without a GUI, note that Ctrl+C is normally used to interrupt processes. Most terminal emulators let you use Ctrl+Shift+C/V for copy-paste—check your terminal’s preferences (e.g., GNOME Terminal, Konsole) to set these shortcuts consistently across both machines.
备注:内容来源于stack exchange,提问作者Nick G

