-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use comfortable-swipe as systemd service #15
Closed
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2dbc2be
[feature-systemd] Run comfortable-swipe as a service
Hikari9 a84ff2a
[feature-systemd] Modify source file to adapt to service changes
Hikari9 3969b69
[feature-systemd] Update README
Hikari9 f797290
[feature-systemd] Fix autostart errors by handling Environment variables
Hikari9 08e08a0
[feature-systemd] Change target to graphical.target and add hook afte…
Hikari9 7900cc9
[feature-systemd] Defer order of error checking for efficiency
Hikari9 8b9b960
[feature-systemd] Clarify status logging for service
Hikari9 10fbe13
[feature-systemd] Provide sleep before installation success message
Hikari9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
#!/bin/bash | ||
if [ $(id -u) != "0" ]; then | ||
sudo bash "$0" "$@" | ||
exit $? | ||
fi | ||
echo "Uninstalling..." | ||
rm ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/comfortable-swipe.desktop 2> /dev/null | ||
comfortable-swipe stop 2> /dev/null | ||
rm $HOME/.local/bin/comfortable-swipe 2> /dev/null # compat | ||
rm /usr/local/bin/comfortable-swipe 2> /dev/null | ||
echo " | ||
Uninstall $(date)" >> .log | ||
|
||
# stop service | ||
systemctl stop comfortable-swipe.service >> .log 2>> .log | ||
systemctl disable comfortable-swipe.service >> .log 2>> .log | ||
systemctl daemon-reload | ||
|
||
# remove service | ||
SERVICE_PATH="/lib/systemd/system/comfortable-swipe.service" | ||
rm $SERVICE_PATH >> .log 2>> .log | ||
|
||
# remove old program | ||
OLD_PROGRAM=$HOME/.local/bin/comfortable-swipe | ||
rm $OLD_PROGRAM >> .log 2>> .log # compat | ||
|
||
# remove program | ||
PROGRAM=/usr/local/bin/comfortable-swipe | ||
rm $PROGRAM >> .log 2>> .log | ||
echo "Successfully uninstalled comfortable-swipe" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the cause of this is the
sleep(1)
which delays 1 second before executing. This was intended delay for the autostart, but I guess your point makes sense that there's no such need when one just wants to run it normally.I'm looking for ways to activate it without the delay (using purely dependencies), but I still can't find an appropriate line of code for this to work. If it helps, the current service unit looks like:
As of now, autostart won't work without the delay, so maybe I'm missing a dependency? I'm not sure. If anyone knows someone who can help out with this, that will be helpful.
Cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I fully understand.
I'm using the master branch (sorry for not clarifying earlier). So there's no sleep(1) in the cpp file.
Was that introduced to "workaround" the mentioned delay?
To me it sounds like the delay in the code concerns the start of the program. The delay I mentioned happens for the execution of a swipe while the program is running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for misunderstanding, @schigum , I thought it was related to this PR, but it seems I was mistaken. Will reopen issue #16