Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Add pacman (Arch Linux) support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai2038 committed May 26, 2024
1 parent 7da4acf commit 0c4b507
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ The purpose here is to sync clipboard content when working in VirtualBox.
Wayland clipboard is not syncing, but X11 clipboard does.
So the service created by this script here watches Wayland clipboard content, and when it changes, it copies it to the X11 clipboard content and vice versa.

## 2. Usage
## 2. Requirements

- `pacman` (Arch-based) or `apt-get` (Debian-based) installed;
- `sudo` installed.

## 3. Usage

Execute inside virtual machine for usual user:

```bash
curl -s https://raw.githubusercontent.com/Nikolai2038/wayland-clipboard-fix/main/fix.sh | sh
```

## 3. Contribution
## 4. Contribution

Feel free to contribute via [pull requests](https://github.com/Nikolai2038/wayland-clipboard-fix/pulls) or [issues](https://github.com/Nikolai2038/wayland-clipboard-fix/issues)!
9 changes: 7 additions & 2 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
Буфер обмена Wayland не синхронизируется, но буфер обмена X11 - синхронизируется.
Поэтому сервис, создаваемый этим скриптом, смотри на буфер обмена Wayland, и когда тот меняется, копирует его содержимое в буфер обмена X11, и наоборот.

## 2. Использование
## 2. Требования

- Установленный `pacman` (Arch-основа) или `apt-get` (Debian-основа);
- Установленный `sudo`.

## 3. Использование

Выполнить внутри виртуальной машины для обычного пользователя:

```bash
curl -s https://raw.githubusercontent.com/Nikolai2038/wayland-clipboard-fix/main/fix.sh | sh
```

## 3. Развитие
## 4. Развитие

Не стесняйтесь участвовать в развитии репозитория, используя [pull requests](https://github.com/Nikolai2038/wayland-clipboard-fix/pulls) или [issues](https://github.com/Nikolai2038/wayland-clipboard-fix/issues)!
11 changes: 10 additions & 1 deletion fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ set -e

echo "Installing required packages..." >&2
# Install CLI utils to work with clipboard: "wl-clipboard" for Wayland and "xclip" for X11
sudo apt-get update && sudo apt-get install -y wl-clipboard xclip
if pacman --help > /dev/null 2>&1; then
# For Arch-based
sudo pacman -Sy --noconfirm --needed wl-clipboard xclip || exit "$?"
elif apt-get --help > /dev/null 2>&1; then
# For Debian-based
sudo apt-get update && sudo apt-get install -y wl-clipboard xclip || exit "$?"
else
echo "No pacman or apt-get found!" >&2
exit 1
fi
echo "Required packages installed!" >&2

# ========================================
Expand Down

0 comments on commit 0c4b507

Please sign in to comment.