Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb0b0dfa87 | |||
| fc4dde32eb | |||
| cc1ad7bbb7 | |||
| 16ba5b642a | |||
| 1608582cbd | |||
| 34145d5fbe |
32
CLAUDE.md
Normal file
32
CLAUDE.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Owlry - Claude Code Instructions
|
||||
|
||||
## Release Workflow
|
||||
|
||||
Always use `just` for releases and AUR deployment:
|
||||
|
||||
```bash
|
||||
# Bump version (updates Cargo.toml + Cargo.lock, commits)
|
||||
just bump 0.x.y
|
||||
|
||||
# Push and create tag
|
||||
git push && just tag
|
||||
|
||||
# Update AUR package
|
||||
just aur-update
|
||||
|
||||
# Review changes, then publish
|
||||
just aur-publish
|
||||
```
|
||||
|
||||
Do NOT manually edit Cargo.toml for version bumps - use `just bump`.
|
||||
|
||||
## Available just recipes
|
||||
|
||||
- `just build` / `just release` - Build debug/release
|
||||
- `just check` - Run cargo check + clippy
|
||||
- `just test` - Run tests
|
||||
- `just bump <version>` - Bump version
|
||||
- `just tag` - Create and push git tag
|
||||
- `just aur-update` - Update PKGBUILD checksums
|
||||
- `just aur-publish` - Commit and push to AUR
|
||||
- `just aur-test` - Test PKGBUILD locally
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -859,7 +859,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
|
||||
|
||||
[[package]]
|
||||
name = "owlry"
|
||||
version = "0.1.2"
|
||||
version = "0.1.6"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"dirs",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "owlry"
|
||||
version = "0.1.2"
|
||||
version = "0.1.6"
|
||||
edition = "2024"
|
||||
rust-version = "1.90"
|
||||
description = "A lightweight, owl-themed application launcher for Wayland"
|
||||
|
||||
@@ -100,6 +100,13 @@ Example: `:cmd git` searches only PATH commands for "git"
|
||||
|
||||
Configuration file: `~/.config/owlry/config.toml`
|
||||
|
||||
An example config is installed at `/usr/share/doc/owlry/config.example.toml`:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.config/owlry
|
||||
cp /usr/share/doc/owlry/config.example.toml ~/.config/owlry/config.toml
|
||||
```
|
||||
|
||||
```toml
|
||||
[general]
|
||||
show_icons = true
|
||||
|
||||
42
config.example.toml
Normal file
42
config.example.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
# Owlry Configuration
|
||||
# Copy to ~/.config/owlry/config.toml
|
||||
|
||||
[general]
|
||||
show_icons = true
|
||||
max_results = 10
|
||||
terminal_command = "kitty" # Auto-detected if not set
|
||||
|
||||
# Launch wrapper for app execution (auto-detected if not set)
|
||||
# Examples:
|
||||
# "uwsm app --" # For uwsm sessions
|
||||
# "hyprctl dispatch exec --" # For Hyprland
|
||||
# "" # Direct execution
|
||||
# launch_wrapper = "uwsm app --"
|
||||
|
||||
[appearance]
|
||||
width = 600
|
||||
height = 400
|
||||
font_size = 14
|
||||
border_radius = 12
|
||||
|
||||
# Theme: "owl" for built-in dark theme, or leave unset for GTK default
|
||||
# theme = "owl"
|
||||
|
||||
# Individual color overrides (CSS color values)
|
||||
# [appearance.colors]
|
||||
# background = "#1a1b26"
|
||||
# background_secondary = "#24283b"
|
||||
# border = "#414868"
|
||||
# text = "#c0caf5"
|
||||
# text_secondary = "#565f89"
|
||||
# accent = "#7aa2f7"
|
||||
# accent_bright = "#89b4fa"
|
||||
# badge_app = "#9ece6a"
|
||||
# badge_cmd = "#7aa2f7"
|
||||
# badge_dmenu = "#bb9af7"
|
||||
# badge_uuctl = "#f7768e"
|
||||
|
||||
[providers]
|
||||
applications = true
|
||||
commands = true
|
||||
uuctl = true
|
||||
14
src/main.rs
14
src/main.rs
@@ -8,7 +8,7 @@ mod ui;
|
||||
|
||||
use app::OwlryApp;
|
||||
use cli::CliArgs;
|
||||
use log::info;
|
||||
use log::{info, warn};
|
||||
|
||||
fn main() {
|
||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
|
||||
@@ -17,6 +17,18 @@ fn main() {
|
||||
|
||||
info!("Starting Owlry launcher");
|
||||
|
||||
// Diagnostic: log critical environment variables
|
||||
let home = std::env::var("HOME").unwrap_or_else(|_| "<not set>".to_string());
|
||||
let path = std::env::var("PATH").unwrap_or_else(|_| "<not set>".to_string());
|
||||
let xdg_data = std::env::var("XDG_DATA_HOME").unwrap_or_else(|_| "<not set>".to_string());
|
||||
info!("HOME={}", home);
|
||||
info!("PATH={}", path);
|
||||
info!("XDG_DATA_HOME={}", xdg_data);
|
||||
|
||||
if home == "<not set>" || path == "<not set>" {
|
||||
warn!("Critical environment variables missing! Items may not load correctly.");
|
||||
}
|
||||
|
||||
let app = OwlryApp::new(args);
|
||||
std::process::exit(app.run());
|
||||
}
|
||||
|
||||
@@ -17,17 +17,37 @@ impl DmenuProvider {
|
||||
}
|
||||
|
||||
/// Check if stdin has data (non-blocking check)
|
||||
/// Returns true only if stdin is a pipe or regular file with data available.
|
||||
/// Returns false for TTYs, /dev/null, and other character devices.
|
||||
pub fn has_stdin_data() -> bool {
|
||||
use std::os::unix::io::AsRawFd;
|
||||
|
||||
let stdin_fd = io::stdin().as_raw_fd();
|
||||
|
||||
// First check if stdin is a pipe or regular file (valid dmenu input sources)
|
||||
// Character devices (TTY, /dev/null) should NOT trigger dmenu mode
|
||||
let mut stat_buf: libc::stat = unsafe { std::mem::zeroed() };
|
||||
let stat_result = unsafe { libc::fstat(stdin_fd, &mut stat_buf) };
|
||||
if stat_result != 0 {
|
||||
return false;
|
||||
}
|
||||
|
||||
let mode = stat_buf.st_mode;
|
||||
let is_pipe = (mode & libc::S_IFMT) == libc::S_IFIFO;
|
||||
let is_file = (mode & libc::S_IFMT) == libc::S_IFREG;
|
||||
|
||||
// Only check for data if stdin is a pipe or file
|
||||
if !is_pipe && !is_file {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Non-blocking poll to check if data is available
|
||||
let mut poll_fd = libc::pollfd {
|
||||
fd: stdin_fd,
|
||||
events: libc::POLLIN,
|
||||
revents: 0,
|
||||
};
|
||||
|
||||
// Non-blocking poll with 0 timeout
|
||||
let result = unsafe { libc::poll(&mut poll_fd, 1, 0) };
|
||||
result > 0 && (poll_fd.revents & libc::POLLIN) != 0
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ pub use uuctl::UuctlProvider;
|
||||
|
||||
use fuzzy_matcher::FuzzyMatcher;
|
||||
use fuzzy_matcher::skim::SkimMatcherV2;
|
||||
use log::info;
|
||||
|
||||
/// Represents a single searchable/launchable item
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -110,6 +111,11 @@ impl ProviderManager {
|
||||
pub fn refresh_all(&mut self) {
|
||||
for provider in &mut self.providers {
|
||||
provider.refresh();
|
||||
info!(
|
||||
"Provider '{}' loaded {} items",
|
||||
provider.name(),
|
||||
provider.items().len()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user