forked from max_ag/wayland_panel
Show white bar on both monitors
This commit is contained in:
parent
4687c2ce05
commit
70ad7e9b65
10 changed files with 5993 additions and 20 deletions
19
.direnv/bin/nix-direnv-reload
Executable file
19
.direnv/bin/nix-direnv-reload
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ ! -d "/mnt/removable/Projects/Rust/wayland_panel" ]]; then
|
||||
echo "Cannot find source directory; Did you move it?"
|
||||
echo "(Looking for "/mnt/removable/Projects/Rust/wayland_panel")"
|
||||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# rebuild the cache forcefully
|
||||
_nix_direnv_force_reload=1 direnv exec "/mnt/removable/Projects/Rust/wayland_panel" true
|
||||
|
||||
# Update the mtime for .envrc.
|
||||
# This will cause direnv to reload again - but without re-building.
|
||||
touch "/mnt/removable/Projects/Rust/wayland_panel/.envrc"
|
||||
|
||||
# Also update the timestamp of whatever profile_rc we have.
|
||||
# This makes sure that we know we are up to date.
|
||||
touch -r "/mnt/removable/Projects/Rust/wayland_panel/.envrc" "/mnt/removable/Projects/Rust/wayland_panel/.direnv"/*.rc
|
||||
1
.direnv/flake-inputs/f1fvmylh0lvki8f5b9p2l1s9g4bm69vx-source
Symbolic link
1
.direnv/flake-inputs/f1fvmylh0lvki8f5b9p2l1s9g4bm69vx-source
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/f1fvmylh0lvki8f5b9p2l1s9g4bm69vx-source
|
||||
1
.direnv/flake-inputs/sgbaklhjmn4dm32y5fvmg70hccrr47qa-source
Symbolic link
1
.direnv/flake-inputs/sgbaklhjmn4dm32y5fvmg70hccrr47qa-source
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/sgbaklhjmn4dm32y5fvmg70hccrr47qa-source
|
||||
1
.direnv/flake-inputs/wygnldpfirbkskf6qpjbghvaqh3kkczb-source
Symbolic link
1
.direnv/flake-inputs/wygnldpfirbkskf6qpjbghvaqh3kkczb-source
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/wygnldpfirbkskf6qpjbghvaqh3kkczb-source
|
||||
1
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa
Symbolic link
1
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/sw4zwpy7r16mhiqlx6niqmrfa16niy10-nix-shell-env
|
||||
2223
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
Normal file
2223
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
Normal file
File diff suppressed because it is too large
Load diff
3658
Cargo.lock
generated
Normal file
3658
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
14
Cargo.toml
14
Cargo.toml
|
|
@ -4,3 +4,17 @@ version = "0.1.0"
|
|||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
iced = { version = "0.14.0", default-features = false, features = ["wgpu", "wayland", "tokio"] }
|
||||
iced_layershell = { version = "0.15.0", default-features = false }
|
||||
winit = { version = "0.30.12", default-features = false, features = ["wayland"] }
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
strip = "symbols"
|
||||
panic = "abort"
|
||||
debug = false
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 1
|
||||
|
|
|
|||
36
flake.nix
36
flake.nix
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
description = "My rust development shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
rust-overlay = {
|
||||
|
|
@ -7,6 +8,7 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {nixpkgs, ...} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
overlays = [(import inputs.rust-overlay)];
|
||||
|
|
@ -18,29 +20,27 @@
|
|||
extensions = ["rust-analyzer" "rust-src"];
|
||||
};
|
||||
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
};
|
||||
runtimeLibs = with pkgs; [
|
||||
wayland
|
||||
libxkbcommon
|
||||
glib
|
||||
vulkan-loader
|
||||
mesa
|
||||
libGL
|
||||
];
|
||||
in {
|
||||
packages."${system}" = {
|
||||
default = rustPlatform.buildRustPackage {
|
||||
pname = "wayland_panel";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
};
|
||||
|
||||
devShells."${system}" = {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
devShells."${system}".default = pkgs.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
gcc
|
||||
gnumake
|
||||
rustToolchain
|
||||
evcxr
|
||||
];
|
||||
};
|
||||
]
|
||||
++ runtimeLibs;
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs;
|
||||
VK_ICD_FILENAMES = "${pkgs.mesa}/share/vulkan/icd.d/intel_icd.x86_64.json";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
59
src/main.rs
59
src/main.rs
|
|
@ -1,3 +1,58 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use iced::Element;
|
||||
use iced::Subscription;
|
||||
use iced::Task;
|
||||
use iced::widget::Row;
|
||||
use iced::widget::container;
|
||||
use iced_layershell::daemon;
|
||||
use iced_layershell::reexport::Anchor;
|
||||
use iced_layershell::settings::LayerShellSettings;
|
||||
use iced_layershell::settings::Settings;
|
||||
use iced_layershell::to_layer_message;
|
||||
|
||||
pub fn main() -> Result<(), iced_layershell::Error> {
|
||||
daemon(App::default, || "rbaw".into(), App::update, App::view)
|
||||
.subscription(App::subscription)
|
||||
.settings(Settings {
|
||||
layer_settings: LayerShellSettings {
|
||||
size: Some((0, 32)),
|
||||
exclusive_zone: 32,
|
||||
anchor: Anchor::Top | Anchor::Left | Anchor::Right,
|
||||
start_mode: iced_layershell::settings::StartMode::AllScreens, // valid here in daemon
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
.run()
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct App {}
|
||||
|
||||
impl App {
|
||||
fn view(&self, _id: iced::window::Id) -> Element<'_, Message> {
|
||||
let content = Row::new();
|
||||
|
||||
container(content)
|
||||
.width(iced::Length::Fill)
|
||||
.height(iced::Length::Fill)
|
||||
.into()
|
||||
}
|
||||
fn update(&mut self, _message: Message) -> Task<Message> {
|
||||
Task::none()
|
||||
}
|
||||
fn style(&self, _theme: &iced::Theme) -> iced::theme::Style {
|
||||
todo!()
|
||||
}
|
||||
fn theme(&self) -> iced::Theme {
|
||||
todo!()
|
||||
}
|
||||
fn subscription(&self) -> iced::Subscription<Message> {
|
||||
Subscription::none()
|
||||
}
|
||||
}
|
||||
|
||||
#[to_layer_message]
|
||||
#[derive(Debug)]
|
||||
enum Message {
|
||||
IcedEvent(iced::Event),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue