logitech-marble-labwc 0.1.0__tar.gz

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.
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: logitech-marble-labwc
3
+ Version: 0.1.0
4
+ Summary: Labwc scroll emulation for Logitech Trackman Marble
5
+ Author: ldl805
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: POSIX :: Linux
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Logitech-Marble-Labwc
13
+
14
+ A simple Python script to enable scroll wheel emulation for the Logitech Trackman Marble (T-BC21) trackball in the **labwc** Wayland compositor.
15
+
16
+ ## Features
17
+ - Automatically detects and updates your `~/.config/labwc/rc.xml` file.
18
+ - Backs up your existing configuration.
19
+ - Supports both small buttons (Back/Forward) as scroll modifiers.
20
+
21
+ ## Installation (Recommended)
22
+
23
+ ### Option 1: Debian Package (Pi/Ubuntu/Debian)
24
+
25
+ Download the latest `.deb` file from the [Releases](https://github.com/ldl805/Logitech-Marble-Labwc/releases) page and install it using:
26
+
27
+ ```bash
28
+ sudo apt update
29
+ sudo apt install ./logitech-marble-labwc_1.0_all.deb
30
+ ```
31
+
32
+ Once installed, run the configuration utility:
33
+ ```bash
34
+ logitech-marble-labwc
35
+ ```
36
+
37
+ ### Option 2: Run directly
38
+
39
+ 1. Clone the repository:
40
+ ```bash
41
+ git clone https://github.com/ldl805/Logitech-Marble-Labwc.git
42
+ cd Logitech-Marble-Labwc
43
+ ```
44
+ 2. Run the installer:
45
+ ```bash
46
+ python3 install.py
47
+ ```
48
+
49
+ ## Usage
50
+ Once configured, hold down either of the small buttons on your Logitech Marble and move the ball to scroll in any direction.
51
+
52
+ ## License
53
+ MIT License
@@ -0,0 +1,42 @@
1
+ # Logitech-Marble-Labwc
2
+
3
+ A simple Python script to enable scroll wheel emulation for the Logitech Trackman Marble (T-BC21) trackball in the **labwc** Wayland compositor.
4
+
5
+ ## Features
6
+ - Automatically detects and updates your `~/.config/labwc/rc.xml` file.
7
+ - Backs up your existing configuration.
8
+ - Supports both small buttons (Back/Forward) as scroll modifiers.
9
+
10
+ ## Installation (Recommended)
11
+
12
+ ### Option 1: Debian Package (Pi/Ubuntu/Debian)
13
+
14
+ Download the latest `.deb` file from the [Releases](https://github.com/ldl805/Logitech-Marble-Labwc/releases) page and install it using:
15
+
16
+ ```bash
17
+ sudo apt update
18
+ sudo apt install ./logitech-marble-labwc_1.0_all.deb
19
+ ```
20
+
21
+ Once installed, run the configuration utility:
22
+ ```bash
23
+ logitech-marble-labwc
24
+ ```
25
+
26
+ ### Option 2: Run directly
27
+
28
+ 1. Clone the repository:
29
+ ```bash
30
+ git clone https://github.com/ldl805/Logitech-Marble-Labwc.git
31
+ cd Logitech-Marble-Labwc
32
+ ```
33
+ 2. Run the installer:
34
+ ```bash
35
+ python3 install.py
36
+ ```
37
+
38
+ ## Usage
39
+ Once configured, hold down either of the small buttons on your Logitech Marble and move the ball to scroll in any direction.
40
+
41
+ ## License
42
+ MIT License
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import shutil
4
+
5
+ CONFIG_DIR = os.path.expanduser("~/.config/labwc")
6
+ CONFIG_FILE = os.path.join(CONFIG_DIR, "rc.xml")
7
+ SYSTEM_CONFIG = "/etc/xdg/labwc/rc.xml"
8
+
9
+ SCROLL_XML = """
10
+ <!-- Logitech Trackman Marble (T-BC21) Scroll Emulation -->
11
+ <mouse>
12
+ <default />
13
+ <context name="All">
14
+ <!-- Small left button -->
15
+ <mousebind button="Back" action="Press"><action name="EnableScrollWheelEmulation" /></mousebind>
16
+ <mousebind button="Back" action="Release"><action name="DisableScrollWheelEmulation" /></mousebind>
17
+ <mousebind button="Side" action="Press"><action name="EnableScrollWheelEmulation" /></mousebind>
18
+ <mousebind button="Side" action="Release"><action name="DisableScrollWheelEmulation" /></mousebind>
19
+
20
+ <!-- Small right button -->
21
+ <mousebind button="Forward" action="Press"><action name="EnableScrollWheelEmulation" /></mousebind>
22
+ <mousebind button="Forward" action="Release"><action name="DisableScrollWheelEmulation" /></mousebind>
23
+ <mousebind button="Extra" action="Press"><action name="EnableScrollWheelEmulation" /></mousebind>
24
+ <mousebind button="Extra" action="Release"><action name="DisableScrollWheelEmulation" /></mousebind>
25
+ </context>
26
+ </mouse>
27
+ """
28
+
29
+
30
+ def main():
31
+ print("Logitech Trackman Marble (T-BC21) Labwc Scroll Installer")
32
+ print("========================================================")
33
+
34
+ if not os.path.exists(CONFIG_DIR):
35
+ print(f"Creating directory: {CONFIG_DIR}")
36
+ os.makedirs(CONFIG_DIR)
37
+
38
+ if not os.path.exists(CONFIG_FILE):
39
+ if os.path.exists(SYSTEM_CONFIG):
40
+ print(
41
+ f"Copying system default config from {SYSTEM_CONFIG} to {CONFIG_FILE}...")
42
+ shutil.copy(SYSTEM_CONFIG, CONFIG_FILE)
43
+ else:
44
+ print(f"Creating a minimal configuration at {CONFIG_FILE}...")
45
+ with open(CONFIG_FILE, "w") as f:
46
+ f.write(
47
+ '<?xml version="1.0"?>\n<openbox_config xmlns="http://openbox.org/3.4/rc">\n</openbox_config>\n')
48
+
49
+ with open(CONFIG_FILE, "r") as f:
50
+ content = f.read()
51
+
52
+ if "EnableScrollWheelEmulation" in content:
53
+ print("\n✅ Scroll wheel emulation already appears to be configured in your rc.xml.")
54
+ print("No changes made.")
55
+ return
56
+
57
+ # Backup the original config
58
+ backup_path = CONFIG_FILE + ".bak"
59
+ shutil.copy(CONFIG_FILE, backup_path)
60
+ print(f"\nBacked up original configuration to: {backup_path}")
61
+
62
+ # Check if a <mouse> block already exists
63
+ if "<mouse>" in content:
64
+ print("\n⚠️ A <mouse> section already exists in your rc.xml.")
65
+ print("To avoid overwriting your existing mouse bindings, please manually add the following")
66
+ print("to your <mouse><context name=\"All\"> section in ~/.config/labwc/rc.xml:")
67
+ print(SCROLL_XML)
68
+ return
69
+
70
+ # Inject the scroll XML before </openbox_config>
71
+ if "</openbox_config>" in content:
72
+ content = content.replace(
73
+ "</openbox_config>", SCROLL_XML + "</openbox_config>")
74
+ with open(CONFIG_FILE, "w") as f:
75
+ f.write(content)
76
+ print("\n✅ Successfully added scroll emulation to rc.xml.")
77
+
78
+ print("Reloading labwc compositor...")
79
+ os.system("labwc -r || killall -USR1 labwc >/dev/null 2>&1")
80
+ print("Done! You can now hold either small button and move the ball to scroll.")
81
+ else:
82
+ print("\n❌ Error: Could not find </openbox_config> tag in your rc.xml. File might be malformed.")
83
+
84
+
85
+ if __name__ == "__main__":
86
+ main()
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: logitech-marble-labwc
3
+ Version: 0.1.0
4
+ Summary: Labwc scroll emulation for Logitech Trackman Marble
5
+ Author: ldl805
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: POSIX :: Linux
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Logitech-Marble-Labwc
13
+
14
+ A simple Python script to enable scroll wheel emulation for the Logitech Trackman Marble (T-BC21) trackball in the **labwc** Wayland compositor.
15
+
16
+ ## Features
17
+ - Automatically detects and updates your `~/.config/labwc/rc.xml` file.
18
+ - Backs up your existing configuration.
19
+ - Supports both small buttons (Back/Forward) as scroll modifiers.
20
+
21
+ ## Installation (Recommended)
22
+
23
+ ### Option 1: Debian Package (Pi/Ubuntu/Debian)
24
+
25
+ Download the latest `.deb` file from the [Releases](https://github.com/ldl805/Logitech-Marble-Labwc/releases) page and install it using:
26
+
27
+ ```bash
28
+ sudo apt update
29
+ sudo apt install ./logitech-marble-labwc_1.0_all.deb
30
+ ```
31
+
32
+ Once installed, run the configuration utility:
33
+ ```bash
34
+ logitech-marble-labwc
35
+ ```
36
+
37
+ ### Option 2: Run directly
38
+
39
+ 1. Clone the repository:
40
+ ```bash
41
+ git clone https://github.com/ldl805/Logitech-Marble-Labwc.git
42
+ cd Logitech-Marble-Labwc
43
+ ```
44
+ 2. Run the installer:
45
+ ```bash
46
+ python3 install.py
47
+ ```
48
+
49
+ ## Usage
50
+ Once configured, hold down either of the small buttons on your Logitech Marble and move the ball to scroll in any direction.
51
+
52
+ ## License
53
+ MIT License
@@ -0,0 +1,8 @@
1
+ README.md
2
+ install.py
3
+ pyproject.toml
4
+ logitech_marble_labwc.egg-info/PKG-INFO
5
+ logitech_marble_labwc.egg-info/SOURCES.txt
6
+ logitech_marble_labwc.egg-info/dependency_links.txt
7
+ logitech_marble_labwc.egg-info/entry_points.txt
8
+ logitech_marble_labwc.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ logitech-marble-labwc = install:main
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "logitech-marble-labwc"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name="ldl805" },
10
+ ]
11
+ description = "Labwc scroll emulation for Logitech Trackman Marble"
12
+ readme = "README.md"
13
+ requires-python = ">=3.9"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: POSIX :: Linux",
18
+ ]
19
+
20
+ [project.scripts]
21
+ logitech-marble-labwc = "install:main"
22
+
23
+ [tool.setuptools]
24
+ py-modules = ["install"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+