Add some docs, make socket_dir update on reload

This commit is contained in:
Ottatop 2023-09-20 17:55:21 -05:00
parent a2a46596f4
commit 019e606584
3 changed files with 8 additions and 2 deletions

View file

@ -36,8 +36,6 @@ kill_keybind = { modifiers = ["Ctrl", "Alt", "Shift"], key = "escape" }
# Pinnacle will open a Unix socket at `$XDG_RUNTIME_DIR` by default, falling back to `/tmp` if it doesn't exist.
# If you want/need to change this, use the `socket_dir` setting set to the directory of your choosing.
#
# Changing this between reloads will not change the actual location of the socket
# until you restart Pinnacle.
# socket_dir = "/your/dir/here/"
### Environment Variables ###

View file

@ -143,6 +143,8 @@ pub fn start_config(tx_channel: Sender<api::msg::Msg>) -> anyhow::Result<ConfigR
// If a socket is provided in the metaconfig, use it.
let socket_dir = if let Some(socket_dir) = &metaconfig.socket_dir {
let socket_dir = shellexpand::full(socket_dir)?.to_string();
// cd into the metaconfig dir and canonicalize to preserve relative paths
// like ./dir/here
let current_dir = std::env::current_dir()?;

View file

@ -51,7 +51,9 @@ use smithay::{
use crate::input::InputState;
pub enum Backend {
/// The compositor is running in a Winit window
Winit(Winit),
/// The compositor is running in a tty
Udev(Udev),
}
@ -131,6 +133,7 @@ pub struct State {
}
impl State {
/// Creates the central state and starts the config and xwayland
pub fn init(
backend: Backend,
display: &mut Display<Self>,
@ -395,7 +398,10 @@ pub struct ApiState {
pub config_process: async_process::Child,
}
/// A trait meant to be used in types with a [`UserDataMap`][smithay::utils::user_data::UserDataMap]
/// to get user-defined state.
pub trait WithState {
/// The user-defined state
type State;
/// Access data map state.