feat: Use upstream anyrun with a patch applied
This commit is contained in:
@@ -24,7 +24,7 @@ lib.optionalAttrs device.hasGui {
|
||||
./neovide.nix
|
||||
./nextcloud.nix
|
||||
./obs-studio.nix
|
||||
./openscad.nix
|
||||
# ./openscad.nix
|
||||
./orcaslicer.nix
|
||||
./pcsx2.nix
|
||||
# ./rpcs3.nix
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
imports = [inputs.anyrun.homeManagerModules.default];
|
||||
programs.anyrun = {
|
||||
enable = device.isDesktopLinux;
|
||||
package = inputs.anyrun.packages.${pkgs.system}.anyrun.overrideAttrs (finalAttrs: prevAttrs: {patches = [../../patches/ctrl-np.patch];});
|
||||
config = {
|
||||
plugins = with inputs.anyrun.packages.${pkgs.system}; [
|
||||
inputs.anyrun-nixos-options.packages.${pkgs.system}.default
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
};
|
||||
};
|
||||
displayManager.gdm.enable = true;
|
||||
desktopManager.gnome.enable = true;
|
||||
# desktopManager.gnome.enable = true;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
@@ -283,23 +283,23 @@
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
# etc
|
||||
gnome.excludePackages = with pkgs; [
|
||||
atomix # puzzle game
|
||||
cheese # webcam tool
|
||||
epiphany # web browser
|
||||
evince # document viewer
|
||||
geary # email reader
|
||||
gedit # text editor
|
||||
gnome-characters
|
||||
gnome-music
|
||||
gnome-photos
|
||||
gnome-terminal
|
||||
gnome-tour
|
||||
hitori # sudoku game
|
||||
iagno # go game
|
||||
tali # poker game
|
||||
totem # video player
|
||||
];
|
||||
# gnome.excludePackages = with pkgs; [
|
||||
# atomix # puzzle game
|
||||
# cheese # webcam tool
|
||||
# epiphany # web browser
|
||||
# evince # document viewer
|
||||
# geary # email reader
|
||||
# gedit # text editor
|
||||
# gnome-characters
|
||||
# gnome-music
|
||||
# gnome-photos
|
||||
# gnome-terminal
|
||||
# gnome-tour
|
||||
# hitori # sudoku game
|
||||
# iagno # go game
|
||||
# tali # poker game
|
||||
# totem # video player
|
||||
# ];
|
||||
};
|
||||
|
||||
musnix.enable = true;
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
# alvr-master = inputs.alvr.packages.${prev.system}.default;
|
||||
caddyWithHetzner = final.pkgs.caddy.withPlugins {
|
||||
plugins = ["github.com/caddy-dns/hetzner@v1.0.0"];
|
||||
hash = "sha256-J9eusS/Cx3kwIwVE0VlkWp3biWK3a4Z9/i2ufGQ+gtY=";
|
||||
hash = "sha256-OKzPdgF+tgsu9CxXr3kj9qXcXvyu3eJeajF90PKRatw=";
|
||||
};
|
||||
};
|
||||
anyrun-overlay = final: prev: {
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
diff --git a/anyrun/src/main.rs b/anyrun/src/main.rs
|
||||
index 59ff302..4a87ff3 100644
|
||||
--- a/anyrun/src/main.rs
|
||||
+++ b/anyrun/src/main.rs
|
||||
@@ -12,7 +12,11 @@ use std::{
|
||||
use abi_stable::std_types::{ROption, RVec};
|
||||
use anyrun_interface::{HandleResult, Match, PluginInfo, PluginRef, PollResult};
|
||||
use clap::{Parser, ValueEnum};
|
||||
-use gtk::{gdk, gdk_pixbuf, gio, glib, prelude::*};
|
||||
+use gtk::{
|
||||
+ gdk::{self, ModifierType},
|
||||
+ gdk_pixbuf, gio, glib,
|
||||
+ prelude::*,
|
||||
+};
|
||||
use nix::unistd;
|
||||
use serde::Deserialize;
|
||||
use wl_clipboard_rs::copy;
|
||||
@@ -477,14 +481,18 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
|
||||
|
||||
window.connect_key_press_event(move |window, event| {
|
||||
use gdk::keys::constants;
|
||||
- match event.keyval() {
|
||||
+ match (event.state(), event.keyval()) {
|
||||
// Close window on escape
|
||||
- constants::Escape => {
|
||||
+ (_, constants::Escape) => {
|
||||
window.close();
|
||||
Inhibit(true)
|
||||
}
|
||||
// Handle selections
|
||||
- constants::Down | constants::Tab | constants::Up => {
|
||||
+ (_, constants::Down)
|
||||
+ | (_, constants::Tab)
|
||||
+ | (_, constants::Up)
|
||||
+ | (ModifierType::CONTROL_MASK, constants::p)
|
||||
+ | (ModifierType::CONTROL_MASK, constants::n) => {
|
||||
// Combine all of the matches into a `Vec` to allow for easier handling of the selection
|
||||
let combined_matches = runtime_data_clone
|
||||
.borrow()
|
||||
@@ -511,10 +519,12 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
|
||||
// If nothing is selected select either the top or bottom match based on the input
|
||||
if !combined_matches.is_empty() {
|
||||
match event.keyval() {
|
||||
- constants::Down | constants::Tab => combined_matches[0]
|
||||
- .1
|
||||
- .select_row(Some(&combined_matches[0].0)),
|
||||
- constants::Up => {
|
||||
+ constants::Down | constants::Tab | constants::n => {
|
||||
+ combined_matches[0]
|
||||
+ .1
|
||||
+ .select_row(Some(&combined_matches[0].0))
|
||||
+ }
|
||||
+ constants::Up | constants::p => {
|
||||
combined_matches[combined_matches.len() - 1].1.select_row(
|
||||
Some(&combined_matches[combined_matches.len() - 1].0),
|
||||
)
|
||||
@@ -537,7 +547,7 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
|
||||
|
||||
// Move the selection based on the input, loops from top to bottom and vice versa
|
||||
match event.keyval() {
|
||||
- constants::Down | constants::Tab => {
|
||||
+ constants::Down | constants::Tab | constants::n => {
|
||||
if index < combined_matches.len() - 1 {
|
||||
combined_matches[index + 1]
|
||||
.1
|
||||
@@ -548,7 +558,7 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
|
||||
.select_row(Some(&combined_matches[0].0));
|
||||
}
|
||||
}
|
||||
- constants::Up => {
|
||||
+ constants::Up | constants::p => {
|
||||
if index > 0 {
|
||||
combined_matches[index - 1]
|
||||
.1
|
||||
@@ -565,7 +575,7 @@ fn activate(app: >k::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
|
||||
Inhibit(true)
|
||||
}
|
||||
// Handle when the selected match is "activated"
|
||||
- constants::Return | constants::KP_Enter => {
|
||||
+ (_, constants::Return) | (_, constants::KP_Enter) => {
|
||||
let mut _runtime_data_clone = runtime_data_clone.borrow_mut();
|
||||
|
||||
let (selected_match, plugin_view) = match _runtime_data_clone
|
||||
Reference in New Issue
Block a user