Move anime data. Twiddle supergfxctl
2
Makefile
@@ -69,7 +69,7 @@ install:
|
|||||||
|
|
||||||
$(INSTALL_DATA) "./data/_asusctl" "$(DESTDIR)$(zshcpl)/_asusctl"
|
$(INSTALL_DATA) "./data/_asusctl" "$(DESTDIR)$(zshcpl)/_asusctl"
|
||||||
$(INSTALL_DATA) "./data/completions/asusctl.fish" "$(DESTDIR)$(datarootdir)/fish/vendor_completions.d/asusctl.fish"
|
$(INSTALL_DATA) "./data/completions/asusctl.fish" "$(DESTDIR)$(datarootdir)/fish/vendor_completions.d/asusctl.fish"
|
||||||
cd data && find "./anime" -type f -exec install -Dm 755 "{}" "$(DESTDIR)$(datarootdir)/asusd/{}" \;
|
cd rog-anime/data && find "./anime" -type f -exec install -Dm 755 "{}" "$(DESTDIR)$(datarootdir)/asusd/{}" \;
|
||||||
|
|
||||||
$(INSTALL_PROGRAM) "./target/release/$(BIN_SD)" "$(DESTDIR)$(bindir)/$(BIN_SD)"
|
$(INSTALL_PROGRAM) "./target/release/$(BIN_SD)" "$(DESTDIR)$(bindir)/$(BIN_SD)"
|
||||||
$(INSTALL_PROGRAM) "./target/release/$(BIN_SC)" "$(DESTDIR)$(bindir)/$(BIN_SC)"
|
$(INSTALL_PROGRAM) "./target/release/$(BIN_SC)" "$(DESTDIR)$(bindir)/$(BIN_SC)"
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
use log::{error, info, warn};
|
use log::{error, warn};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
|
|
||||||
use crate::VERSION;
|
|
||||||
|
|
||||||
pub static CONFIG_PATH: &str = "/etc/asusd/asusd.conf";
|
pub static CONFIG_PATH: &str = "/etc/asusd/asusd.conf";
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ use std::sync::Arc;
|
|||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use daemon::ctrl_rog_bios::CtrlRogBios;
|
use daemon::ctrl_rog_bios::CtrlRogBios;
|
||||||
use zvariant::ObjectPath;
|
|
||||||
|
|
||||||
static PROFILE_CONFIG_PATH: &str = "/etc/asusd/profile.conf";
|
static PROFILE_CONFIG_PATH: &str = "/etc/asusd/profile.conf";
|
||||||
|
|
||||||
@@ -183,18 +182,18 @@ fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Run zbus server
|
// Run zbus server
|
||||||
object_server
|
// object_server
|
||||||
.with(
|
// .with(
|
||||||
&ObjectPath::from_str_unchecked("/org/asuslinux/Charge"),
|
// &ObjectPath::from_str_unchecked("/org/asuslinux/Charge"),
|
||||||
|obj: &CtrlCharge| {
|
// |obj: &CtrlCharge| {
|
||||||
let x = obj.limit();
|
// let x = obj.limit();
|
||||||
obj.notify_charge(x as u8)
|
// obj.notify_charge(x as u8)
|
||||||
},
|
// },
|
||||||
)
|
// )
|
||||||
.map_err(|err| {
|
// .map_err(|err| {
|
||||||
warn!("object_server notify_charge error: {}", err);
|
// warn!("object_server notify_charge error: {}", err);
|
||||||
})
|
// })
|
||||||
.ok();
|
// .ok();
|
||||||
|
|
||||||
// Loop to check errors and iterate zbus server
|
// Loop to check errors and iterate zbus server
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"anime": [
|
|
||||||
{
|
|
||||||
"AsusAnimation": {
|
|
||||||
"file": "/usr/share/asusd/anime/asus/rog/Sunset.gif",
|
|
||||||
"time": {
|
|
||||||
"Cycles": 1
|
|
||||||
},
|
|
||||||
"brightness": 0.5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ImageAnimation": {
|
|
||||||
"file": "/usr/share/asusd/anime/custom/sonic-run.gif",
|
|
||||||
"scale": 0.9,
|
|
||||||
"angle": 0.65,
|
|
||||||
"translation": [
|
|
||||||
0.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"time": {
|
|
||||||
"Time": {
|
|
||||||
"secs": 5,
|
|
||||||
"nanos": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"brightness": 0.5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Image": {
|
|
||||||
"file": "/usr/share/asusd/anime/custom/rust.png",
|
|
||||||
"scale": 1.0,
|
|
||||||
"angle": 0.0,
|
|
||||||
"translation": [
|
|
||||||
0.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"brightness": 0.6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Pause": {
|
|
||||||
"secs": 6,
|
|
||||||
"nanos": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ImageAnimation": {
|
|
||||||
"file": "/usr/share/asusd/anime/custom/sonic-wait.gif",
|
|
||||||
"scale": 0.9,
|
|
||||||
"angle": 0.0,
|
|
||||||
"translation": [
|
|
||||||
3.0,
|
|
||||||
2.0
|
|
||||||
],
|
|
||||||
"time": {
|
|
||||||
"Cycles": 2
|
|
||||||
},
|
|
||||||
"brightness": 0.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 234 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
@@ -1,3 +1,5 @@
|
|||||||
|
//! Basic CLI tool to control the `supergfxd` daemon
|
||||||
|
|
||||||
use std::{env::args, sync::mpsc::channel};
|
use std::{env::args, sync::mpsc::channel};
|
||||||
use supergfxctl::{
|
use supergfxctl::{
|
||||||
gfx_vendors::{GfxRequiredUserAction, GfxVendors},
|
gfx_vendors::{GfxRequiredUserAction, GfxVendors},
|
||||||
@@ -59,6 +61,7 @@ fn do_gfx(command: CliStart) -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
println!("If anything fails check `journalctl -b -u supergfxd`\n");
|
println!("If anything fails check `journalctl -b -u supergfxd`\n");
|
||||||
|
println!("Note that nvidia-drm.modeset=0 is required in kernel cmdline to enable the nvidia drivers to be unloaded on demand`\n");
|
||||||
|
|
||||||
proxy.gfx_write_mode(&mode).map_err(|err|{
|
proxy.gfx_write_mode(&mode).map_err(|err|{
|
||||||
println!("Graphics mode change error. You may be in an invalid state.");
|
println!("Graphics mode change error. You may be in an invalid state.");
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ impl CtrlGraphics {
|
|||||||
// exit if 3 minutes pass
|
// exit if 3 minutes pass
|
||||||
if Instant::now().duration_since(start_time).as_secs() > 180 {
|
if Instant::now().duration_since(start_time).as_secs() > 180 {
|
||||||
warn!("{}", THREAD_TIMEOUT_MSG);
|
warn!("{}", THREAD_TIMEOUT_MSG);
|
||||||
return Ok(THREAD_TIMEOUT_MSG.into());
|
return Err(GfxError::DisplayManagerTimeout(THREAD_TIMEOUT_MSG.into()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't spin at max speed
|
// Don't spin at max speed
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ use std::{error, process::ExitStatus};
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum GfxError {
|
pub enum GfxError {
|
||||||
ParseVendor,
|
ParseVendor,
|
||||||
ParsePower,
|
|
||||||
Bus(String, std::io::Error),
|
|
||||||
DisplayManagerAction(String, ExitStatus),
|
DisplayManagerAction(String, ExitStatus),
|
||||||
DisplayManagerTimeout(String),
|
DisplayManagerTimeout(String),
|
||||||
AsusGsyncModeActive,
|
AsusGsyncModeActive,
|
||||||
@@ -26,8 +24,6 @@ impl fmt::Display for GfxError {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
GfxError::ParseVendor => write!(f, "Could not parse vendor name"),
|
GfxError::ParseVendor => write!(f, "Could not parse vendor name"),
|
||||||
GfxError::ParsePower => write!(f, "Could not parse dGPU power status"),
|
|
||||||
GfxError::Bus(func, error) => write!(f, "Bus error: {}: {}", func, error),
|
|
||||||
GfxError::DisplayManagerAction(action, status) => {
|
GfxError::DisplayManagerAction(action, status) => {
|
||||||
write!(f, "Display-manager action {} failed: {}", action, status)
|
write!(f, "Display-manager action {} failed: {}", action, status)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
|
/// The configuration for graphics. This should be saved and loaded on boot.
|
||||||
pub mod config;
|
pub mod config;
|
||||||
|
/// Control functions for setting graphics.
|
||||||
pub mod controller;
|
pub mod controller;
|
||||||
|
/// Error: 404
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
/// Mode names, follows what distros defined as common.
|
||||||
pub mod gfx_vendors;
|
pub mod gfx_vendors;
|
||||||
/// Special-case functions for check/read/write of key functions on unique laptops
|
/// Special-case functions for check/read/write of key functions on unique laptops
|
||||||
/// such as the G-Sync mode available on some ASUS ROG laptops
|
/// such as the G-Sync mode available on some ASUS ROG laptops
|
||||||
pub mod special;
|
pub mod special;
|
||||||
|
/// System interface helpers.
|
||||||
pub mod system;
|
pub mod system;
|
||||||
|
/// Defined DBUS Interface for supergfxctl
|
||||||
pub mod zbus_iface;
|
pub mod zbus_iface;
|
||||||
|
/// Defined DBUS Proxy for supergfxctl
|
||||||
pub mod zbus_proxy;
|
pub mod zbus_proxy;
|
||||||
|
|
||||||
|
/// Helper to expose the current crate version to external code
|
||||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
/// Generic path that is used to save the daemon config state
|
||||||
pub const CONFIG_PATH: &str = "/etc/supergfxd.conf";
|
pub const CONFIG_PATH: &str = "/etc/supergfxd.conf";
|
||||||
|
/// Destination name to be used in the daemon when setting up DBUS connection
|
||||||
pub const DBUS_DEST_NAME: &str = "org.supergfxctl.Daemon";
|
pub const DBUS_DEST_NAME: &str = "org.supergfxctl.Daemon";
|
||||||
|
/// Interface path name. Should be common across daemon and client.
|
||||||
pub const DBUS_IFACE_PATH: &str = "/org/supergfxctl/Gfx";
|
pub const DBUS_IFACE_PATH: &str = "/org/supergfxctl/Gfx";
|
||||||
|
|
||||||
const NVIDIA_DRIVERS: [&str; 4] = ["nvidia_drm", "nvidia_modeset", "nvidia_uvm", "nvidia"];
|
const NVIDIA_DRIVERS: [&str; 4] = ["nvidia_drm", "nvidia_modeset", "nvidia_uvm", "nvidia"];
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
//!
|
//!
|
||||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||||
|
|
||||||
use std::sync::mpsc::{Receiver, Sender};
|
use std::sync::mpsc::{Sender};
|
||||||
|
|
||||||
use zbus::{dbus_proxy, Connection, Message, Result};
|
use zbus::{dbus_proxy, Connection, Message, Result};
|
||||||
|
|
||||||
|
|||||||