Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/paginated-output
Browse files Browse the repository at this point in the history
  • Loading branch information
friedow committed Jul 27, 2024
2 parents cf8c0bc + 9b51c12 commit e2a9625
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 144 deletions.
5 changes: 2 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
commit-message:
prefix: ⬆️
prefix: "⬆️ "
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/"
commit-message:
prefix: ⬆️
prefix: "⬆️ "
schedule:
interval: "monthly"
34 changes: 16 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
name: "ci"

on:
workflow_dispatch: # allows manual triggering
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- '**.md'
push:
branches: [ main ]
branches: [main]
paths-ignore:
- '**.md'
merge_group:

jobs:
flake-check:
runs-on: ubuntu-latest
environment: cachix
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Nix Flakes doesn't work on shallow clones
- uses: cachix/install-nix-action@V27
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: friedow
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: "flake check"
run: nix flake check -Lvv --no-update-lock-file
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Nix Flakes doesn't work on shallow clones
- uses: cachix/install-nix-action@V27
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: friedow
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: "flake check"
run: nix flake check -Lvv --no-update-lock-file
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ edition = "2021"
[dependencies]
# general
anyhow = { version = "1.0.86", features = ["backtrace"] }
clap = { version = "4.5.8", features = ["derive", "env"] }
clap = { version = "4.5.9", features = ["derive", "env"] }
log = { version = "0.4.22", features = ["kv_unstable_serde"] }
simple_logger = { version = "5.0.0", features = [
"colors",
"threads",
"timestamps",
"stderr",
] }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }

# settings
serde_yaml = "0.9.34"
Expand All @@ -29,11 +29,11 @@ iced = { version = "0.10.0", features = ["svg"] }
hex_color = "3"

# plugins
async-trait = "0.1.80"
async-trait = "0.1.81"
async-std = "1.12.0"

# reading index files
serde_json = "1.0.119"
serde_json = "1.0.120"

# clock plugin
chrono = "0.4.38"
Expand Down
2 changes: 1 addition & 1 deletion client/src/component/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl iced::widget::container::StyleSheet for Style {
type Style = iced::Theme;

fn appearance(&self, _style: &Self::Style) -> iced::widget::container::Appearance {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();

iced::widget::container::Appearance {
background: None,
Expand Down
8 changes: 4 additions & 4 deletions client/src/component/query_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@ impl iced::widget::text_input::StyleSheet for Style {
}

fn placeholder_color(&self, _style: &Self::Style) -> iced::Color {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();
crate::settings::hexcolor(&color_settings.color.surface)
}

fn value_color(&self, _style: &Self::Style) -> iced::Color {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();
crate::settings::hexcolor(&color_settings.color.text)
}

fn disabled_color(&self, _style: &Self::Style) -> iced::Color {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();
crate::settings::hexcolor(&color_settings.color.surface)
}

fn selection_color(&self, _style: &Self::Style) -> iced::Color {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();
crate::settings::hexcolor(&color_settings.color.surface)
}
}
4 changes: 2 additions & 2 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl iced::application::StyleSheet for SandboxStyle {
type Style = iced::Theme;

fn appearance(&self, _style: &Self::Style) -> iced::application::Appearance {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();

iced::application::Appearance {
background_color: iced::Color::TRANSPARENT,
Expand All @@ -543,7 +543,7 @@ impl iced::widget::container::StyleSheet for ApplicationWrapperStyle {
type Style = iced::Theme;

fn appearance(&self, _style: &Self::Style) -> iced::widget::container::Appearance {
let color_settings = crate::settings::Settings::new();
let color_settings = crate::settings::Settings::get_or_init();
iced::widget::container::Appearance {
background: Some(iced::Background::Color(settings::hexcolor(
&color_settings.color.background,
Expand Down
4 changes: 2 additions & 2 deletions client/src/plugin/applications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn to_entry(
) -> Option<crate::model::Entry> {
let title = name(desktop_entry);

if !is_visible(&desktop_entry) {
if !is_visible(desktop_entry) {
log::debug!(target: "applications", "Desktop entry with name '{}' will be hidden because of its properties.", title);
return None;
}
Expand Down Expand Up @@ -98,7 +98,7 @@ fn is_visible(desktop_entry: &freedesktop_desktop_entry::DesktopEntry) -> bool {
fn terminal_command(desktop_entry: &freedesktop_desktop_entry::DesktopEntry) -> Option<String> {
if !desktop_entry
.categories()?
.split(";")
.split(';')
.any(|category| category == "TerminalEmulator")
{
return None;
Expand Down
6 changes: 6 additions & 0 deletions client/src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use hex_color::HexColor;
use serde::Deserialize;
use std::sync::OnceLock;

pub fn hexcolor(color: &str) -> iced::Color {
let hex_col = HexColor::parse(color).unwrap_or_else(|_| {
Expand Down Expand Up @@ -327,6 +328,11 @@ impl Settings {
}
config_result.unwrap()
}

pub fn get_or_init() -> &'static Self {
static SETTINGS: OnceLock<Settings> = OnceLock::new();
SETTINGS.get_or_init(Self::new)
}
}

impl std::convert::TryFrom<crate::cli::CliArgs> for Settings {
Expand Down
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e2a9625

Please sign in to comment.