# Kotlin Native Clipboard Linux

**URL:** <https://discuss.kotlinlang.org/t/kotlin-native-clipboard-linux/20000>\
**Category:** Support\
**Created:** [November 23, 2020, 6:42pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-clipboard-linux/20000 "2020-11-23T18:42:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tscha](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tscha](https://discuss.kotlinlang.org/u/tscha)\
**Post date:** [November 23, 2020, 6:42pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-clipboard-linux/20000/1 "2020-11-23T18:42:22Z")

</div>

Can I do something like this on native?

```auto
fun main() {
	val clipboard = Toolkit.getDefaultToolkit().systemClipboard
	val clipboardContent = clipboard.getData(DataFlavor.stringFlavor)
	println(clipboardContent)
}

```

I.e., is there a way to access the clipboard on Linux systems? I found [this](https://github.com/jonnyzzz/kotlin-native-clipboard) but this is for MacOS specifically.

---

<div class="post-metadata">

**Author:** ![bjonnh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/bjonnh/32/8106_2.png) [@bjonnh](https://discuss.kotlinlang.org/u/bjonnh)\
**Post date:** [November 24, 2020, 4:36am UTC](https://discuss.kotlinlang.org/t/kotlin-native-clipboard-linux/20000/2 "2020-11-24T04:36:00Z")

</div>

Clipboard on Linux is complicated. You have to handle X11 and the myriad of Wayland compositors (gnome, wlroots…). Best way would be to find a toolkit that does that for you. There are some projects bringing gtk to kotlin native that may also be of some help.
