diff --git a/.github/workflows/rustci.yml b/.github/workflows/rustci.yml index bad8fbe..7b78a79 100644 --- a/.github/workflows/rustci.yml +++ b/.github/workflows/rustci.yml @@ -17,11 +17,13 @@ jobs: build: name: Build Binary runs-on: ubuntu-latest + container: + image: archlinux:latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - name: Install Deps - run: sudo apt install -y libxkbcommon-dev libalsaplayer-dev libasound2-dev libglib2.0-dev + run: pacman -Syu --noconfirm build-base git sudo libxkbcommon wayland alsa-lib alsa-utils - name: Run fmt check run: cargo fmt --all -- --check - name: Run clippy check @@ -36,11 +38,13 @@ jobs: needs: - build runs-on: ubuntu-latest + container: + image: archlinux:latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - name: Install Deps - run: sudo apt install -y libxkbcommon-dev libwayland-dev libalsaplayer-dev libasound2-dev + run: pacman -Syu --noconfirm build-base git sudo libxkbcommon wayland alsa-lib alsa-utils - name: Publish to crate run: | cargo publish -p iced_zbus_notification --token ${{ secrets.CRATES_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 953aa7a..471d830 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [workspace] -resolver = "2" +resolver = "3" members = ["./lala_bar", "./iced_zbus_notification"] [workspace.package] version = "0.4.3" -edition = "2021" +edition = "2024" authors = ["Decodertalkers "] license = "MIT" repository = "https://github.com/Decodetalkers/lala-bar" diff --git a/iced_zbus_notification/src/lib.rs b/iced_zbus_notification/src/lib.rs index 7363171..887fc05 100644 --- a/iced_zbus_notification/src/lib.rs +++ b/iced_zbus_notification/src/lib.rs @@ -112,11 +112,7 @@ fn get_png_icon(theme: &str, icon: &str) -> Option { fn get_pixmap_icon(icon: &str) -> Option { let path = Path::new(format!("/usr/share/pixmaps/{icon}.png").as_str()).to_owned(); - if path.exists() { - Some(path) - } else { - None - } + if path.exists() { Some(path) } else { None } } fn get_jpeg_icon(theme: &str, icon: &str) -> Option { diff --git a/lala_bar/src/launcher.rs b/lala_bar/src/launcher.rs index 2f1d2ec..1136ccd 100644 --- a/lala_bar/src/launcher.rs +++ b/lala_bar/src/launcher.rs @@ -1,10 +1,10 @@ mod applications; -use applications::{all_apps, App}; +use applications::{App, all_apps}; use iced::widget::{column, scrollable, text_input}; use iced::{Element, Event, Length, Task as Command}; -use iced_runtime::window::Action as WindowAction; use iced_runtime::Action; +use iced_runtime::window::Action as WindowAction; use super::Message; diff --git a/lala_bar/src/launcher/applications.rs b/lala_bar/src/launcher/applications.rs index b2db1fc..bf8e23e 100644 --- a/lala_bar/src/launcher/applications.rs +++ b/lala_bar/src/launcher/applications.rs @@ -6,8 +6,8 @@ use super::LaunchMessage; use gio::{AppLaunchContext, DesktopAppInfo}; use gio::prelude::*; -use iced::widget::{button, column, image, row, svg, text}; use iced::Pixels; +use iced::widget::{button, column, image, row, svg, text}; use iced::{Element, Length}; use super::Message; diff --git a/lala_bar/src/music_bar.rs b/lala_bar/src/music_bar.rs index a53dfdf..939eccc 100644 --- a/lala_bar/src/music_bar.rs +++ b/lala_bar/src/music_bar.rs @@ -1,3 +1,4 @@ +use crate::Launcher; use crate::config::*; use crate::dbusbackend; use crate::get_metadata; @@ -5,28 +6,27 @@ use crate::launcher::LaunchMessage; use crate::notify::{NotifyCommand, NotifyUnitWidgetInfo}; use crate::slider::SliderIndex; use crate::zbus_mpirs::ServiceInfo; -use crate::Launcher; +use crate::{LaLaInfo, Message, get_metadata_initial}; use crate::{aximer, launcher}; -use crate::{get_metadata_initial, LaLaInfo, Message}; use chrono::{DateTime, Local}; -use futures::channel::mpsc::{channel, Sender}; -use futures::future::pending; use futures::StreamExt; +use futures::channel::mpsc::{Sender, channel}; +use futures::future::pending; use iced::widget::{ - button, checkbox, column, container, image, markdown, row, scrollable, slider, svg, text, - text_input, Space, + Space, button, checkbox, column, container, image, markdown, row, scrollable, slider, svg, + text, text_input, }; use iced::{Alignment, Element, Font, Length, Task as Command, Theme}; use iced_aw::{date_picker::Date, helpers::date_picker, time_picker, time_picker::Time}; use iced_layershell::reexport::{Anchor, KeyboardInteractivity, Layer, NewLayerShellSettings}; use iced_layershell::settings::LayerShellSettings; use iced_layershell::settings::StartMode; -use iced_runtime::window::Action as WindowAction; use iced_runtime::Action; +use iced_runtime::window::Action as WindowAction; use iced_zbus_notification::MessageSenderDefault; use iced_zbus_notification::{ - start_connection, LaLaMako, NotifyMessage, VersionInfo, DEFAULT_ACTION, - NOTIFICATION_SERVICE_PATH, + DEFAULT_ACTION, LaLaMako, NOTIFICATION_SERVICE_PATH, NotifyMessage, VersionInfo, + start_connection, }; use std::collections::HashMap; @@ -621,7 +621,7 @@ impl LalaMusicBar { match message { Message::DBusInfoUpdate(data) => self.service_data = data, Message::RequestDBusInfoUpdate => { - return Command::perform(get_metadata(), Message::DBusInfoUpdate) + return Command::perform(get_metadata(), Message::DBusInfoUpdate); } Message::ToggleCalendar => { if let Some(calendar_id) = self.calendar_id { @@ -1070,7 +1070,7 @@ impl LalaMusicBar { } Message::Notify(NotifyMessage::UnitRemove(removed_id)) => { - return self.remove_notify(removed_id) + return self.remove_notify(removed_id); } Message::CheckOutput => { diff --git a/lala_bar/src/notify.rs b/lala_bar/src/notify.rs index 5b05bc8..ea82282 100644 --- a/lala_bar/src/notify.rs +++ b/lala_bar/src/notify.rs @@ -1,5 +1,5 @@ use crate::{LalaMusicBar, Message}; -use iced::widget::{button, column, image, markdown, row, svg, text, Space, Stack}; +use iced::widget::{Space, Stack, button, column, image, markdown, row, svg, text}; use iced::{Font, Length}; use iced_zbus_notification::{ImageInfo, NotifyUnit}; diff --git a/lala_bar/src/zbus_mpirs.rs b/lala_bar/src/zbus_mpirs.rs index d08a45b..84d90bd 100644 --- a/lala_bar/src/zbus_mpirs.rs +++ b/lala_bar/src/zbus_mpirs.rs @@ -9,10 +9,10 @@ use std::sync::LazyLock; use tokio::sync::Mutex; use zbus::{ + Result, fdo::{DBusProxy, NameOwnerChangedArgs}, proxy, zvariant::{OwnedObjectPath, OwnedValue}, - Result, }; const PLAYCTLD: &str = "org.mpris.MediaPlayer2.playerctld";