start menu dynamically find window binaries, break out ming-wm-lib

also, fix so audio player compiles, fix for empty draw instructions vec
This commit is contained in:
stjet
2025-03-03 07:12:29 +00:00
parent 1b9922d70f
commit 9eb9ace77f
40 changed files with 912 additions and 202 deletions

View File

@@ -13,14 +13,14 @@ use id3::TagLike;
use mp4ameta;
use metaflac;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm::framebuffer::Dimensions;
use ming_wm::themes::ThemeInfo;
use ming_wm::utils::{ concat_paths, format_seconds, Substring };
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm_lib::framebuffer_types::Dimensions;
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::utils::{ concat_paths, format_seconds, Substring };
use ming_wm_lib::dirs::home;
use ming_wm_lib::ipc::listen;
use ming_wm::fs::get_all_files;
use ming_wm::dirs::home;
use ming_wm::ipc::listen;
fn get_artist(path: &PathBuf) -> Option<String> {
let ext = path.extension().unwrap();
@@ -29,11 +29,12 @@ fn get_artist(path: &PathBuf) -> Option<String> {
tag.artist().map(|s| s.to_string())
} else if ext == "flac" {
let tag = metaflac::Tag::read_from_path(path).unwrap();
if let Some(mut artists) = tag.get_vorbis("Artist") {
let x = if let Some(mut artists) = tag.get_vorbis("Artist") {
Some(artists.next().unwrap().to_string()) //get the first one
} else {
None
}
};
x
} else if ext == "mp3" {
let tag = id3::Tag::read_from_path(path).unwrap();
tag.artist().map(|s| s.to_string())

View File

@@ -3,11 +3,11 @@ use std::vec;
use std::fs::{ read_dir, metadata, Metadata };
use std::path::PathBuf;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm::framebuffer::Dimensions;
use ming_wm::themes::ThemeInfo;
use ming_wm::ipc::listen;
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm_lib::framebuffer_types::Dimensions;
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::ipc::listen;
const HEIGHT: usize = 20;

View File

@@ -10,11 +10,26 @@ use linux_framebuffer::Framebuffer;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use termion::{ clear, cursor };
use termion::event::Key;
use ming_wm_lib::window_manager_types::KeyChar;
use ming_wm_lib::messages::*;
use ming_wm::framebuffer::{ FramebufferWriter, FramebufferInfo };
use ming_wm::window_manager::{ WindowManager, KeyChar };
use ming_wm::utils::key_to_char;
use ming_wm::messages::*;
use ming_wm::window_manager::WindowManager;
//use Linear A for escape, backspace, enter
//Linear A used only internally in onscreen keyboard: 𐘎 is alt, 𐘧 is switch board, 𐘾 is ctrl
fn key_to_char(key: Key) -> Option<KeyChar> {
match key {
Key::Char('\n') => Some(KeyChar::Press('𐘂')),
Key::Char(c) => Some(KeyChar::Press(c)),
Key::Alt(c) => Some(KeyChar::Alt(c)),
Key::Ctrl(c) => Some(KeyChar::Ctrl(c)),
Key::Backspace => Some(KeyChar::Press('𐘁')),
Key::Esc => Some(KeyChar::Press('𐘃')),
_ => None,
}
}
pub enum ThreadMessage {
KeyChar(KeyChar),

View File

@@ -4,13 +4,13 @@ use std::fmt;
use std::path::PathBuf;
use std::fs::{ read_to_string, write };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse, WindowManagerRequest, ShortcutType };
use ming_wm::themes::ThemeInfo;
use ming_wm::framebuffer::Dimensions;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::utils::{ calc_actual_lines, calc_new_cursor_pos, Substring };
use ming_wm::dirs::home;
use ming_wm::ipc::listen;
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManagerRequest, ShortcutType };
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::framebuffer_types::Dimensions;
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::utils::{ calc_actual_lines, calc_new_cursor_pos, Substring };
use ming_wm_lib::dirs::home;
use ming_wm_lib::ipc::listen;
const MONO_WIDTH: u8 = 10;
const LINE_HEIGHT: usize = 18;

View File

@@ -3,12 +3,12 @@ use std::vec;
use std::collections::VecDeque;
use core::convert::TryFrom;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm::framebuffer::Dimensions;
use ming_wm::themes::ThemeInfo;
use ming_wm::utils::{ u8_to_hex, hex_to_u8, HEX_CHARS };
use ming_wm::ipc::listen;
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm_lib::framebuffer_types::Dimensions;
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::utils::{ u8_to_hex, hex_to_u8, HEX_CHARS };
use ming_wm_lib::ipc::listen;
//16x16 with 40 mines

View File

@@ -1,11 +1,11 @@
use std::vec::Vec;
use std::vec;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm::framebuffer::{ Dimensions, RGBColor };
use ming_wm::themes::ThemeInfo;
use ming_wm::ipc::listen;
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
use ming_wm_lib::framebuffer_types::{ Dimensions, RGBColor };
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::ipc::listen;
const REVERSI_GREEN: RGBColor = [72, 93, 63];

View File

@@ -10,13 +10,13 @@ use std::fmt;
use pty_process::blocking;
use ming_wm::window_manager::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm::messages::{ WindowMessage, WindowMessageResponse, ShortcutType };
use ming_wm::framebuffer::Dimensions;
use ming_wm::themes::ThemeInfo;
use ming_wm::utils::{ concat_paths, Substring };
use ming_wm::dirs::home;
use ming_wm::ipc::listen;
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, ShortcutType };
use ming_wm_lib::framebuffer_types::Dimensions;
use ming_wm_lib::themes::ThemeInfo;
use ming_wm_lib::utils::{ concat_paths, Substring };
use ming_wm_lib::dirs::home;
use ming_wm_lib::ipc::listen;
//todo: support copy and paste