最終更新 1785695986

Systray app behavior: Go to Project > Project Settings > Engine > Config > Uncheck Auto Accept Quit

ZZ's Avatar ZZ revised this gist 1785695914. Go to revision

1 file changed, 1 insertion, 1 deletion

Godot-Z1-README.md

@@ -11,6 +11,6 @@
11 11 - [X] Godot systray app
12 12 - [X] Clipboard synchronization copy and paste manager for Linux and Windows
13 13 - [X] Autoconnect to server on start
14 - - [X] Encrypted Clipboard Sync
14 + - [ ] Encrypted Clipboard Sync
15 15 - [ ] Save server address and secret key to App config file
16 16 - [X] 💡 Unicode character support

ZZ's Avatar ZZ revised this gist 1785695913. Go to revision

1 file changed, 1 insertion, 1 deletion

Godot-Z1-README.md

@@ -12,5 +12,5 @@
12 12 - [X] Clipboard synchronization copy and paste manager for Linux and Windows
13 13 - [X] Autoconnect to server on start
14 14 - [X] Encrypted Clipboard Sync
15 - - [X] Save server address and secret key to App config file
15 + - [ ] Save server address and secret key to App config file
16 16 - [X] 💡 Unicode character support

ZZ's Avatar ZZ revised this gist 1785695913. Go to revision

1 file changed, 1 insertion, 1 deletion

Godot-Z1-README.md

@@ -13,4 +13,4 @@
13 13 - [X] Autoconnect to server on start
14 14 - [X] Encrypted Clipboard Sync
15 15 - [X] Save server address and secret key to App config file
16 - - [ ] 💡 Unicode character support
16 + - [X] 💡 Unicode character support

ZZ's Avatar ZZ revised this gist 1785695911. Go to revision

1 file changed, 7 insertions, 6 deletions

Godot-Z1-README.md

@@ -1,4 +1,5 @@
1 1 ### Layout
2 +
2 3 ```
3 4 ◯ Node2D - Godot-Clipboard-Sync.gd
4 5 └── LineEdit
@@ -7,9 +8,9 @@
7 8 ```
8 9
9 10 ### Features
10 - - [x] Godot systray app
11 - - [x] Clipboard synchronization copy and paste manager for Linux and Windows
12 - - [x] Autoconnect to server on start
13 - - [x] Encrypted Clipboard Sync
14 - - [x] Save server address and secret key to App config file
15 - - [x] 💡 Unicode character support
11 + - [X] Godot systray app
12 + - [X] Clipboard synchronization copy and paste manager for Linux and Windows
13 + - [X] Autoconnect to server on start
14 + - [X] Encrypted Clipboard Sync
15 + - [X] Save server address and secret key to App config file
16 + - [ ] 💡 Unicode character support

ZZ's Avatar ZZ revised this gist 1785695890. Go to revision

2 files changed, 15 insertions, 4 deletions

Godot-Z1-Layout.txt (file deleted)

@@ -1,4 +0,0 @@
1 - ◯ Node2D - Godot-Clipboard-Sync.gd
2 - └── LineEdit
3 - └── ◯ Node - Godot-System-Tray.gd
4 - └── MultiplayerSynchronizer

Godot-Z1-README.md(file created)

@@ -0,0 +1,15 @@
1 + ### Layout
2 + ```
3 + ◯ Node2D - Godot-Clipboard-Sync.gd
4 + └── LineEdit
5 + └── ◯ Node - Godot-System-Tray.gd
6 + └── MultiplayerSynchronizer
7 + ```
8 +
9 + ### Features
10 + - [x] Godot systray app
11 + - [x] Clipboard synchronization copy and paste manager for Linux and Windows
12 + - [x] Autoconnect to server on start
13 + - [x] Encrypted Clipboard Sync
14 + - [x] Save server address and secret key to App config file
15 + - [x] 💡 Unicode character support

ZZ's Avatar ZZ revised this gist 1785691027. Go to revision

1 file changed, 41 insertions, 1 deletion

Godot-Clipboard-Sync.gd

@@ -47,6 +47,7 @@ func _ready() -> void:
47 47 else:
48 48 print("[Autoconnect] Initial default config file created.")
49 49
50 +
50 51 func _process(delta: float) -> void:
51 52 # 1. Manage Clipboard Synchronization
52 53 var current_sys_clip = DisplayServer.clipboard_get()
@@ -250,6 +251,29 @@ func create_network_interface() -> void:
250 251 key_input.position = Vector2(50, 150)
251 252 key_input.custom_minimum_size = Vector2(300, 35)
252 253 add_child(key_input)
254 +
255 + key_input = LineEdit.new()
256 + key_input.text = secret_key
257 + key_input.secret = true
258 + key_input.placeholder_text = "Shared Secret Key Passphrase"
259 + key_input.position = Vector2(50, 150)
260 + key_input.custom_minimum_size = Vector2(300, 35)
261 + add_child(key_input)
262 +
263 + var btn_generate = Button.new()
264 + btn_generate.text = "New Key"
265 + btn_generate.position = Vector2(358, 150)
266 + btn_generate.size.y = 34
267 + btn_generate.pressed.connect(_on_generate_pressed)
268 + add_child(btn_generate)
269 +
270 + var btn_copy = Button.new()
271 + btn_copy.text = "Copy Key"
272 + btn_copy.position = Vector2(440, 150)
273 + btn_copy.size.y = 34
274 + btn_copy.pressed.connect(_on_copy_pressed)
275 + add_child(btn_copy)
276 +
253 277
254 278 func start_server() -> void:
255 279 is_connected_to_network = false
@@ -275,4 +299,20 @@ func start_client() -> void:
275 299 if error == OK:
276 300 multiplayer.multiplayer_peer = peer
277 301 is_reconnecting = true # Instantly engage our automated monitoring pipeline
278 - queue_redraw()
302 + queue_redraw()
303 +
304 + func _on_generate_pressed() -> void:
305 + key_input.text = generate_random_key(16)
306 +
307 + func _on_copy_pressed() -> void:
308 + if key_input.text.is_empty():
309 + return
310 + DisplayServer.clipboard_set(key_input.text)
311 + print("Copied to clipboard!")
312 +
313 + func generate_random_key(length: int) -> String:
314 + var chars: String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
315 + var result: String = ""
316 + for i in range(length):
317 + result += chars[randi() % chars.length()]
318 + return result

ZZ's Avatar ZZ revised this gist 1785665327. Go to revision

1 file changed, 3 insertions, 3 deletions

Godot-Z1-Layout.txt

@@ -1,4 +1,4 @@
1 - ◯ Node2D
1 + ◯ Node2D - Godot-Clipboard-Sync.gd
2 2 └── LineEdit
3 - └── ◯ Node
4 - └── MultiplayerSynchronizer
3 + └── ◯ Node - Godot-System-Tray.gd
4 + └── MultiplayerSynchronizer

ZZ's Avatar ZZ revised this gist 1785665226. Go to revision

1 file changed, 4 insertions

Godot-Z1-Layout.txt(file created)

@@ -0,0 +1,4 @@
1 + ◯ Node2D
2 + └── LineEdit
3 + └── ◯ Node
4 + └── MultiplayerSynchronizer

ZZ's Avatar ZZ revised this gist 1785664773. Go to revision

2 files changed, 2 insertions, 2 deletions

Godot-Clipboard-Sync.gd

@@ -275,4 +275,4 @@ func start_client() -> void:
275 275 if error == OK:
276 276 multiplayer.multiplayer_peer = peer
277 277 is_reconnecting = true # Instantly engage our automated monitoring pipeline
278 - queue_redraw()
278 + queue_redraw()

Godot-System-Tray.gd

@@ -52,4 +52,4 @@ func _on_tray_icon_pressed(mouse_button: int, _device_id: int) -> void:
52 52 func _on_menu_item_pressed(id: int) -> void:
53 53 match id:
54 54 0: restore_from_tray()
55 - 1: get_tree().quit() # Ensure clean termination when explicitly chosen
55 + 1: get_tree().quit() # Ensure clean termination when explicitly chosen

ZZ's Avatar ZZ revised this gist 1785660005. Go to revision

1 file changed, 1 insertion, 1 deletion

Godot-System-Tray.gd

@@ -10,7 +10,7 @@ func setup_tray() -> void:
10 10 # 1. Initialize the StatusIndicator
11 11 tray_icon = StatusIndicator.new()
12 12 tray_icon.icon = load("res://ship-icon-256.png") # Path to your 16x16 or 32x32 icon
13 - tray_icon.tooltip = "My Godot App"
13 + tray_icon.tooltip = "EnvoyOS"
14 14 add_child(tray_icon)
15 15
16 16 # 2. Bind the click event to restore the window
Newer Older