chore: Update dependencies
This commit is contained in:
parent
1d031d99c1
commit
563128904b
7 changed files with 415 additions and 354 deletions
|
|
@ -94,7 +94,8 @@ impl<W: AsyncWrite + Unpin> App<W> {
|
|||
.as_ref()
|
||||
.map(|x| x.split(':').collect::<Vec<&str>>());
|
||||
|
||||
for (src, path) in DesktopIter::new(default_paths()) {
|
||||
for path in DesktopIter::new(default_paths()) {
|
||||
let src = PathSource::guess_from(&path);
|
||||
if let Ok(bytes) = std::fs::read_to_string(&path) {
|
||||
if let Ok(entry) = DesktopEntry::decode(&path, &bytes) {
|
||||
// Do not show if our desktop is defined in `NotShowIn`.
|
||||
|
|
@ -304,6 +305,7 @@ fn path_string(source: &PathSource) -> Cow<'static, str> {
|
|||
PathSource::LocalNix => "Nix".into(),
|
||||
PathSource::Nix => "Nix (System)".into(),
|
||||
PathSource::System => "System".into(),
|
||||
PathSource::SystemLocal => "Local (System)".into(),
|
||||
PathSource::SystemFlatpak => "Flatpak (System)".into(),
|
||||
PathSource::SystemSnap => "Snap (System)".into(),
|
||||
PathSource::Other(other) => Cow::Owned(other.clone()),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use freedesktop_desktop_entry as fde;
|
|||
use futures_lite::{AsyncWrite, AsyncWriteExt, StreamExt};
|
||||
use pop_launcher::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{convert::TryFrom, fs, path::PathBuf};
|
||||
use std::{convert::TryFrom, fs, path::PathBuf, sync::Arc};
|
||||
use zbus::Connection;
|
||||
use zvariant::{Signature, Type};
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ impl Type for Item {
|
|||
}
|
||||
|
||||
pub async fn main() {
|
||||
let connection = match Connection::new_session() {
|
||||
let connection = match Connection::session().await {
|
||||
Ok(conn) => conn,
|
||||
Err(_) => {
|
||||
let mut out = async_stdout();
|
||||
|
|
@ -67,24 +67,27 @@ struct App<W> {
|
|||
impl<W: AsyncWrite + Unpin> App<W> {
|
||||
fn new(connection: Connection, tx: W) -> Self {
|
||||
Self {
|
||||
desktop_entries: fde::Iter::new(fde::default_paths()).collect(),
|
||||
desktop_entries: fde::Iter::new(fde::default_paths())
|
||||
.map(|path| (fde::PathSource::guess_from(&path), path))
|
||||
.collect(),
|
||||
entries: Vec::new(),
|
||||
connection,
|
||||
tx,
|
||||
}
|
||||
}
|
||||
|
||||
fn call_method<A: Serialize + Type>(
|
||||
async fn call_method<A: Serialize + Type>(
|
||||
&mut self,
|
||||
method: &str,
|
||||
args: &A,
|
||||
) -> zbus::Result<zbus::Message> {
|
||||
) -> zbus::Result<Arc<zbus::Message>> {
|
||||
self.connection
|
||||
.call_method(Some(DEST), PATH, Some(DEST), method, args)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn reload(&mut self) {
|
||||
if let Ok(message) = self.call_method("WindowList", &()) {
|
||||
if let Ok(message) = self.call_method("WindowList", &()).await {
|
||||
self.entries = message
|
||||
.body::<Vec<Item>>()
|
||||
.expect("pop-shell returned invalid WindowList response");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue