Skip to content

Commit bcac2cc

Browse files
committed
Merge branch 'master' into recent-actions
2 parents 1b50341 + 5d5f378 commit bcac2cc

17 files changed

Lines changed: 827 additions & 170 deletions

File tree

Cargo.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ objc2-foundation = { version = "0.3.2", features = ["NSString"] }
3030
once_cell = "1.21.3"
3131
rand = "0.9.2"
3232
rayon = "1.11.0"
33+
rfd = "0.17.2"
3334
serde = { version = "1.0.228", features = ["derive"] }
3435
serde_json = "1.0.149"
3536
tokio = { version = "1.48.0", features = ["full"] }

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@
2727
</a>
2828
</p>
2929

30+
> [Those who sponsor me also get a personal easter egg inside RustCast](https://github.com/sponsors/unsecretised)
31+
3032
**Config docs:** https://github.com/unsecretised/rustcast/wiki
3133

3234
**Community:** https://discord.gg/bDfNYPbnC5
3335

3436
**Plugins**:
3537
[RustCast Library for shell scripts](https://github.com/unsecretised/rustcast-library)
3638

39+
> For support use github discussions / issues / the discord
40+
>
41+
> You can also contact unsecretised / secretised at
42+
> [admin@rustcast.app](mailto:admin+gh@rustcast.app)
43+
3744
![RustCast Demo](./docs/rustcast-latest-demo.png)
3845

3946
## Installation:
@@ -119,11 +126,12 @@ configure [The list](docs/config.toml).
119126
and has been using RustCast since almost the first version!
120127
- [Hriztam](https://github.com/hriztam) - Added support for unit conversions to
121128
rustcast
129+
- [Lars-Schumann](https://github.com/Lars-Schumann) - Sponsored me
130+
- [Tanishq Dubey](https://github.com/tanishq-dubey) - Contributor, improved the
131+
file search to use `mdfind`
132+
- [JON](https://github.com/jiasunzhu613) - Contributor,
122133

123-
All the people who starred my repo!!
124-
125-
Those who sponsor me also get a free easter egg inside RustCast, so if you want
126-
a free easter egg, a dollar is all you need!
134+
And ofc, all the people who starred my repo!!
127135

128136
And the updated list of contributors to the macos version:
129137

@@ -135,6 +143,8 @@ And the updated list of contributors to the macos version:
135143

136144
- Nazeofel (Random Variable on discord) -> led to the _randomvar_ easter egg
137145
- Lemon -> led to the _lemon_ easter egg that shows "lemon" on rustcast
146+
- Lars-Schumann -> search _f_ and get ferris.rs as a result
147+
- Me -> 67
138148

139149
## If you like rustcast, consider starring it on github :)
140150

docs/index.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
href="https://github.com/sponsors/unsecretised"
3131
class="nav-sponsor"
3232
target="_blank"
33-
>Sponsor</a>
33+
>Get your easter egg</a>
3434
</li>
3535
<li>
3636
<a
@@ -75,8 +75,8 @@ <h1>The <em>fastest</em> launcher<br />you'll ever use</h1>
7575
</a>
7676
</div>
7777
<div class="stats-row">
78-
<div class="stat"><strong>400+</strong> stars</div>
79-
<div class="stat"><strong>1.1k+</strong> downloads</div>
78+
<div class="stat"><strong>500+</strong> stars</div>
79+
<div class="stat"><strong>1.2k+</strong> downloads</div>
8080
<div class="stat"><strong>100%</strong> free forever</div>
8181
<div class="stat"><strong>MIT</strong> license</div>
8282
</div>
@@ -464,6 +464,20 @@ <h2>Built by the community</h2>
464464
>
465465
<span class="gh-icon"></span>Lars - Sponsor
466466
</a>
467+
<a
468+
href="https://github.com/tanishq-dubey"
469+
class="contrib-chip"
470+
target="_blank"
471+
>
472+
<span class="gh-icon"></span> Tanishq Dubey - Contributor
473+
</a>
474+
<a
475+
href="https://github.com/jiasunzhu613"
476+
class="contrib-chip"
477+
target="_blank"
478+
>
479+
<span class="gh-icon"></span> JON - Contributor
480+
</a>
467481
</div>
468482
<div class="sponsor-cta-row">
469483
<a

src/app.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,17 @@ pub enum Move {
6969
Forwards(String),
7070
}
7171

72+
#[derive(Debug, Clone)]
73+
pub enum Editable<T> {
74+
Create(T),
75+
Delete(T),
76+
Update { old: T, new: T },
77+
}
78+
7279
/// The message type that iced uses for actions that can do something
7380
#[derive(Debug, Clone)]
7481
pub enum Message {
75-
WriteConfig,
82+
WriteConfig(bool),
7683
UpdateAvailable,
7784
ResizeWindow(Id, f32),
7885
OpenWindow,
@@ -85,6 +92,7 @@ pub enum Message {
8592
RunFunction(Function),
8693
OpenFocused,
8794
SetConfig(SetConfigFields),
95+
OpenFileDialogue(String),
8896
ReturnFocus,
8997
EscKeyPressed(Id),
9098
ClearSearchResults,
@@ -93,9 +101,11 @@ pub enum Message {
93101
HideTrayIcon,
94102
SwitchMode(String),
95103
ReloadConfig,
104+
UpdateApps,
96105
SetSender(ExtSender),
97106
SwitchToPage(Page),
98-
ClipboardHistory(ClipBoardContentType),
107+
EditClipboardHistory(Editable<ClipBoardContentType>),
108+
ClearClipboardHistory,
99109
ChangeFocus(ArrowKey, u32),
100110
FileSearchResult(Vec<App>),
101111
FileSearchClear,
@@ -104,6 +114,7 @@ pub enum Message {
104114
}
105115

106116
#[derive(Debug, Clone)]
117+
#[allow(unused)]
107118
pub enum SetConfigFields {
108119
ToDefault,
109120
ToggleHotkey(String),
@@ -112,16 +123,17 @@ pub enum SetConfigFields {
112123
SearchUrl(String),
113124
HapticFeedback(bool),
114125
ShowMenubarIcon(bool),
115-
// Modes(HashMap<String, String>),
116-
// Aliases(HashMap<String, String>),
117-
// SearchDirs(Vec<String>),
126+
Modes(Editable<(String, String)>),
127+
Aliases(Editable<(String, String)>),
128+
SearchDirs(Editable<Vec<String>>),
118129
DebounceDelay(u64),
119130
SetThemeFields(SetConfigThemeFields),
120131
SetBufferFields(SetConfigBufferFields),
121132
}
122133

123134
#[derive(Debug, Clone)]
124135
pub enum SetConfigThemeFields {
136+
ShowScrollBar(bool),
125137
TextColor(f32, f32, f32),
126138
BackgroundColor(f32, f32, f32),
127139
ShowIcons(bool),

src/app/apps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl App {
176176
Text::new(self.display_name)
177177
.font(theme.font())
178178
.size(16)
179-
.wrapping(Wrapping::WordOrGlyph)
179+
.wrapping(Wrapping::None)
180180
.color(theme.text_color(1.0)),
181181
)
182182
.push(

src/app/menubar.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub fn menu_icon(config: Config, sender: ExtSender) -> TrayIcon {
3939
}
4040

4141
pub fn menu_builder(config: Config, sender: ExtSender, update_item: bool) -> Menu {
42-
let hotkey = config.toggle_hotkey.parse::<HotKey>().unwrap();
42+
let hotkey = config.toggle_hotkey.parse::<HotKey>().ok();
4343

4444
let mut modes = config.modes;
4545
if !modes.contains_key("default") {
4646
modes.insert("Default".to_string(), "default".to_string());
4747
}
4848

49-
init_event_handler(sender, hotkey.id());
49+
init_event_handler(sender, hotkey.map(|x| x.id));
5050

5151
Menu::with_items(&[
5252
&MenuItem::with_id(
@@ -86,7 +86,7 @@ fn get_image() -> DynamicImage {
8686
.unwrap()
8787
}
8888

89-
fn init_event_handler(sender: ExtSender, hotkey_id: u32) {
89+
fn init_event_handler(sender: ExtSender, hotkey_id: Option<u32>) {
9090
let runtime = Runtime::new().unwrap();
9191

9292
MenuEvent::set_event_handler(Some(move |x: MenuEvent| {
@@ -107,12 +107,11 @@ fn init_event_handler(sender: ExtSender, hotkey_id: u32) {
107107
open_url("https://github.com/unsecretised/rustcast/issues/new");
108108
}
109109
"show_rustcast" => {
110-
runtime.spawn(async move {
111-
sender
112-
.clone()
113-
.try_send(Message::KeyPressed(hotkey_id))
114-
.unwrap();
115-
});
110+
if let Some(hk) = hotkey_id {
111+
runtime.spawn(async move {
112+
sender.clone().try_send(Message::KeyPressed(hk)).unwrap();
113+
});
114+
}
116115
}
117116
"update" => {
118117
open_url("https://github.com/unsecretised/rustcast/releases/latest");
@@ -179,12 +178,12 @@ fn mode_item(modes: HashMap<String, String>) -> Submenu {
179178
Submenu::with_items("Modes", true, &items).unwrap()
180179
}
181180

182-
fn open_item(hotkey: HotKey) -> MenuItem {
181+
fn open_item(hotkey: Option<HotKey>) -> MenuItem {
183182
MenuItem::with_id(
184183
"show_rustcast",
185184
"Toggle View",
186185
true,
187-
Some(Accelerator::new(Some(hotkey.mods), hotkey.key)),
186+
hotkey.map(|hk| Accelerator::new(Some(hk.mods), hk.key)),
188187
)
189188
}
190189

0 commit comments

Comments
 (0)