viewsync-master 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/package.json +2 -2
- package/viewsync_main.py +8 -5
package/README.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
# ViewSync Master 🚀 (
|
|
1
|
+
# ViewSync Master 🚀 
|
|
2
2
|
|
|
3
3
|
A powerful, lag-free mirroring tool and live cropper for Android devices! Perfect for streaming study lectures seamlessly on your PC.
|
|
4
4
|
|
|
5
5
|
## ✨ Features
|
|
6
6
|
- **Live Cropper:** Remove black bars on the fly and save unlimited profiles.
|
|
7
7
|
- **Lag-Free Streaming:** Optimized bitrate (2Mbps) and scaled resolution (1024px) for buttery smooth 30fps playback.
|
|
8
|
-
- **Hardware Keyboard Shortcuts:** Use your laptop keyboard to control media!
|
|
9
|
-
- `Spacebar` = Play / Pause
|
|
10
|
-
- `Right Arrow` = Fast Forward (10s)
|
|
11
|
-
- `Left Arrow` = Rewind (10s)
|
|
12
8
|
- **1-Click Launch:** Beautiful dark-mode UI.
|
|
13
9
|
|
|
14
10
|
## 📥 Installation
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viewsync-master",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Live screen cropper
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Live screen cropper and lag-free mirroring.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"viewsync-master": "./index.js"
|
package/viewsync_main.py
CHANGED
|
@@ -42,6 +42,7 @@ class ScrcpyApp:
|
|
|
42
42
|
self.process = None
|
|
43
43
|
self.profiles = {}
|
|
44
44
|
self.current_profile = tk.StringVar()
|
|
45
|
+
self.enable_kb_var = tk.BooleanVar(value=False)
|
|
45
46
|
self.val_l = tk.IntVar(value=0)
|
|
46
47
|
self.val_r = tk.IntVar(value=0)
|
|
47
48
|
self.val_t = tk.IntVar(value=0)
|
|
@@ -150,6 +151,9 @@ class ScrcpyApp:
|
|
|
150
151
|
update_lbl()
|
|
151
152
|
|
|
152
153
|
def _build_launch_card(self, parent):
|
|
154
|
+
cb = tk.Checkbutton(parent, text="⌨️ Allow typing from Laptop Keyboard (May trigger polls with Spacebar)", variable=self.enable_kb_var, bg=CARD, fg=TEXT, selectcolor=BG, activebackground=CARD, activeforeground=TEXT, font=("Segoe UI", 9))
|
|
155
|
+
cb.pack(anchor=tk.W, pady=(0, 8))
|
|
156
|
+
b1 = styled_btn
|
|
153
157
|
b1 = styled_btn(parent, "▶ Normal Phone (Bina Crop Ke)", ACCENT, ACCENT_HVR, self.launch_normal, font_size=12, pady=10)
|
|
154
158
|
b1.pack(fill=tk.X, pady=(0, 8))
|
|
155
159
|
row = tk.Frame(parent, bg=CARD)
|
|
@@ -219,14 +223,13 @@ class ScrcpyApp:
|
|
|
219
223
|
self.on_profile_select(None)
|
|
220
224
|
self.show_status(f"🗑️ Profile '{p}' deleted")
|
|
221
225
|
|
|
222
|
-
def _start_helpers(self):
|
|
223
226
|
subprocess.Popen("if ! pgrep -f viewsync_helper.py > /dev/null; then nohup python3 ~/.viewsync-master/viewsync_helper.py > /dev/null 2>&1 & fi", shell=True)
|
|
224
227
|
|
|
225
228
|
def launch_normal(self):
|
|
226
229
|
self.stop_viewsync()
|
|
227
|
-
self._start_helpers()
|
|
228
230
|
# Added -b 4M --max-fps 30 for smooth playback
|
|
229
|
-
|
|
231
|
+
kb_flag = [] if self.enable_kb_var.get() else ["--keyboard=disabled"]
|
|
232
|
+
cmd = ["/usr/local/bin/scrcpy", "--window-title=viewsync"] + kb_flag + ["-m", "1024", "-b", "2M", "--max-fps", "30"]
|
|
230
233
|
env = os.environ.copy()
|
|
231
234
|
env["ADB"] = "/usr/bin/adb"
|
|
232
235
|
self.process = subprocess.Popen(cmd, env=env)
|
|
@@ -234,7 +237,6 @@ class ScrcpyApp:
|
|
|
234
237
|
|
|
235
238
|
def launch_cropped(self, fullscreen):
|
|
236
239
|
self.stop_viewsync()
|
|
237
|
-
self._start_helpers()
|
|
238
240
|
p = self.current_profile.get()
|
|
239
241
|
self.profiles[p] = {"L": self.val_l.get(), "R": self.val_r.get(), "T": self.val_t.get(), "B": self.val_b.get()}
|
|
240
242
|
self.save_profiles()
|
|
@@ -246,7 +248,8 @@ class ScrcpyApp:
|
|
|
246
248
|
crop = f"{PW}:{PH}:{B}:{L}"
|
|
247
249
|
|
|
248
250
|
# Added -b 4M --max-fps 30 for smooth playback
|
|
249
|
-
|
|
251
|
+
kb_flag = [] if self.enable_kb_var.get() else ["--keyboard=disabled"]
|
|
252
|
+
cmd = ["/usr/local/bin/scrcpy", "--window-title=viewsync"] + kb_flag + ["--crop", crop, "-m", "1024", "-b", "2M", "--max-fps", "30"]
|
|
250
253
|
if fullscreen:
|
|
251
254
|
cmd.append("-f")
|
|
252
255
|
env = os.environ.copy()
|