Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Sep 28, 2024
1 parent 00d83fa commit cd14f62
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 205 deletions.
339 changes: 168 additions & 171 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ rust-version = "1.80"

[dependencies]
serde = { version = "1", features = ["derive"] }
log = "0.4"
tokio = { version = "1", features = ["full"] }
once_cell = "1"

i18n-embed = { version = "0.15", features = [
"fluent-system",
Expand Down
26 changes: 6 additions & 20 deletions io.github.wiiznokes.cosmic-ext-applet-clipboard-manager.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
{
"app-id": "io.github.wiiznokes.cosmic-ext-applet-clipboard-manager",
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"runtime-version": "24.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable",
"org.freedesktop.Sdk.Extension.llvm17"
],
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
"command": "fan-control",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--device=all",
"--filesystem=/sys"
],
"build-options": {
"append-path": "/usr/lib/sdk/rust-stable/bin"
},
"finish-args": ["--share=ipc", "--socket=fallback-x11", "--socket=wayland"],
"modules": [
{
"name": "cosmic-ext-applet-clipboard-manager",
Expand All @@ -26,18 +14,16 @@
"env": {
"CARGO_HOME": "/run/build/fan-control/cargo"
},
"append-path": "/usr/lib/sdk/llvm17/bin",
"prepend-ld-library-path": "/usr/lib/sdk/llvm17/lib"
"append-path": "/usr/lib/sdk/rust-stable/bin"
},
"build-commands": [
"just build-release --offline --verbose",
"just prefix=/app install"
],
"sources": [
{
"type": "git",
"url": "https://github.com/wiiznokes/clipboard-manager",
"commit": "95baca4f4bb1bedb007c81dd5bf852ec642d5aff"
"type": "dir",
"path": "./"
},
"./cargo-sources.json"
]
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ debug := '0'
export NAME := 'cosmic-ext-applet-clipboard-manager'
export APPID := 'io.github.wiiznokes.' + NAME

bin-src := if debug == '1' { 'target/debug' / NAME } else { 'target/release' / NAME }
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
bin-src := cargo-target-dir / if debug == '1' { 'debug' / NAME } else { 'release' / NAME }

base-dir := absolute_path(clean(rootdir / prefix))
share-dst := base-dir / 'share'
Expand All @@ -20,7 +21,6 @@ migrations-dst := share-dst / NAME / 'migrations'

default: build-release


build-debug *args:
cargo build {{args}}

Expand Down
4 changes: 2 additions & 2 deletions src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn sub() -> Subscription<ClipboardMessage> {
if !PRIVATE_MODE.load(atomic::Ordering::Relaxed) {
tx.blocking_send(Some(res)).expect("can't send");
} else {
log::info!("private mode")
info!("private mode")
}
}
Err(e) => match e {
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn sub() -> Subscription<ClipboardMessage> {
.await
.expect("can't send");
loop {
log::error!("inside error: {e}");
error!("inside error: {e}");
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/localize.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use std::sync::LazyLock;

use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
};
use once_cell::sync::Lazy;
use rust_embed::RustEmbed;

#[derive(RustEmbed)]
#[folder = "i18n/"]
struct Localizations;

pub static LANGUAGE_LOADER: Lazy<FluentLanguageLoader> = Lazy::new(|| {
pub static LANGUAGE_LOADER: LazyLock<FluentLanguageLoader> = LazyLock::new(|| {
let loader: FluentLanguageLoader = fluent_language_loader!();

loader
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use app::{AppState, Flags};
use config::{Config, CONFIG_VERSION};
use cosmic::cosmic_config;
use cosmic::cosmic_config::CosmicConfigEntry;
use log::LevelFilter;
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};

mod app;
Expand All @@ -21,7 +20,7 @@ mod view;

#[allow(unused_imports)]
#[macro_use]
extern crate log;
extern crate tracing;

fn setup_logs() {
let fmt_layer = fmt::layer().with_target(false);
Expand Down
8 changes: 4 additions & 4 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use cosmic::{
theme::{self, Button},
widget::{
self,
button::{self, button},
button::{self},
column, container, context_menu, flex_row, grid,
icon::{self, Handle},
image, menu, mouse_area, row, text, text_input, toggler, Column, Container, Icon,
Expand Down Expand Up @@ -275,7 +275,7 @@ impl AppState {
is_focused: bool,
content: impl Into<Element<'a, AppMsg>>,
) -> Element<'a, AppMsg> {
let btn = cosmic::widget::button(content)
let btn = button::custom(content)
.on_press(AppMsg::Copy(entry.clone()))
.padding([8, 16])
.style(Button::Custom {
Expand Down Expand Up @@ -331,13 +331,13 @@ impl AppState {
btn,
Some(vec![
menu::Tree::new(
button(text(fl!("delete_entry")))
button::text(fl!("delete_entry"))
.on_press(AppMsg::Delete(entry.clone()))
.width(Length::Fill)
.style(Button::Destructive),
),
menu::Tree::new(
button(text(fl!("show_qr_code")))
button::text(fl!("show_qr_code"))
.on_press(AppMsg::ShowQrCode(entry.clone()))
.width(Length::Fill)
.style(Button::Destructive),
Expand Down

0 comments on commit cd14f62

Please sign in to comment.