Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

36 changes: 9 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,17 @@ xinput allows you to edit properties of devices like keyboards, mice, and touchp

## Installation

xinput-gui depends on Python 3.5+, GTK+ 3.20+, PyGObject, and xinput.

### Arch Linux

Available as a package on the AUR: [xinput-gui](https://aur.archlinux.org/packages/xinput-gui)

Install it with `makepkg` or your preferred AUR helper.

### Gentoo

Available as a Gentoo package thanks to [@filalex77](https://github.com/filalex77): [app-misc/xinput-gui](https://github.com/filalex77/bright/tree/master/app-misc/xinput-gui)

To install it, run the following commands:

```
eselect-repository enable bright
emerge --sync
emerge xinput-gui
```

### pip

Available on PyPI: [xinput-gui](https://pypi.org/project/xinput-gui/)

Install it with pip: `pip install --user xinput-gui`.
xinput-gui depends on Python 3.12+, GTK+ 3.20+, PyGObject, and xinput.

### Manual install

Download the [latest release](https://github.com/IvanFon/xinput-gui/releases/latest) or clone this repo and run `./setup.py install --user`.
Clone this repository, then use one of the following commands:
* #### uv
Install it whit uv: `uv pip install .`
* #### pip
Install it whit pip: `pip install .`

### Other installs
At the moment I dont have any plans to port the installation to other distros or package managers since this branch (or repo) it s just for personal use. But you're totally free to port it or adapt it whatever you like.

## Usage

Expand Down
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[project]
name = "xinput-gui"
version = "0.3.2"
description = "A simple GUI for Xorg's Xinput tool."
readme = "README.md"
authors = [
{name = "Ivan Fonseca", email = "ivanfon@riseup.net"}
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: X11 Applications :: GTK",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Topic :: Desktop Environment",
"Topic :: Utilities",
]
keywords=["'xinput", "keyboard", "mouse", "touchpad"]
dependencies = ["PyGObject" ]
license="GPL-3.0-or-later"

[project.scripts]
xinput-gui = "xinput_gui.__main__:main"

[build-system]
requires = ["uv_build>=0.11.28,<0.12.0"]
build-backend = "uv_build"

[project.urls]
homepage = "https://pypi.org/project/xinput-gui/"
repository = "https://github.com/IvanFon/xinput-gui"
documentation = "https://github.com/IvanFon/xinput-gui/tree/master/docs"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions xinput_gui/__main__.py → src/xinput_gui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ def main():

view_controller = ViewController()
view_controller.start()


if __name__ == "__main__":
main()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename
from importlib.resources import as_file, files

from ..settings import Settings
from ..xinput.devices import Device, DeviceType
Expand Down Expand Up @@ -60,12 +60,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow', sett

def get_builder(self) -> Gtk.Builder:
'''Get device list Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['grid_device_list', 'store_devices'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['grid_device_list', 'store_devices'])
return builder

def apply_settings(self) -> None:
'''Apply current settings.'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import require, resource_filename

from importlib.resources import as_file, files
from importlib.metadata import version

__version__ = require('xinput_gui')[0].version
__version__ = version('xinput_gui')


class AboutDialog:
Expand All @@ -44,12 +45,14 @@ def __init__(self, main_window) -> None:

def get_builder(self) -> Gtk.Builder:
'''Get about dialog Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['dialog_about'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['dialog_about'])
return builder

def show(self) -> None:
'''Show the about dialog.'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename

from importlib.resources import files, as_file

if TYPE_CHECKING:
from ..view_controller import ViewController
Expand Down Expand Up @@ -51,11 +52,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow') -> N
def get_builder(self) -> Gtk.Builder:
'''Get create master device dialog Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['dialog_create_master'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['dialog_create_master'])
return builder

def show(self) -> Gtk.ResponseType:
'''Show the create master device dialog.'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename

from ..xinput.devices import Device

from importlib.resources import as_file, files

if TYPE_CHECKING:
from ..view_controller import ViewController
from .win_main import MainWindow
Expand All @@ -49,12 +50,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow') -> N

def get_builder(self) -> Gtk.Builder:
'''Get device info dialog Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['dialog_device_info', 'buffer_device_info'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['dialog_device_info', 'buffer_device_info'])
return builder

def show(self, device: Device) -> None:
'''Show the device info dialog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename
from importlib.resources import files, as_file

from ..xinput.devices import Device, Prop

Expand Down Expand Up @@ -54,12 +54,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow') -> N

def get_builder(self) -> Gtk.Builder:
'''Get edit dialog Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['dialog_edit'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['dialog_edit'])
return builder

def show(self,
device: Device,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename
from importlib.resources import as_file, files

from ..xinput.devices import Device, DeviceType

Expand Down Expand Up @@ -53,11 +53,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow') -> N
def get_builder(self) -> Gtk.Builder:
'''Get reattach dialog Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['dialog_reattach', 'store_reattach'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['dialog_reattach', 'store_reattach'])
return builder

def show(self, selected_device: Device, devices: List[Device]) -> Gtk.ResponseType:
'''Show the reattach dialog.
Expand Down
16 changes: 9 additions & 7 deletions xinput_gui/gui/log.py → src/xinput_gui/gui/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename
from importlib.resources import as_file, files

if TYPE_CHECKING:
from .win_main import MainWindow
Expand All @@ -48,12 +48,14 @@ def __init__(self, main_window: 'MainWindow'):

def get_builder(self) -> Gtk.Builder:
'''Get device list Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['grid_log', 'buffer_log'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['grid_log', 'buffer_log'])
return builder

def clear_log(self) -> None:
'''Clear the log.'''
Expand Down
16 changes: 9 additions & 7 deletions xinput_gui/gui/prop_list.py → src/xinput_gui/gui/prop_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from pkg_resources import resource_filename
from importlib.resources import as_file, files

from ..settings import Settings
from ..xinput.devices import Device
Expand Down Expand Up @@ -60,12 +60,14 @@ def __init__(self, controller: 'ViewController', main_window: 'MainWindow', sett

def get_builder(self) -> Gtk.Builder:
'''Get prop list Gtk Builder.'''

builder = Gtk.Builder()
builder.add_objects_from_file(
resource_filename('xinput_gui', 'res/xinput-gui.ui'),
['grid_prop_list', 'store_props'])
return builder
ref = files('xinput_gui') / 'res/xinput-gui.ui'
with as_file(ref) as path:

builder = Gtk.Builder()
builder.add_objects_from_file(
str(path),
['grid_prop_list', 'store_props'])
return builder

def apply_settings(self) -> None:
'''Apply current settings.'''
Expand Down
Loading