Coder Social home page Coder Social logo

gpcl's Introduction

GamePad Controlled Launcher

This is a simple application launcher designed to be an initial screen for my home media center. It respects gamepad inputs and displays a list of connected gamepads, a clock and a row of applications to run.

Screenshot

Lucide icons are used for gamepad status indication.

The launcher converts gamepad inputs into keyboard ones.

Gamepad Button(s) Keyboard Key(s) Action
DPad Buttons Arrow Keys Move the focus indicator
Bottom Action Button Enter Run the selected application
Up Action Button F5 Reload configuration

Configuration

The config file should be located at $XDG_CONFIG_HOME/gpcl.toml. You can configure window layout and define application list.

Example config:

[layout]
top_panel_height = 80 # default: 32
clock_height = 540 # default: 270
icon_size = 256 # default: 128

[[items]]
name = "Steam"
icon = "/usr/share/icons/hicolor/256x256/apps/steam.png"
exec = "steam -gamepadui"

[[items]]
name = "Kodi"
icon = "/usr/share/icons/hicolor/256x256/apps/kodi.png"
exec = "kodi"

[[items]]
name = "RetroArch"
icon = "/usr/share/pixmaps/retroarch.svg"
exec = "retroarch"

[[items]]
name = "Reboot"
icon = "/home/user/.local/share/pixmaps/reboot.png"
exec = "dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true"

[[items]]
name = "Shutdown"
icon = "/home/user/.local/share/pixmaps/shutdown.png"
exec = "dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:true"

The layout configuration itself and layout parameters are optional. Note that layout parameters are defined in logical pixels.

Build

The launcher is written in Rust, so it is built with cargo. It uses Slint as a graphical toolkit and uses winit as a backend (required to work with windowing API not provided by Slint).

You can build it for Wayland, X11 or for both platforms using wayland (default) and x11 features:

  • cargo build --release produces the Wayland-only build,
  • cargo build --release --features x11 produces the universal build that support both Wayland and X11
  • cargo build --release --no-default-features --features x11 produces the X11-only build

gpcl's People

Contributors

dngulin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.