look and feel desktop filter
This commit is contained in:
parent
7028ce4682
commit
ed1990ac95
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"setup_steps": [
|
"community": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"title": "update-pikaos-title",
|
"title": "update-pikaos-title",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"setup_steps": [
|
"contribute": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"title": "update-pikaos-title",
|
"title": "update-pikaos-title",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"subtitle": "update-pikaos-subtitle",
|
"subtitle": "update-pikaos-subtitle",
|
||||||
"icon": "pika-system-software-update",
|
"icon": "pika-system-software-update",
|
||||||
"button": "update-pikaos-button-label",
|
"button": "update-pikaos-button-label",
|
||||||
"only-in": "",
|
"onlyin": "pika",
|
||||||
"command": "echo update"
|
"command": "echo update"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"subtitle": "update-pikaos-subtitle",
|
"subtitle": "update-pikaos-subtitle",
|
||||||
"icon": "pika-system-software-update",
|
"icon": "pika-system-software-update",
|
||||||
"button": "update-pikaos-button-label",
|
"button": "update-pikaos-button-label",
|
||||||
"only-in": "gnome",
|
"onlyin": "kde",
|
||||||
"command": "echo update"
|
"command": "echo update"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"setup_steps": [
|
"troubleshoot": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"title": "update-pikaos-title",
|
"title": "update-pikaos-title",
|
||||||
|
@ -5,7 +5,7 @@ use duct::cmd;
|
|||||||
use glib::*;
|
use glib::*;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::fs;
|
use std::{env, fs};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
@ -18,6 +18,7 @@ struct look_and_feel_entry {
|
|||||||
subtitle: String,
|
subtitle: String,
|
||||||
icon: String,
|
icon: String,
|
||||||
button: String,
|
button: String,
|
||||||
|
onlyin: String,
|
||||||
command: String,
|
command: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +99,7 @@ pub fn look_and_feel_page(
|
|||||||
let entry_subtitle = look_and_feel_entry.subtitle;
|
let entry_subtitle = look_and_feel_entry.subtitle;
|
||||||
let entry_icon = look_and_feel_entry.icon;
|
let entry_icon = look_and_feel_entry.icon;
|
||||||
let entry_button = look_and_feel_entry.button;
|
let entry_button = look_and_feel_entry.button;
|
||||||
|
let entry_onlyin = look_and_feel_entry.onlyin;
|
||||||
let entry_command = look_and_feel_entry.command;
|
let entry_command = look_and_feel_entry.command;
|
||||||
let entry_row = adw::ActionRow::builder()
|
let entry_row = adw::ActionRow::builder()
|
||||||
.title(t!(&entry_title))
|
.title(t!(&entry_title))
|
||||||
@ -158,8 +160,14 @@ pub fn look_and_feel_page(
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
let current_desktop = match env::var_os("XDG_SESSION_DESKTOP") {
|
||||||
|
Some(v) => v.into_string().unwrap(),
|
||||||
|
None => panic!("XDG_SESSION_DESKTOP is not set"),
|
||||||
|
};
|
||||||
|
if entry_onlyin.is_empty() || current_desktop.contains(&entry_onlyin.to_lowercase()) {
|
||||||
look_and_feel_page_listbox.append(&entry_row)
|
look_and_feel_page_listbox.append(&entry_row)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
look_and_feel_page_box.append(&look_and_feel_page_listbox);
|
look_and_feel_page_box.append(&look_and_feel_page_listbox);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user