Skip to content

Commit b6fc542

Browse files
committed
Merge branch 'release/0.5'
2 parents 4b8fd3a + 50a2dc6 commit b6fc542

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1844
-334
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
CMakeLists.txt.user
1+
CMakeLists.txt.user*
2+
.vscode
23

.travis.yml

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
1-
language: generic
1+
language: cpp
22
matrix:
33
include:
4-
- os: linux
5-
dist: trusty
6-
env: COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5
7-
addons:
8-
apt:
9-
sources: &sources
10-
- llvm-toolchain-trusty-5.0
11-
- ubuntu-toolchain-r-test
12-
- sourceline: 'ppa:beineri/opt-qt596-trusty'
13-
packages:
14-
- g++-5
15-
- qt59base
16-
- qt59declarative
17-
- qt59x11extras
18-
- libx11-xcb-dev
19-
- os: linux
20-
dist: trusty
21-
env: COMPILER_NAME=gcc CXX=g++-6 CC=gcc-6
22-
addons:
23-
apt:
24-
packages:
25-
- g++-6
26-
- qt59base
27-
- qt59declarative
28-
- qt59x11extras
29-
- libx11-xcb-dev
30-
sources: *sources
31-
- os: linux
32-
dist: trusty
33-
env: COMPILER_NAME=clang CXX=clang++ CC=clang
34-
addons:
35-
apt:
36-
packages:
37-
- clang-5.0
38-
- qt59base
39-
- qt59declarative
40-
- qt59x11extras
41-
- libx11-xcb-dev
42-
sources: *sources
43-
44-
script:
45-
- mkdir build && cd build
46-
- . /opt/qt59/bin/qt59-env.sh && cmake ..
47-
- make
48-
- ./projecteur -v
4+
- os: linux
5+
dist: xenial
6+
env: DOCKER_IMG=jahnf/projecteur:debian-stretch
7+
- os: linux
8+
dist: xenial
9+
env: DOCKER_IMG=jahnf/projecteur:ubuntu-16.04
10+
- os: linux
11+
dist: xenial
12+
env:
13+
- DOCKER_IMG=jahnf/projecteur:ubuntu-18.04
14+
- BUILD_SOURCE_PKG=1
15+
- os: linux
16+
dist: xenial
17+
env: DOCKER_IMG=jahnf/projecteur:opensuse-15.0
18+
- os: linux
19+
dist: xenial
20+
env: DOCKER_IMG=jahnf/projecteur:opensuse-42.3
21+
script:
22+
- git fetch --tags
23+
- "[ -f $(git rev-parse --git-dir)/shallow ] && git fetch --unshallow || echo No need to unshallow..."
24+
- docker pull ${DOCKER_IMG}
25+
- docker run --name build --env TRAVIS_BRANCH=${TRAVIS_BRANCH} -d -v `pwd`:/source:ro -ti ${DOCKER_IMG}
26+
- docker exec -it build /bin/bash -c "mkdir -p /build/dist-pkg && cd /build && cmake /source"
27+
- docker exec -it build /bin/bash -c "cd /build && cmake --build ."
28+
- docker exec -it build /bin/bash -c "cd /build && cmake --build . --target dist-package"
29+
- docker exec -it build /bin/bash -c "cd /build && ./projecteur --version"
30+
- docker exec -it build /bin/bash -c "mv /build/*.deb /build/dist-pkg || true"
31+
- docker exec -it build /bin/bash -c "mv /build/*.rpm /build/dist-pkg || true"
32+
- docker exec -it build /bin/bash -c "mv /build/*.tgz /build/dist-pkg || true"
33+
- docker exec -it build /bin/bash -c "mv /build/*.tar.gz /build/dist-pkg || true"
34+
- "[ \"${BUILD_SOURCE_PKG}\" = 1 ] && docker exec -it build /bin/bash -c \"cd /build && cmake --build . --target source-archive\" || true"
35+
- "[ \"${BUILD_SOURCE_PKG}\" = 1 ] && docker exec -it build /bin/bash -c \"mv /build/archive_output/* /build/dist-pkg\" || true"
36+
- docker cp build:/build/dist-pkg .
37+
- docker cp build:/build/travis-ci-bintray-deploy.json .
38+
- ls -alh dist-pkg
39+
deploy:
40+
provider: bintray
41+
skip_cleanup: true
42+
on:
43+
all_branches: true
44+
condition: "$TRAVIS_BRANCH =~ ^develop|master$"
45+
file: travis-ci-bintray-deploy.json
46+
user:
47+
secure: IiLPERfNp3JOj4kLgAaHFWNhYh8ZEMNwbnToo+eg69QsdKOq4gDyPjVA2pjq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F511GBJa5DxngD64Fc+84YP4GqRqYgKVTL0Rd6fyTHzVTlM63yPYxpzBE5IpU8LtPUgbMR9JU2CNNZx39nuqBde74x6/7yiMMqoDv3AkMSydqzKyMFfzR3EmPC7ZCFoalwkIkK4aVmpRw/EbmjaQ2NOc/N6TNraR5W8JcOhBZNfAQ8gpVXZtQnhxyxdqkrEIO0Glg4IPWonUO2025dq0eycfXyf38NovDz6+weBE=
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Set up permissions for non root users to open the Logitech Spotlight USB Receiver
22
# Enables the Projecteur application to access the device.
33

4-
# Copy this file to /etc/udev/rules.d/55-spotlight.rules and update the 'plugdev' group in the
5-
# file to a group you are a member in. (plugdev exists on Ubuntu, other distributions have
6-
# other groups)
4+
# Copy this file to /etc/udev/rules.d/55-spotlight.rules and replace '@DEVICE_USER_GROUP@'
5+
# with a group your user is a member in.
6+
#
7+
# Existing groups like 'plugdev' and 'dialout' can be used, but the `install` target
8+
# uses a group called 'spotlight-device' by default.
9+
# Linux packages created with the 'dist-package' target will create this group if not
10+
# present during installation.
11+
#
712
# Run `sudo udevadm control --reload-rules` and `sudo udevadm trigger`
813
# to load rules without rebooting.
914

1015
# Note that for kernels before 2.6.24, you will need to substitute "usb" with "usb_device".
1116

1217
# Rule for USB Receiver
13-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c53e", MODE="660", GROUP="plugdev", ENV{USB_HUB_TYPE}="046d:c53e"
18+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c53e", MODE="660", GROUP="@DEVICE_USER_GROUP@", ENV{USB_HUB_TYPE}="046d:c53e"
1419

1520
# Rule when connected via Bluetooth
1621
# Updated rule, thanks to Torsten Maehne (https://github.com/maehne)
17-
SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT*", MODE="660", GROUP="plugdev"
22+
SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT*", MODE="660", GROUP="@DEVICE_USER_GROUP@"

CMakeLists.txt

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,43 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2626

2727
set(CMAKE_AUTOMOC ON)
2828
set(CMAKE_AUTORCC ON)
29-
find_package(Qt5 COMPONENTS Core Gui Quick Widgets X11Extras REQUIRED)
30-
find_package(X11 REQUIRED)
29+
find_package(Qt5 COMPONENTS Core Gui Quick Widgets REQUIRED)
3130

3231
add_executable(projecteur
3332
main.cc
3433
aboutdlg.cc aboutdlg.h
3534
colorselector.cc colorselector.h
3635
preferencesdlg.cc preferencesdlg.h
3736
projecteurapp.cc projecteurapp.h
38-
qglobalshortcutx11.cc qglobalshortcutx11.h
3937
runguard.cc runguard.h
4038
settings.cc settings.h
4139
spotlight.cc spotlight.h
40+
spotshapes.cc spotshapes.h
4241
resources.qrc qml/qml.qrc)
4342

4443
target_link_libraries(projecteur
45-
Qt5::Core Qt5::Quick Qt5::Widgets Qt5::X11Extras
46-
${X11_LIBRARIES} xcb)
44+
Qt5::Core Qt5::Quick Qt5::Widgets
45+
)
4746

47+
# Set version project properties for builds not from a git repository (e.g. created with git archive)
48+
# If creating the version number via git information fails, the following target properties
49+
# will be used. IMPORTANT - when creating a release tag with git flow:
50+
# Update this information - the version numbers and the version type.
51+
# VERSION_TYPE must be either 'release' or 'develop'
52+
set_target_properties(projecteur PROPERTIES
53+
VERSION_MAJOR 0
54+
VERSION_MINOR 5
55+
VERSION_PATCH 0
56+
VERSION_TYPE release
57+
)
4858
add_version_info(projecteur "${CMAKE_CURRENT_SOURCE_DIR}")
4959

5060
# Add target with non-source files for convenience when using IDEs like QtCreator and others
51-
add_custom_target(non-sources SOURCES README.md LICENSE.md 55-spotlight.rules)
61+
add_custom_target(non-sources SOURCES README.md LICENSE.md)
5262

5363
# Install
5464
install(TARGETS projecteur DESTINATION bin)
65+
set(PROJECTEUR_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/bin/projecteur")
5566

5667
# Use udev.pc pkg-config file to set the dir path
5768
if (NOT CMAKE_INSTALL_UDEVRULESDIR)
@@ -74,4 +85,41 @@ endif(NOT CMAKE_INSTALL_UDEVRULESDIR)
7485
set (CMAKE_INSTALL_UDEVRULESDIR ${UDEVDIR}/rules.d CACHE PATH "Where to install udev rules")
7586
mark_as_advanced(CMAKE_INSTALL_UDEVRULESDIR)
7687

77-
install(FILES 55-spotlight.rules DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR}/)
88+
# Configure and install files
89+
set(DEVICE_USER_GROUP spotlight-device)
90+
set(OUTDIR "${CMAKE_CURRENT_BINARY_DIR}")
91+
set(TMPLDIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates")
92+
93+
configure_file("55-spotlight.rules.in" "55-spotlight.rules" @ONLY)
94+
install(FILES "${OUTDIR}/55-spotlight.rules" DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR}/)
95+
96+
install(FILES icons/projecteur-tray.svg DESTINATION /usr/share/icons/hicolor/48x48/apps/ RENAME projecteur.svg)
97+
install(FILES icons/projecteur-tray.svg DESTINATION /usr/share/icons/hicolor/64x64/apps/ RENAME projecteur.svg)
98+
install(FILES icons/projecteur-tray.svg DESTINATION /usr/share/icons/hicolor/128x128/apps/ RENAME projecteur.svg)
99+
install(FILES icons/projecteur-tray.svg DESTINATION /usr/share/icons/hicolor/256x256/apps/ RENAME projecteur.svg)
100+
101+
configure_file("${TMPLDIR}/Projecteur.desktop.in" "projecteur.desktop" @ONLY)
102+
install(FILES "${OUTDIR}/projecteur.desktop" DESTINATION /usr/share/applications/)
103+
104+
configure_file("${TMPLDIR}/preinst.in" "pkg/scripts/preinst" @ONLY)
105+
configure_file("${TMPLDIR}/postinst.in" "pkg/scripts/postinst" @ONLY)
106+
107+
set(HOMEPAGE "https://github.com/jahnf/Projecteur")
108+
109+
# Add 'dist-package' target: Creates a deb/rpm/tgz package depending on the current Linux distribution
110+
include(LinuxPackaging)
111+
add_dist_package_target(
112+
PROJECT "${CMAKE_PROJECT_NAME}"
113+
TARGET projecteur
114+
DESCRIPTION_BRIEF "Linux/X11 application for the Logitech Spotlight device."
115+
DESCRIPTION_FULL "Linux/X11 application for the Logitech Spotlight device.\nHomepage: ${HOMEPAGE}"
116+
CONTACT "Jahn Fuchs <[email protected]>"
117+
HOMEPAGE "${HOMEPAGE}"
118+
DEBIAN_SECTION "utils"
119+
PREINST_SCRIPT "${OUTDIR}/pkg/scripts/preinst"
120+
POSTINST_SCRIPT "${OUTDIR}/pkg/scripts/postinst"
121+
)
122+
123+
# Add 'source-archive' target
124+
add_source_archive_target(projecteur)
125+

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018, Jahn Fuchs
1+
Copyright 2018-2019, Jahn Fuchs
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
44
associated documentation files (the "Software"), to deal in the Software without restriction,

README.md

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33
develop: [![Build Status develop](https://travis-ci.org/jahnf/Projecteur.svg?branch=develop)](https://travis-ci.org/jahnf/Projecteur)
44
master: [![Build Status master](https://travis-ci.org/jahnf/Projecteur.svg?branch=master)](https://travis-ci.org/jahnf/Projecteur)
55

6-
Linux/X11 application for the Logitech Spotlight device.
6+
Linux/X11 application for the Logitech Spotlight device. \
7+
See [Download](#download) section for binary packages.
78

89
Copyright 2018-2019 [Jahn Fuchs](mailto:[email protected])
910

1011
## Motivation
1112

1213
I saw the Logitech Spotlight device in action at a conference and liked it
13-
immediately. Unfortenately as in a lot of cases software is only provided for Windows
14+
immediately. Unfortunately as in a lot of cases software is only provided for Windows
1415
and Mac. The device itself works just fine on Linux, but the cool spot feature
1516
is done by additional software.
1617

1718
So here it is: a Linux application for the Logitech Spotlight.
1819

1920
## Features
2021

21-
* Configurable desktop spotlight. Configure color, opacity, cursor, center dot.
22+
* Configurable desktop spotlight. Configure color, opacity, cursor, center dot and shape.
2223
* Multiple screen support
2324

2425
![Settings](./doc/screenshot-settings.png)
@@ -38,24 +39,41 @@ The mouse input device sends relative cursor coordinates and left button presses
3839
The keyboard device basically just sends left and right arrow key events when
3940
forward or back on the device is pressed.
4041

41-
The dectected mouse input device is what we are interested in. Since it's
42+
The detected mouse input device is what we are interested in. Since it's
4243
already detected as a mouse input device and able to move the cursor, we will
4344
simply detect if it is the Spotlight device which is sending mouse events.
4445
If it is sending mouse events, we will 'turn on' the desktop spot.
4546

4647
For more details: Have a look at the source code ;)
4748

49+
## Download
50+
51+
The latest automatically built binary packages for some Linux distributions
52+
can be downloaded from bintray:
53+
54+
Make sure to add the user running the application to the `spotlight-device` group
55+
after package installation. This group is created during installation of the binary packages.
56+
_Note_: When adding your user to a new group you will need to login and logout again
57+
for the change to take full effect.
58+
59+
Latest develop:
60+
[ ![Download](https://api.bintray.com/packages/jahnf/Projecteur/projecteur-develop/images/download.svg) ](https://bintray.com/jahnf/Projecteur/projecteur-develop/_latestVersion#files)
61+
62+
Latest release:
63+
[ ![Download](https://api.bintray.com/packages/jahnf/Projecteur/projecteur-master/images/download.svg) ](https://bintray.com/jahnf/Projecteur/projecteur-master/_latestVersion#files)
64+
4865
## Building
4966

5067
### Requirements
5168

5269
* C++11 compiler
5370
* CMake 3.6 or later
54-
* Qt 5.9 and later
71+
* Qt 5.6 and later
5572

5673
### Build Example
5774

58-
Note: You can ommit setting the `QTDIR` variable, CMake will then usually find the Qt versin that comes with the distribution's packacke management.
75+
Note: You can omit setting the `QTDIR` variable, CMake will then usually find
76+
the Qt version that comes with the distribution's package management.
5977

6078
> git clone https://github.com/jahnf/projecteur
6179
> cd projecteur
@@ -67,18 +85,87 @@ Note: You can ommit setting the `QTDIR` variable, CMake will then usually find t
6785

6886
### Pre-requisites
6987

88+
#### When using pre-built binary packages
89+
90+
Make sure to add the user running the application to the `spotlight-device` group
91+
after package installation. This group is created during installation of the binary packages. \
92+
_Note_: When adding your user to a new group you will need to login and logout again
93+
for the change to take full effect.
94+
95+
#### When building Projecteur yourself
96+
7097
The input devices detected from the Spotlight device must be readable to the
7198
user running the application. To make this easier there is a udev rule template
72-
file in this repository: `55-spotlight.rules`
99+
file in this repository: `55-spotlight.rules.in`
73100

74-
* Copy this file to /etc/udev/rules.d/55-spotlight.rules and update the
75-
'plugdev' group in the file to a group you are a member in
101+
* Copy that file to `/etc/udev/rules.d/55-spotlight.rules` and replace the
102+
'@DEVICE_USER_GROUP@' in the file with a group your user is a member in
76103
* Run `sudo udevadm control --reload-rules` and `sudo udevadm trigger` to load
77104
the rules without a reboot.
78105
* After that the two input devices from the Logitech USB Receiver in /dev/input
79-
should have the group 'plugdev', i.e. the group you configure in the rules file.
106+
should have the group you used, i.e. the group you configured in the rules file.
107+
* When building against the Qt version that comes with your distribution's packages
108+
you might need to install some additional QML module packages. For example this
109+
is the case for Ubuntu, where you need to install the packages
110+
`qml-module-qtgraphicaleffrects`, `qml-module-qtquick-window2` and `qml-modules-qtquick2`
111+
to satisfy the application's runtime dependencies.
80112

81113
### Application Menu
82114

83115
The application menu is accessable via the system tray icon. There you will find
84116
the preferences and the menu entry to exit the application.
117+
118+
### Command Line Interface
119+
120+
Additional to the standard `--help` and `--version` options, there is an option to send
121+
commands to a running instance of _Projecteur_.
122+
123+
```
124+
Usage: projecteur [option]
125+
126+
<Options>
127+
-h, --help Show command line usage.
128+
-v, --version Print application version.
129+
-c COMMAND Send command to a running instance.
130+
131+
<Commands>
132+
spot=[on|off] Turn spotlight on/off.
133+
settings=[show|hide] Show/hide preferences dialog.
134+
quit Quit the running instance.
135+
```
136+
137+
### Troubleshooting
138+
139+
#### Missing System Tray
140+
141+
_Projecteur_ was developed and tested on GNOME and KDE Desktop environments, but should
142+
work on most other desktop environments. If the system tray with the _Application Menu_
143+
is not showing, commands can be send to the application to bring up the preferences
144+
dialog, to test the spotlight or quit the application.
145+
See [Command Line Interface](#command-line-interface).
146+
147+
#### Wayland
148+
149+
While not developed with Wayland in mind, some users reported _Projecteur_ works with
150+
Wayland. If you experience problems, you can try to set the `QT_QPA_PLATFORM` environment
151+
variable to `wayland`:
152+
153+
```
154+
user@ubuntu1904:~/Projecteur/build$ QT_QPA_PLATFORM=wayland ./projecteur
155+
Using Wayland-EGL
156+
```
157+
158+
#### Device shows as not connected
159+
160+
If the device shows as not connected, there are some things you can do:
161+
162+
* Make sure the device is detected by the Linux system: Run
163+
`cat /proc/bus/input/devices | grep -A 3 "Vendor=046d"` \
164+
This should show one or multiple spotlight devices (among other Logitech devices)
165+
* Make sure the detected devices have the correct user/group asssigned. \
166+
Run `ls -al /dev/input/event* | grep spotlight`
167+
(or replace `spotlight` by a string that matches the group you put into the
168+
udev rule file in case you edited it yourself). \
169+
* Make sure you don't have conflicting udev rules installed, e.g. first you installed
170+
the udev rule yourself and later you used the automatically built Linux packages to
171+
install _Projecteur_.

0 commit comments

Comments
 (0)