Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
feat: opentabletdriver setup + kde-wallpaper-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz committed Mar 8, 2024
1 parent 26cfeab commit fbc2a58
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 10 deletions.
3 changes: 3 additions & 0 deletions config/common/plasma/scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: script-nu
scripts:
- kde-wallpaper-engine.nu
8 changes: 1 addition & 7 deletions config/files/shared/libexec/atomic-studio-cli/add.nu
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/usr/bin/env -S nu

use lib/distrobox.nu [gen_export_string, DISTROBOX_DOWNLOAD_URL]
use lib/distrobox.nu [gen_export_string, DISTROBOX_DOWNLOAD_URL, distroboxes]
use lib/std.nu [fancy_prompt_message, user_prompt]

const valid_package_managers = ["apt", "brew", "nix", "dnf", "yum", "paru", "pacman", "pipx"]
const distroboxes = [
["aliases","name", "image", "description"];
["ubuntu", "ubuntubox", "ghcr.io/ublue-os/ubuntu-toolbox:latest", "Ubuntu based distrobox"]
["arch", "archbox", "ghcr.io/ublue-os/arch-distrobox:latest", "Arch Linux based distrobox with paru pre-installed"]
["fedora", "fedorabox", "ghcr.io/ublue-os/fedora-toolbox", "Fedora based distrobox"]
]

# Export selected packages from selected subsystem to the host system
export def "main add export" [
Expand Down
2 changes: 1 addition & 1 deletion config/files/shared/libexec/atomic-studio-cli/davinci.nu
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export def "main davinci remove" [

# Install Davinci Resolve in a compatible distrobox
export def "main davinci" [
--yes (-y) # Skip all confirmation prompts,
--yes (-y) # Skip all confirmation prompts
--box_name: string # Name of the distrobox where davinci-installer will be run from
script_path: string # The script that will be run to install Davinci Resolve
] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ export const DISTROBOX_DOWNLOAD_URL = "https://raw.githubusercontent.com/89luca8
export def gen_export_string [package: string, export_Path: string] {
return $"distrobox-export --app ($package) ; distrobox-export --export-path ($export_Path) --bin /usr/bin/($package)"
}

export const distroboxes = [
["aliases","name", "image", "description"];
["ubuntu", "ubuntubox", "ghcr.io/ublue-os/ubuntu-toolbox:latest", "Ubuntu based distrobox"]
["arch", "archbox", "ghcr.io/ublue-os/arch-distrobox:latest", "Arch Linux based distrobox with paru pre-installed"]
["fedora", "fedorabox", "ghcr.io/ublue-os/fedora-toolbox", "Fedora based distrobox"]
]
1 change: 1 addition & 0 deletions config/files/shared/libexec/atomic-studio-cli/mod.nu
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export use reporter.nu *
export use speaker-test.nu *
export use update.nu *
export use pw.nu *
export use setup.nu *
58 changes: 58 additions & 0 deletions config/files/shared/libexec/atomic-studio-cli/setup.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
use lib/std.nu [user_prompt, fancy_prompt_message]
use lib/distrobox.nu [DISTROBOX_DOWNLOAD_URL, distroboxes]

const opentabletdriver_service = "
[Unit]
Description=OpenTabletDriver Daemon
PartOf=graphical-session.target
After=graphical-session.target
ConditionEnvironment=|WAYLAND_DISPLAY
ConditionEnvironment=|DISPLAY
[Service]
ExecStart=/usr/bin/distrobox-enter -n archbox -- ' /usr/bin/otd-daemon'
Restart=always
RestartSec=3
[Install]
WantedBy=graphical-session.target
"

# Setup Atomic Studio supported apps
export def "main setup" [] {
echo "Usage setup <subcommand>."
}

# Install Davinci Resolve in a compatible distrobox
export def "main setup opentabletdriver" [
--yes (-y) # Skip all confirmation prompts
] {
if (which distrobox | length) == 0 {
fancy_prompt_message "Distrobox"
if not (user_prompt $yes) {
return
}
curl -s $DISTROBOX_DOWNLOAD_URL | pkexec sh
}

let archbox_entry = ($distroboxes | select aliases name image | where aliases == arch).0

try { distrobox ls | grep ($archbox_entry.name) } catch {
fancy_prompt_message "The Arch Linux subsystem"
if not (user_prompt $yes) {
return
}
distrobox create -i $archbox_entry.image --name $archbox_entry.name -Y --pull
}

distrobox enter -n $archbox_entry.name -- ' paru -S opentabletdriver --noconfirm'
mkdir $"($env.HOME)/.config/systemd/user"
try { rm -f $"($env.HOME)/.config/systemd/user/($archbox_entry.name)-opentabletdriver.service" } catch { }

$opentabletdriver_service | save -f $"($env.HOME)/.config/systemd/user/($archbox_entry.name)-opentabletdriver.service"

systemctl --user daemon-reload
systemctl enable --user --now $"($archbox_entry.name)-opentabletdriver.service"

distrobox enter -n $archbox_entry.name -- 'distrobox-export --app otd-gui'
}
9 changes: 7 additions & 2 deletions config/files/shared/share/ublue-os/firstboot/yafti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ screens:
description: Add certain user groups and kernel arguments for your user in order to use realtime applications properly
default: false
packages:
- Add realtime group: pkexec studio pw enable realtime
- Add realtime group: pkexec studio pw enable realtime
OpenTabletDriver:
description: Setup OpenTabletDriver, a FOSS alternative to the proprietary wacom drivers
default: true
packages:
- Setup OTD: studio setup opentabletdriver
Davinci Box:
description: Reproducible and descartable environment for installing Davinci Resolve - Make sure to install Davinci Resolve inside of davincibox.
description: Reproducible and descartable environment for installing Davinci Resolve - Make sure to install Davinci Resolve inside of davincibox with the "studio davinci" command.
default: false
condition:
run: distrobox list | grep -v davincibox
Expand Down
1 change: 1 addition & 0 deletions config/recipes/hardened/recipe-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ modules:
- from-file: common/shared/services.yml
- from-file: common/plasma/apps.yml
- from-file: common/plasma/files.yml
- from-file: common/plasma/scripts.yml
- from-file: common/audio/pipewire-packages.yml
- from-file: common/audio/audinux.yml
- type: yafti
Expand Down
1 change: 1 addition & 0 deletions config/recipes/hardened/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ modules:
- from-file: common/shared/services.yml
- from-file: common/plasma/apps.yml
- from-file: common/plasma/files.yml
- from-file: common/plasma/scripts.yml
- from-file: common/audio/pipewire-packages.yml
- from-file: common/audio/audinux.yml
- type: yafti
Expand Down
1 change: 1 addition & 0 deletions config/recipes/recipe-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ modules:
- from-file: common/shared/services.yml
- from-file: common/plasma/apps.yml
- from-file: common/plasma/files.yml
- from-file: common/plasma/scripts.yml
- from-file: common/audio/pipewire-packages.yml
- from-file: common/audio/audinux.yml
- type: yafti
Expand Down
1 change: 1 addition & 0 deletions config/recipes/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ modules:
- from-file: common/shared/services.yml
- from-file: common/plasma/apps.yml
- from-file: common/plasma/files.yml
- from-file: common/plasma/scripts.yml
- from-file: common/audio/pipewire-packages.yml
- from-file: common/audio/audinux.yml
- type: yafti
Expand Down
15 changes: 15 additions & 0 deletions config/scripts/kde-wallpaper-engine.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env -S nu
let FEDORA_MAJOR_VERSION = (run-external --redirect-combine rpm '-E' '%fedora' | complete).stdout
const COPR_FILE = "/etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo"

http get $"https://copr.fedorainfracloud.org/coprs/kylegospo/wallpaper-engine-kde-plugin/repo/fedora-($FEDORA_MAJOR_VERSION)/kylegospo-wallpaper-engine-kde-plugin-fedora-($FEDORA_MAJOR_VERSION).repo" | save -f $COPR_FILE

rpm-ostree install wallpaper-engine-kde-plugin

rm -f $COPR_FILE

git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git --depth 1 /tmp/wallpaper-engine-kde-plugin && \

kpackagetool5 --type=Plasma/Wallpaper --global --install /tmp/wallpaper-engine-kde-plugin/plugin

rm -rf /tmp/wallpaper-engine-kde-plugin

0 comments on commit fbc2a58

Please sign in to comment.