mirror of
				https://github.com/Xetibo/ReSet.git
				synced 2025-10-31 16:15:20 +01:00 
			
		
		
		
	init: store true if daemon is already started
This commit is contained in:
		
							parent
							
								
									0b12d95c83
								
							
						
					
					
						commit
						e7c0995aa3
					
				
					 3 changed files with 19 additions and 1 deletions
				
			
		|  | @ -36,6 +36,12 @@ A window manager/compositor agnostic settings application for Linux written in r | ||||||
| ReSet features a plugin system by loading dynamic libraries for both the daemon and the ReSet graphical user interface. | ReSet features a plugin system by loading dynamic libraries for both the daemon and the ReSet graphical user interface. | ||||||
| A list of official plugins, installation guides and their documentation can be found at [ReSet-Plugins](https://github.com/Xetibo/ReSet-Plugins). | A list of official plugins, installation guides and their documentation can be found at [ReSet-Plugins](https://github.com/Xetibo/ReSet-Plugins). | ||||||
| 
 | 
 | ||||||
|  | ### Installation | ||||||
|  | 
 | ||||||
|  | Plugins are loaded either from `/usr/lib/reset` or `~/.config/reset/plugins`. In order to install the plugin, either install a distribution specific package that places the library into the specified system folder, or place the library in the plugins folder in your config directory. | ||||||
|  | 
 | ||||||
|  | Note, after installation, please move to confirmation. | ||||||
|  | 
 | ||||||
| ### Confirmation | ### Confirmation | ||||||
| 
 | 
 | ||||||
| In order for your plugins to load, you have to define them in `.config/reset/ReSet.toml`. | In order for your plugins to load, you have to define them in `.config/reset/ReSet.toml`. | ||||||
|  |  | ||||||
|  | @ -10,6 +10,9 @@ use glib::prelude::Cast; | ||||||
| use glib::Object; | use glib::Object; | ||||||
| use gtk::prelude::{GObjectPropertyExpressionExt, ListBoxRowExt, ListItemExt, WidgetExt}; | use gtk::prelude::{GObjectPropertyExpressionExt, ListBoxRowExt, ListItemExt, WidgetExt}; | ||||||
| use gtk::{Align, SignalListItemFactory, StringObject}; | use gtk::{Align, SignalListItemFactory, StringObject}; | ||||||
|  | use re_set_lib::ERROR; | ||||||
|  | #[cfg(debug_assertions)] | ||||||
|  | use re_set_lib::{utils::macros::ErrorLevel, write_log_to_file}; | ||||||
| 
 | 
 | ||||||
| pub const DBUS_PATH: &str = "/org/Xetibo/ReSet/Daemon"; | pub const DBUS_PATH: &str = "/org/Xetibo/ReSet/Daemon"; | ||||||
| pub const WIRELESS: &str = "org.Xetibo.ReSet.Network"; | pub const WIRELESS: &str = "org.Xetibo.ReSet.Network"; | ||||||
|  | @ -93,5 +96,12 @@ pub fn get_capabilities() -> Vec<String> { | ||||||
|     let conn = Connection::new_session().unwrap(); |     let conn = Connection::new_session().unwrap(); | ||||||
|     let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(10000)); |     let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(10000)); | ||||||
|     let res: Result<(Vec<String>,), Error> = proxy.method_call(BASE, "GetCapabilities", ()); |     let res: Result<(Vec<String>,), Error> = proxy.method_call(BASE, "GetCapabilities", ()); | ||||||
|  |     if res.is_err() { | ||||||
|  |         ERROR!( | ||||||
|  |             "Could not call capabilities from daemon", | ||||||
|  |             ErrorLevel::Critical | ||||||
|  |         ); | ||||||
|  |         return Vec::new(); | ||||||
|  |     } | ||||||
|     res.unwrap().0 |     res.unwrap().0 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| use std::hint::{self}; | use std::hint::{self}; | ||||||
| use std::sync::atomic::AtomicBool; | use std::sync::atomic::{AtomicBool, Ordering}; | ||||||
| use std::sync::Arc; | use std::sync::Arc; | ||||||
| use std::thread; | use std::thread; | ||||||
| use std::time::Duration; | use std::time::Duration; | ||||||
|  | @ -81,5 +81,7 @@ async fn daemon_check(ready: Arc<AtomicBool>) { | ||||||
|     let res = handle.join(); |     let res = handle.join(); | ||||||
|     if res.unwrap().is_err() { |     if res.unwrap().is_err() { | ||||||
|         run_daemon(Some(ready)).await; |         run_daemon(Some(ready)).await; | ||||||
|  |     } else { | ||||||
|  |         ready.store(true, Ordering::SeqCst); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue