Skip to content

Commit

Permalink
Remove references to my (old) domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjadev64 committed Sep 23, 2024
1 parent 33cd7ab commit f9639be
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 40 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ jobs:
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libudev-dev
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: install Tauri v2 CLI
run: npm install -g @tauri-apps/cli@~2.0.0-rc

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tauriScript: tauri
tagName: v__VERSION__
releaseName: "OpenDeck v__VERSION__"
releaseBody: "See the assets to download this version. See the README for installation instructions."
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenDeck

OpenDeck is a desktop application for interfacing between human interface devices with keys or encoders and plugins, which provide actions to be carried out when the user interacts with the device. OpenDeck conforms to the [OpenAction](https://openaction.amansprojects.com/) API, which is cross-compatible with the Stream Deck SDK, allowing a wide range of pre-existing plugins to be used.
OpenDeck is a desktop application for interfacing between human interface devices with keys or encoders and plugins, which provide actions to be carried out when the user interacts with the device. OpenDeck conforms to the [OpenAction](https://openaction.amankhanna.me/) API, which is cross-compatible with the Stream Deck SDK, allowing a wide range of pre-existing plugins to be used.

OpenDeck supports ProntoKey, Elgato Stream Deck and AKP153 (not AKP153e) hardware on all three major desktop platforms. If you would like to contribute support for additional hardware (e.g. Loupedeck) feel free to reach out on any of the support forums and make a pull request!

Expand Down Expand Up @@ -49,17 +49,17 @@ To enable automatic launch on startup, the light theme, or to change the languag
### Solutions to frequent problems

- Check the OpenDeck log file for any important messages. This file should be included with any support request.
- GNU+Linux: `~/config/com.amansprojects.opendeck/logs/`
- Windows: `%appdata%\com.amansprojects.opendeck\logs\`
- macOS: `~/Library/Application Support/com.amansprojects.opendeck/logs/`
- GNU+Linux: `~/.config/opendeck/logs/`
- Windows: `%appdata%\opendeck\logs\`
- macOS: `~/Library/Application Support/opendeck/logs/`
- For issues with plugins, you can also check the plugin's logs (in the same folder as above, sometimes as well as a file named `plugin.log` or similar in the plugin's own folder).
- When trying to run Windows-only plugins (which are the majority of plugins) on GNU+Linux or macOS, please ensure you have the latest version of Wine (and Wine Mono) installed on your system.
- If your device isn't showing up, ensure you have the correct permissions to access it, and that you have restarted OpenDeck since connecting it.

### Support forums

- [Discord](https://discord.gg/26Nf8rHvaj)
- [Matrix](https://matrix.to/#/#opendeck:amansprojects.com)
- [Matrix](https://matrix.to/#/#opendeck:amankhanna.me)
- [GitHub Issues](https://github.com/ninjadev64/OpenDeck/issues)

### Building from source / contributing
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/src/events/frontend/instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn create_instance(app: AppHandle, action: Action, context: Context) -
};
children.push(instance.clone());

if parent.action.uuid == "com.amansprojects.opendeck.toggleaction" && parent.states.len() < children.len() {
if parent.action.uuid == "opendeck.toggleaction" && parent.states.len() < children.len() {
parent.states.push(crate::shared::ActionState {
image: "opendeck/toggle-action.png".to_owned(),
..Default::default()
Expand All @@ -50,7 +50,7 @@ pub async fn create_instance(app: AppHandle, action: Action, context: Context) -
states: action.states.clone(),
current_state: 0,
settings: serde_json::Value::Object(serde_json::Map::new()),
children: if matches!(action.uuid.as_str(), "com.amansprojects.opendeck.multiaction" | "com.amansprojects.opendeck.toggleaction") {
children: if matches!(action.uuid.as_str(), "opendeck.multiaction" | "opendeck.toggleaction") {
Some(vec![])
} else {
None
Expand Down Expand Up @@ -132,7 +132,7 @@ pub async fn remove_instance(context: ActionContext) -> Result<(), Error> {
break;
}
}
if instance.action.uuid == "com.amansprojects.opendeck.toggleaction" {
if instance.action.uuid == "opendeck.toggleaction" {
if instance.current_state as usize >= children.len() {
instance.current_state = if children.is_empty() { 0 } else { children.len() as u16 - 1 };
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/events/frontend/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub async fn list_plugins() -> Result<Vec<PluginInfo>, Error> {

#[command]
pub async fn install_plugin(app: AppHandle, id: String, url: Option<String>) -> Result<(), Error> {
let resp = match reqwest::get(url.unwrap_or(format!("https://plugins.amansprojects.com/rezipped/{id}.zip"))).await {
let resp = match reqwest::get(url.unwrap_or(format!("https://plugins.amankhanna.me/rezipped/{id}.zip"))).await {
Ok(resp) => resp,
Err(error) => return Err(anyhow::Error::from(error).into()),
};
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/events/frontend/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub async fn set_selected_profile(device: String, id: String) -> Result<(), Erro
if selected_profile != id {
let old_profile = &profile_stores.get_profile_store(devices.get(&device).unwrap(), &selected_profile)?.value;
for instance in old_profile.keys.iter().flatten().chain(&mut old_profile.sliders.iter().flatten()) {
if !matches!(instance.action.uuid.as_str(), "com.amansprojects.opendeck.multiaction" | "com.amansprojects.opendeck.toggleaction") {
if !matches!(instance.action.uuid.as_str(), "opendeck.multiaction" | "opendeck.toggleaction") {
let _ = crate::events::outbound::will_appear::will_disappear(instance, false).await;
} else {
for child in instance.children.as_ref().unwrap() {
Expand All @@ -46,7 +46,7 @@ pub async fn set_selected_profile(device: String, id: String) -> Result<(), Erro
let store = profile_stores.get_profile_store_mut(devices.get(&device).unwrap(), &id).await?;
let new_profile = &store.value;
for instance in new_profile.keys.iter().flatten().chain(&mut new_profile.sliders.iter().flatten()) {
if !matches!(instance.action.uuid.as_str(), "com.amansprojects.opendeck.multiaction" | "com.amansprojects.opendeck.toggleaction") {
if !matches!(instance.action.uuid.as_str(), "opendeck.multiaction" | "opendeck.toggleaction") {
let _ = crate::events::outbound::will_appear::will_appear(instance, false).await;
} else {
for child in instance.children.as_ref().unwrap() {
Expand Down
8 changes: 4 additions & 4 deletions src-tauri/src/events/outbound/keypad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub async fn key_down(device: &str, key: u8) -> Result<(), anyhow::Error> {
let _ = key_moved(crate::APP_HANDLE.get().unwrap(), context.clone(), true).await;

let Some(instance) = get_slot_mut(&context, &mut locks).await? else { return Ok(()) };
if instance.action.uuid == "com.amansprojects.opendeck.multiaction" {
if instance.action.uuid == "opendeck.multiaction" {
for child in instance.children.as_mut().unwrap() {
send_to_plugin(
&child.action.plugin,
Expand Down Expand Up @@ -71,7 +71,7 @@ pub async fn key_down(device: &str, key: u8) -> Result<(), anyhow::Error> {
}

save_profile(device, &mut locks).await?;
} else if instance.action.uuid == "com.amansprojects.opendeck.toggleaction" {
} else if instance.action.uuid == "opendeck.toggleaction" {
let children = instance.children.as_ref().unwrap();
if children.is_empty() {
return Ok(());
Expand Down Expand Up @@ -120,7 +120,7 @@ pub async fn key_up(device: &str, key: u8) -> Result<(), anyhow::Error> {
let slot = get_slot_mut(&context, &mut locks).await?;
let Some(instance) = slot else { return Ok(()) };

if instance.action.uuid == "com.amansprojects.opendeck.toggleaction" {
if instance.action.uuid == "opendeck.toggleaction" {
let index = instance.current_state as usize;
let children = instance.children.as_ref().unwrap();
if children.is_empty() {
Expand All @@ -139,7 +139,7 @@ pub async fn key_up(device: &str, key: u8) -> Result<(), anyhow::Error> {
)
.await?;
instance.current_state = ((index + 1) % instance.children.as_ref().unwrap().len()) as u16;
} else if instance.action.uuid != "com.amansprojects.opendeck.multiaction" {
} else if instance.action.uuid != "opendeck.multiaction" {
if instance.states.len() == 2 && !instance.action.disable_automatic_states {
instance.current_state = (instance.current_state + 1) % (instance.states.len() as u16);
}
Expand Down
6 changes: 6 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ async fn main() {
let menu = MenuBuilder::new(app).items(&[&open, &hide, &separator, &quit]).build()?;
let _tray = TrayIconBuilder::new()
.menu(&menu)
.icon(app.default_window_icon().unwrap().clone())
.on_menu_event(move |app, event| {
let window = app.get_webview_window("main").unwrap();
let _ = match event.id().as_ref() {
Expand Down Expand Up @@ -110,6 +111,11 @@ async fn main() {

APP_HANDLE.set(app.handle().clone()).unwrap();

let old = app.path().config_dir().unwrap().join("com.amansprojects.opendeck");
if old.exists() {
let _ = std::fs::rename(old, app.path().app_config_dir().unwrap());
}

devices::initialise_devices();
plugins::initialise_plugins();

Expand Down
8 changes: 4 additions & 4 deletions src-tauri/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ pub static CATEGORIES: Lazy<RwLock<HashMap<String, Vec<Action>>>> = Lazy::new(||
r#"{
"name": "Multi Action",
"icon": "opendeck/multi-action.png",
"plugin": "com.amansprojects.opendeck",
"uuid": "com.amansprojects.opendeck.multiaction",
"plugin": "opendeck",
"uuid": "opendeck.multiaction",
"tooltip": "Execute multiple actions",
"controllers": [ "Keypad" ],
"states": [ { "image": "opendeck/multi-action.png" } ],
Expand All @@ -234,8 +234,8 @@ pub static CATEGORIES: Lazy<RwLock<HashMap<String, Vec<Action>>>> = Lazy::new(||
r#"{
"name": "Toggle Action",
"icon": "opendeck/toggle-action.png",
"plugin": "com.amansprojects.opendeck",
"uuid": "com.amansprojects.opendeck.toggleaction",
"plugin": "opendeck",
"uuid": "opendeck.toggleaction",
"tooltip": "Cycle through multiple actions",
"controllers": [ "Keypad" ],
"states": [ { "image": "opendeck/toggle-action.png" } ],
Expand Down
36 changes: 27 additions & 9 deletions src-tauri/src/store/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::fs;
use std::path::PathBuf;

use serde::{Deserialize, Serialize};
use serde_json::Value;

use anyhow::Context;
use once_cell::sync::Lazy;
Expand Down Expand Up @@ -164,8 +165,8 @@ impl From<ProfileV1> for DiskProfile {
keys.push(Some(DiskActionInstance {
action: Action {
name: "Multi Action".to_owned(),
uuid: "com.amansprojects.opendeck.multiaction".to_owned(),
plugin: "com.amansprojects.opendeck".to_owned(),
uuid: "opendeck.multiaction".to_owned(),
plugin: "opendeck".to_owned(),
tooltip: "Execute multiple actions".to_owned(),
icon: "opendeck/multi-action.png".to_owned(),
disable_automatic_states: false,
Expand All @@ -185,7 +186,7 @@ impl From<ProfileV1> for DiskProfile {
..Default::default()
}],
current_state: 0,
settings: serde_json::Value::Object(serde_json::Map::new()),
settings: Value::Object(serde_json::Map::new()),
children: Some(children.into_iter().map(|v| v.into()).collect()),
}));
} else {
Expand Down Expand Up @@ -215,13 +216,30 @@ enum ProfileVersions {

fn migrate_profile(path: PathBuf) -> Result<(), anyhow::Error> {
let profile = serde_json::from_slice(&fs::read(&path)?)?;
if let ProfileVersions::V1(v1) = profile {
let migrated: DiskProfile = v1.into();
fs::write(path, serde_json::to_string_pretty(&migrated)?)?;
} else if let ProfileVersions::V2(v2) = profile {
let migrated: DiskProfile = (&v2).into();
fs::write(path, serde_json::to_string_pretty(&migrated)?)?;
let migrated: DiskProfile = match profile {
ProfileVersions::V1(v1) => v1.into(),
ProfileVersions::V2(v2) => (&v2).into(),
ProfileVersions::V3(v3) => v3,
};
let mut as_value = serde_json::to_value(migrated)?;
fn replace_old_identifier(value: &mut Value) {
match value {
Value::String(v) => *v = v.replace("com.amansprojects.opendeck", "opendeck"),
Value::Object(v) => {
for value in v.values_mut() {
replace_old_identifier(value);
}
}
Value::Array(v) => {
for value in v.iter_mut() {
replace_old_identifier(value);
}
}
_ => (),
}
}
replace_old_identifier(&mut as_value);
fs::write(path, serde_json::to_string_pretty(&as_value)?)?;
Ok(())
}

Expand Down
5 changes: 1 addition & 4 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"productName": "OpenDeck",
"mainBinaryName": "opendeck",
"version": "2.0.0",
"identifier": "com.amansprojects.opendeck",
"identifier": "opendeck",
"plugins": {},
"app": {
"windows": [
Expand All @@ -53,9 +53,6 @@
"center": true
}
],
"trayIcon": {
"iconPath": "icons/icon.png"
},
"security": {
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://localhost:57118 https://ninjadev64.github.io https://plugins.amankhanna.me; frame-src http://localhost:57118; connect-src ipc: http://ipc.localhost https://ninjadev64.github.io https://api.github.com https://plugins.amankhanna.me;"
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Key.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
function select() {
if (!slot) return;
if (slot.action.uuid == "com.amansprojects.opendeck.multiaction" || slot.action.uuid == "com.amansprojects.opendeck.toggleaction") {
if (slot.action.uuid == "opendeck.multiaction" || slot.action.uuid == "opendeck.toggleaction") {
inspectedParentAction.set(context);
} else {
inspectedInstance.set(slot.context);
Expand Down
8 changes: 4 additions & 4 deletions src/components/ParentActionView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
if (dataTransfer?.getData("action")) {
let action = JSON.parse(dataTransfer?.getData("action"));
if (
(parentUuid == "com.amansprojects.opendeck.multiaction" && !action.supported_in_multi_actions) ||
(parentUuid == "opendeck.multiaction" && !action.supported_in_multi_actions) ||
(
parentUuid == "com.amansprojects.opendeck.toggleaction" &&
(action.uuid == "com.amansprojects.opendeck.multiaction" || action.uuid == "com.amansprojects.opendeck.toggleaction")
parentUuid == "opendeck.toggleaction" &&
(action.uuid == "opendeck.multiaction" || action.uuid == "opendeck.toggleaction")
)
) {
return;
Expand All @@ -50,7 +50,7 @@

<div class="px-6 pt-6 pb-4 dark:text-neutral-300">
<button class="float-right text-xl" on:click={() => $inspectedParentAction = null}> ✕ </button>
<h1 class="font-semibold text-2xl"> {parentUuid == "com.amansprojects.opendeck.toggleaction" ? "Toggle Action" : "Multi Action"} </h1>
<h1 class="font-semibold text-2xl"> {parentUuid == "opendeck.toggleaction" ? "Toggle Action" : "Multi Action"} </h1>
</div>

<div class="flex flex-col h-80 overflow-scroll">
Expand Down
4 changes: 2 additions & 2 deletions src/components/PluginManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</div>
{/if}

{#await fetch("https://plugins.amansprojects.com/catalogue.json")}
{#await fetch("https://plugins.amankhanna.me/catalogue.json")}
<h2 class="mx-2 mt-6 mb-2 text-md dark:text-neutral-400"> Loading plugin list... </h2>
{:then res}
{#await res.json() then entries}
Expand All @@ -227,7 +227,7 @@
<div class="grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{#each entries as plugin}
<ListedPlugin
icon="https://plugins.amansprojects.com/icons/{plugin.id}.png"
icon="https://plugins.amankhanna.me/icons/{plugin.id}.png"
name={plugin.name}
subtitle={plugin.author}
hidden={!plugin.name.toUpperCase().includes(search.toUpperCase())}
Expand Down

0 comments on commit f9639be

Please sign in to comment.