Compare commits
No commits in common. "bfef9f3fd6c3f48de09a6bf0b25aa1da2b9afed7" and "fe2039c05ea32bfef57652811b42a7338137bfb1" have entirely different histories.
bfef9f3fd6
...
fe2039c05e
2 changed files with 4 additions and 42 deletions
|
|
@ -1,37 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/bin
|
|
||||||
target
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
run: |
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt
|
|
||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
||||||
|
|
||||||
- name: Install cargo-make and cargo-audit
|
|
||||||
run: |
|
|
||||||
for crate in cargo-make cargo-audit; do
|
|
||||||
command -v "$crate" >/dev/null 2>&1 || cargo install "$crate"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Run CI checks
|
|
||||||
run: cargo make ci
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
use freedesktop_icons::lookup;
|
use freedesktop_icons::lookup;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::{env, fs};
|
|
||||||
|
|
||||||
const ICON_SIZE: u16 = 32;
|
const ICON_SIZE: u16 = 32;
|
||||||
|
|
||||||
|
|
@ -48,7 +47,7 @@ fn desktop_file_icon_name(desktop_entry: &str) -> Option<String> {
|
||||||
let path = dir
|
let path = dir
|
||||||
.join("applications")
|
.join("applications")
|
||||||
.join(format!("{desktop_entry}.desktop"));
|
.join(format!("{desktop_entry}.desktop"));
|
||||||
if let Ok(contents) = fs::read_to_string(&path)
|
if let Ok(contents) = std::fs::read_to_string(&path)
|
||||||
&& let Some(icon) = parse_icon_key(&contents)
|
&& let Some(icon) = parse_icon_key(&contents)
|
||||||
{
|
{
|
||||||
return Some(icon);
|
return Some(icon);
|
||||||
|
|
@ -59,11 +58,11 @@ fn desktop_file_icon_name(desktop_entry: &str) -> Option<String> {
|
||||||
|
|
||||||
fn data_dirs() -> Vec<PathBuf> {
|
fn data_dirs() -> Vec<PathBuf> {
|
||||||
let mut dirs = vec![];
|
let mut dirs = vec![];
|
||||||
if let Some(home) = env::var_os("HOME") {
|
if let Some(home) = std::env::var_os("HOME") {
|
||||||
dirs.push(PathBuf::from(home).join(".local/share"));
|
dirs.push(PathBuf::from(home).join(".local/share"));
|
||||||
}
|
}
|
||||||
let xdg_data_dirs =
|
let xdg_data_dirs = std::env::var("XDG_DATA_DIRS")
|
||||||
env::var("XDG_DATA_DIRS").unwrap_or_else(|_| "/usr/local/share:/usr/share".to_string());
|
.unwrap_or_else(|_| "/usr/local/share:/usr/share".to_string());
|
||||||
dirs.extend(xdg_data_dirs.split(':').map(PathBuf::from));
|
dirs.extend(xdg_data_dirs.split(':').map(PathBuf::from));
|
||||||
dirs
|
dirs
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue