Skip to content

Commit

Permalink
Merge pull request #8 from nerdy0901/add-kwin-system76-scheduler
Browse files Browse the repository at this point in the history
Add kwin system76 scheduler
  • Loading branch information
nerdy0901 authored Nov 19, 2023
2 parents 59686c8 + c3a56fa commit 0034bde
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions config/files/usr/bin/system76-scheduler-dbus-proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
DBUS_SERVICE="com.system76.Scheduler"
DBUS_PATH="/com/system76/Scheduler"
DBUS_INTERFACE="com.system76.Scheduler"
DBUS_METHOD="SetForegroundProcess"
dbus-monitor "destination=$DBUS_SERVICE,path=$DBUS_PATH,interface=$DBUS_INTERFACE,member=$DBUS_METHOD" |
while true; do
read method call time sender _ dest serial path interface member
read type pid
[ "$member" = "member=$DBUS_METHOD" ] && qdbus --system $DBUS_SERVICE $DBUS_PATH $DBUS_INTERFACE.$DBUS_METHOD $pid
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Forward com.system76.Scheduler session DBus messages to the system bus

[Service]
ExecStart=/usr/bin/system76-scheduler-dbus-proxy

[Install]
WantedBy=default.target
2 changes: 1 addition & 1 deletion config/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ modules:
- fish
- system76-scheduler
- input-remapper

remove:
- firefox # default firefox removed in favor of flatpak
- firefox-langpacks # langpacks needs to also be removed to prevent dependency problems
Expand All @@ -47,6 +46,7 @@ modules:
scripts:
# this sets up the proper policy & signing files for signed images to work
- signing.sh
- install-kwin-system76-scheduler-integration.sh

- type: systemd
system:
Expand Down
14 changes: 14 additions & 0 deletions config/scripts/install-kwin-system76-scheduler-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Tell this script to exit if there are any errors.
# You should have this in every custom script, to ensure that your completed
# builds actually ran successfully without any errors!
set -oue pipefail

# Your code goes here.
echo 'Install KWin Script for system76-scheduler Integration'

git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git --depth 1 /tmp/kwin-system76-scheduler-integration
kpackagetool5 --type=KWin/Script --global --install /tmp/kwin-system76-scheduler-integration
rm -rf /tmp/kwin-system76-scheduler-integration
systemctl --global enable com.system76.Scheduler.dbusproxy.service

0 comments on commit 0034bde

Please sign in to comment.