diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt
index 00cc67ea0..a36a6af3e 100644
--- a/.github/actions/spelling/allow.txt
+++ b/.github/actions/spelling/allow.txt
@@ -3,3 +3,6 @@ https
ssh
ubuntu
runcount
+Firefox
+Português
+Português (Brasil)
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
index 59566af64..02b486a02 100644
--- a/.github/actions/spelling/expect.txt
+++ b/.github/actions/spelling/expect.txt
@@ -74,6 +74,7 @@ WCA_ACCENT_POLICY
HGlobal
dopusrt
firefox
+Firefox
msedge
svgc
ime
diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
index 58b1cc467..7bb8fe200 100644
--- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
+++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
@@ -27,8 +27,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public string SelectNextItemHotkey2 { get; set; } = $"";
public string SelectPrevItemHotkey { get; set; } = $"Shift + Tab";
public string SelectPrevItemHotkey2 { get; set; } = $"";
- public string SelectNextPageHotkey { get; set; } = $"";
- public string SelectPrevPageHotkey { get; set; } = $"";
+ public string SelectNextPageHotkey { get; set; } = $"PageUp";
+ public string SelectPrevPageHotkey { get; set; } = $"PageDown";
public string OpenContextMenuHotkey { get; set; } = $"Ctrl+O";
public string SettingWindowHotkey { get; set; } = $"Ctrl+I";
diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml
index 04ecd03a2..b8c0e0497 100644
--- a/Flow.Launcher/Languages/en.xaml
+++ b/Flow.Launcher/Languages/en.xaml
@@ -185,9 +185,9 @@
Auto Complete
Runs autocomplete for the selected items.
Select Next Item
- Select Prev Item
+ Select Previous Item
Next Page
- Prev Page
+ Previous Page
Open Context Menu
Open Setting Window
Copy File Path
@@ -195,6 +195,7 @@
Toggle History
Open Containing Folder
Run As Admin
+ Refresh Search Results
Reload Plugins Data
Quick Adjust Window Width
Quick Adjust Window Height
diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index 9f04b1456..a234ea4be 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -26,6 +26,7 @@
LocationChanged="OnLocationChanged"
Opacity="{Binding MainWindowOpacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
PreviewKeyDown="OnKeyDown"
+ PreviewKeyUp="OnKeyUp"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs
index 76e587cdc..9c5ed46c0 100644
--- a/Flow.Launcher/MainWindow.xaml.cs
+++ b/Flow.Launcher/MainWindow.xaml.cs
@@ -47,6 +47,7 @@ namespace Flow.Launcher
private MainViewModel _viewModel;
private bool _animating;
MediaPlayer animationSound = new MediaPlayer();
+ private bool isArrowKeyPressed = false;
#endregion
@@ -109,9 +110,11 @@ namespace Flow.Launcher
private void OnInitialized(object sender, EventArgs e)
{
}
-
private void OnLoaded(object sender, RoutedEventArgs _)
{
+ // MouseEventHandler
+ PreviewMouseMove += MainPreviewMouseMove;
+
CheckFirstLaunch();
HideStartup();
// show notify icon when flowlauncher is hidden
@@ -406,6 +409,7 @@ namespace Flow.Launcher
if (_animating)
return;
+ isArrowKeyPressed = true;
_animating = true;
UpdatePosition();
@@ -494,6 +498,7 @@ namespace Flow.Launcher
windowsb.Completed += (_, _) => _animating = false;
_settings.WindowLeft = Left;
_settings.WindowTop = Top;
+ isArrowKeyPressed = false;
if (QueryTextBox.Text.Length == 0)
{
@@ -644,10 +649,12 @@ namespace Flow.Launcher
switch (e.Key)
{
case Key.Down:
+ isArrowKeyPressed = true;
_viewModel.SelectNextItemCommand.Execute(null);
e.Handled = true;
break;
case Key.Up:
+ isArrowKeyPressed = true;
_viewModel.SelectPrevItemCommand.Execute(null);
e.Handled = true;
break;
@@ -698,7 +705,21 @@ namespace Flow.Launcher
}
}
+ private void OnKeyUp(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Up || e.Key == Key.Down)
+ {
+ isArrowKeyPressed = false;
+ }
+ }
+ private void MainPreviewMouseMove(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ if (isArrowKeyPressed)
+ {
+ e.Handled = true; // Ignore Mouse Hover when press Arrowkeys
+ }
+ }
public void PreviewReset()
{
_viewModel.ResetPreview();
diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml
index 84b91e312..119268d6b 100644
--- a/Flow.Launcher/SettingWindow.xaml
+++ b/Flow.Launcher/SettingWindow.xaml
@@ -2802,7 +2802,13 @@
Title="{DynamicResource ToggleGameModeHotkey}"
Icon=""
Type="Inside">
-
+
+
+
+
GetBookmarks()
- {
- return LoadChromeBookmarks();
- }
+namespace Flow.Launcher.Plugin.BrowserBookmark;
- private List LoadChromeBookmarks()
- {
- var bookmarks = new List();
- var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Google\Chrome\User Data"), "Google Chrome"));
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Google\Chrome SxS\User Data"), "Google Chrome Canary"));
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Chromium\User Data"), "Chromium"));
- return bookmarks;
- }
+public class ChromeBookmarkLoader : ChromiumBookmarkLoader
+{
+ public override List GetBookmarks()
+ {
+ return LoadChromeBookmarks();
}
-}
\ No newline at end of file
+
+ private List LoadChromeBookmarks()
+ {
+ var bookmarks = new List();
+ var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Google\Chrome\User Data"), "Google Chrome"));
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Google\Chrome SxS\User Data"), "Google Chrome Canary"));
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Chromium\User Data"), "Chromium"));
+ return bookmarks;
+ }
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs
index 8ce597b30..48acf6109 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs
@@ -4,91 +4,90 @@ using System.IO;
using System.Text.Json;
using Flow.Launcher.Infrastructure.Logger;
-namespace Flow.Launcher.Plugin.BrowserBookmark
+namespace Flow.Launcher.Plugin.BrowserBookmark;
+
+public abstract class ChromiumBookmarkLoader : IBookmarkLoader
{
- public abstract class ChromiumBookmarkLoader : IBookmarkLoader
+ public abstract List GetBookmarks();
+
+ protected List LoadBookmarks(string browserDataPath, string name)
{
- public abstract List GetBookmarks();
+ var bookmarks = new List();
+ if (!Directory.Exists(browserDataPath)) return bookmarks;
+ var paths = Directory.GetDirectories(browserDataPath);
- protected List LoadBookmarks(string browserDataPath, string name)
+ foreach (var profile in paths)
{
- var bookmarks = new List();
- if (!Directory.Exists(browserDataPath)) return bookmarks;
- var paths = Directory.GetDirectories(browserDataPath);
+ var bookmarkPath = Path.Combine(profile, "Bookmarks");
+ if (!File.Exists(bookmarkPath))
+ continue;
- foreach (var profile in paths)
- {
- var bookmarkPath = Path.Combine(profile, "Bookmarks");
- if (!File.Exists(bookmarkPath))
- continue;
+ Main.RegisterBookmarkFile(bookmarkPath);
- Main.RegisterBookmarkFile(bookmarkPath);
+ var source = name + (Path.GetFileName(profile) == "Default" ? "" : $" ({Path.GetFileName(profile)})");
+ bookmarks.AddRange(LoadBookmarksFromFile(bookmarkPath, source));
+ }
- var source = name + (Path.GetFileName(profile) == "Default" ? "" : $" ({Path.GetFileName(profile)})");
- bookmarks.AddRange(LoadBookmarksFromFile(bookmarkPath, source));
- }
+ return bookmarks;
+ }
+ protected List LoadBookmarksFromFile(string path, string source)
+ {
+ var bookmarks = new List();
+
+ if (!File.Exists(path))
return bookmarks;
- }
- protected List LoadBookmarksFromFile(string path, string source)
- {
- var bookmarks = new List();
-
- if (!File.Exists(path))
- return bookmarks;
-
- using var jsonDocument = JsonDocument.Parse(File.ReadAllText(path));
- if (!jsonDocument.RootElement.TryGetProperty("roots", out var rootElement))
- return bookmarks;
- EnumerateRoot(rootElement, bookmarks, source);
+ using var jsonDocument = JsonDocument.Parse(File.ReadAllText(path));
+ if (!jsonDocument.RootElement.TryGetProperty("roots", out var rootElement))
return bookmarks;
- }
+ EnumerateRoot(rootElement, bookmarks, source);
+ return bookmarks;
+ }
- private void EnumerateRoot(JsonElement rootElement, ICollection bookmarks, string source)
+ private void EnumerateRoot(JsonElement rootElement, ICollection bookmarks, string source)
+ {
+ foreach (var folder in rootElement.EnumerateObject())
{
- foreach (var folder in rootElement.EnumerateObject())
- {
- if (folder.Value.ValueKind != JsonValueKind.Object)
- continue;
+ if (folder.Value.ValueKind != JsonValueKind.Object)
+ continue;
- // Fix for Opera. It stores bookmarks slightly different than chrome. See PR and bug report for this change for details.
- // If various exceptions start to build up here consider splitting this Loader into multiple separate ones.
- if (folder.Name == "custom_root")
- EnumerateRoot(folder.Value, bookmarks, source);
- else
- EnumerateFolderBookmark(folder.Value, bookmarks, source);
+ // Fix for Opera. It stores bookmarks slightly different than chrome. See PR and bug report for this change for details.
+ // If various exceptions start to build up here consider splitting this Loader into multiple separate ones.
+ if (folder.Name == "custom_root")
+ EnumerateRoot(folder.Value, bookmarks, source);
+ else
+ EnumerateFolderBookmark(folder.Value, bookmarks, source);
+ }
+ }
+
+ private void EnumerateFolderBookmark(JsonElement folderElement, ICollection bookmarks,
+ string source)
+ {
+ if (!folderElement.TryGetProperty("children", out var childrenElement))
+ return;
+ foreach (var subElement in childrenElement.EnumerateArray())
+ {
+ if (subElement.TryGetProperty("type", out var type))
+ {
+ switch (type.GetString())
+ {
+ case "folder":
+ case "workspace": // Edge Workspace
+ EnumerateFolderBookmark(subElement, bookmarks, source);
+ break;
+ default:
+ bookmarks.Add(new Bookmark(
+ subElement.GetProperty("name").GetString(),
+ subElement.GetProperty("url").GetString(),
+ source));
+ break;
+ }
}
- }
-
- private void EnumerateFolderBookmark(JsonElement folderElement, ICollection bookmarks,
- string source)
- {
- if (!folderElement.TryGetProperty("children", out var childrenElement))
- return;
- foreach (var subElement in childrenElement.EnumerateArray())
+ else
{
- if (subElement.TryGetProperty("type", out var type))
- {
- switch (type.GetString())
- {
- case "folder":
- case "workspace": // Edge Workspace
- EnumerateFolderBookmark(subElement, bookmarks, source);
- break;
- default:
- bookmarks.Add(new Bookmark(
- subElement.GetProperty("name").GetString(),
- subElement.GetProperty("url").GetString(),
- source));
- break;
- }
- }
- else
- {
- Log.Error(
- $"ChromiumBookmarkLoader: EnumerateFolderBookmark: type property not found for {subElement.GetString()}");
- }
+ Log.Error(
+ $"ChromiumBookmarkLoader: EnumerateFolderBookmark: type property not found for {subElement.GetString()}");
}
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs
index d08c05b6b..3468015eb 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs
@@ -4,56 +4,55 @@ using Flow.Launcher.Infrastructure;
using Flow.Launcher.Plugin.BrowserBookmark.Models;
using Flow.Launcher.Plugin.SharedModels;
-namespace Flow.Launcher.Plugin.BrowserBookmark.Commands
+namespace Flow.Launcher.Plugin.BrowserBookmark.Commands;
+
+internal static class BookmarkLoader
{
- internal static class BookmarkLoader
+ internal static MatchResult MatchProgram(Bookmark bookmark, string queryString)
{
- internal static MatchResult MatchProgram(Bookmark bookmark, string queryString)
- {
- var match = StringMatcher.FuzzySearch(queryString, bookmark.Name);
- if (match.IsSearchPrecisionScoreMet())
- return match;
+ var match = StringMatcher.FuzzySearch(queryString, bookmark.Name);
+ if (match.IsSearchPrecisionScoreMet())
+ return match;
- return StringMatcher.FuzzySearch(queryString, bookmark.Url);
+ return StringMatcher.FuzzySearch(queryString, bookmark.Url);
+ }
+
+ internal static List LoadAllBookmarks(Settings setting)
+ {
+ var allBookmarks = new List();
+
+ if (setting.LoadChromeBookmark)
+ {
+ // Add Chrome bookmarks
+ var chromeBookmarks = new ChromeBookmarkLoader();
+ allBookmarks.AddRange(chromeBookmarks.GetBookmarks());
}
- internal static List LoadAllBookmarks(Settings setting)
+ if (setting.LoadFirefoxBookmark)
{
- var allBookmarks = new List();
-
- if (setting.LoadChromeBookmark)
- {
- // Add Chrome bookmarks
- var chromeBookmarks = new ChromeBookmarkLoader();
- allBookmarks.AddRange(chromeBookmarks.GetBookmarks());
- }
-
- if (setting.LoadFirefoxBookmark)
- {
- // Add Firefox bookmarks
- var mozBookmarks = new FirefoxBookmarkLoader();
- allBookmarks.AddRange(mozBookmarks.GetBookmarks());
- }
-
- if (setting.LoadEdgeBookmark)
- {
- // Add Edge (Chromium) bookmarks
- var edgeBookmarks = new EdgeBookmarkLoader();
- allBookmarks.AddRange(edgeBookmarks.GetBookmarks());
- }
-
- foreach (var browser in setting.CustomChromiumBrowsers)
- {
- IBookmarkLoader loader = browser.BrowserType switch
- {
- BrowserType.Chromium => new CustomChromiumBookmarkLoader(browser),
- BrowserType.Firefox => new CustomFirefoxBookmarkLoader(browser),
- _ => new CustomChromiumBookmarkLoader(browser),
- };
- allBookmarks.AddRange(loader.GetBookmarks());
- }
-
- return allBookmarks.Distinct().ToList();
+ // Add Firefox bookmarks
+ var mozBookmarks = new FirefoxBookmarkLoader();
+ allBookmarks.AddRange(mozBookmarks.GetBookmarks());
}
+
+ if (setting.LoadEdgeBookmark)
+ {
+ // Add Edge (Chromium) bookmarks
+ var edgeBookmarks = new EdgeBookmarkLoader();
+ allBookmarks.AddRange(edgeBookmarks.GetBookmarks());
+ }
+
+ foreach (var browser in setting.CustomChromiumBrowsers)
+ {
+ IBookmarkLoader loader = browser.BrowserType switch
+ {
+ BrowserType.Chromium => new CustomChromiumBookmarkLoader(browser),
+ BrowserType.Firefox => new CustomFirefoxBookmarkLoader(browser),
+ _ => new CustomChromiumBookmarkLoader(browser),
+ };
+ allBookmarks.AddRange(loader.GetBookmarks());
+ }
+
+ return allBookmarks.Distinct().ToList();
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomChromiumBookmarkLoader.cs
index fa98f4d7c..005c83992 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomChromiumBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomChromiumBookmarkLoader.cs
@@ -1,19 +1,18 @@
using Flow.Launcher.Plugin.BrowserBookmark.Models;
using System.Collections.Generic;
-namespace Flow.Launcher.Plugin.BrowserBookmark
-{
- public class CustomChromiumBookmarkLoader : ChromiumBookmarkLoader
- {
- public CustomChromiumBookmarkLoader(CustomBrowser browser)
- {
- BrowserName = browser.Name;
- BrowserDataPath = browser.DataDirectoryPath;
- }
- public string BrowserDataPath { get; init; }
- public string BookmarkFilePath { get; init; }
- public string BrowserName { get; init; }
+namespace Flow.Launcher.Plugin.BrowserBookmark;
- public override List GetBookmarks() => BrowserDataPath != null ? LoadBookmarks(BrowserDataPath, BrowserName) : LoadBookmarksFromFile(BookmarkFilePath, BrowserName);
+public class CustomChromiumBookmarkLoader : ChromiumBookmarkLoader
+{
+ public CustomChromiumBookmarkLoader(CustomBrowser browser)
+ {
+ BrowserName = browser.Name;
+ BrowserDataPath = browser.DataDirectoryPath;
}
-}
\ No newline at end of file
+ public string BrowserDataPath { get; init; }
+ public string BookmarkFilePath { get; init; }
+ public string BrowserName { get; init; }
+
+ public override List GetBookmarks() => BrowserDataPath != null ? LoadBookmarks(BrowserDataPath, BrowserName) : LoadBookmarksFromFile(BookmarkFilePath, BrowserName);
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomFirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomFirefoxBookmarkLoader.cs
index 82bdc29f5..d0bb7b0cc 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomFirefoxBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomFirefoxBookmarkLoader.cs
@@ -2,26 +2,25 @@
using System.IO;
using Flow.Launcher.Plugin.BrowserBookmark.Models;
-namespace Flow.Launcher.Plugin.BrowserBookmark
-{
- public class CustomFirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
- {
- public CustomFirefoxBookmarkLoader(CustomBrowser browser)
- {
- BrowserName = browser.Name;
- BrowserDataPath = browser.DataDirectoryPath;
- }
-
- ///
- /// Path to places.sqlite
- ///
- public string BrowserDataPath { get; init; }
-
- public string BrowserName { get; init; }
+namespace Flow.Launcher.Plugin.BrowserBookmark;
- public override List GetBookmarks()
- {
- return GetBookmarksFromPath(Path.Combine(BrowserDataPath, "places.sqlite"));
- }
+public class CustomFirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
+{
+ public CustomFirefoxBookmarkLoader(CustomBrowser browser)
+ {
+ BrowserName = browser.Name;
+ BrowserDataPath = browser.DataDirectoryPath;
+ }
+
+ ///
+ /// Path to places.sqlite
+ ///
+ public string BrowserDataPath { get; init; }
+
+ public string BrowserName { get; init; }
+
+ public override List GetBookmarks()
+ {
+ return GetBookmarksFromPath(Path.Combine(BrowserDataPath, "places.sqlite"));
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs
index 79190f0ef..40123b022 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs
@@ -3,21 +3,20 @@ using System;
using System.Collections.Generic;
using System.IO;
-namespace Flow.Launcher.Plugin.BrowserBookmark
-{
- public class EdgeBookmarkLoader : ChromiumBookmarkLoader
- {
- private List LoadEdgeBookmarks()
- {
- var bookmarks = new List();
- var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge\User Data"), "Microsoft Edge"));
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge Dev\User Data"), "Microsoft Edge Dev"));
- bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge SxS\User Data"), "Microsoft Edge Canary"));
+namespace Flow.Launcher.Plugin.BrowserBookmark;
- return bookmarks;
- }
-
- public override List GetBookmarks() => LoadEdgeBookmarks();
+public class EdgeBookmarkLoader : ChromiumBookmarkLoader
+{
+ private List LoadEdgeBookmarks()
+ {
+ var bookmarks = new List();
+ var platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge\User Data"), "Microsoft Edge"));
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge Dev\User Data"), "Microsoft Edge Dev"));
+ bookmarks.AddRange(LoadBookmarks(Path.Combine(platformPath, @"Microsoft\Edge SxS\User Data"), "Microsoft Edge Canary"));
+
+ return bookmarks;
}
-}
\ No newline at end of file
+
+ public override List GetBookmarks() => LoadEdgeBookmarks();
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
index 3d061e758..35ad32fb3 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
@@ -5,140 +5,133 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
-namespace Flow.Launcher.Plugin.BrowserBookmark
+namespace Flow.Launcher.Plugin.BrowserBookmark;
+
+public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
{
- public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
- {
- public abstract List GetBookmarks();
+ public abstract List GetBookmarks();
- private const string queryAllBookmarks = @"SELECT moz_places.url, moz_bookmarks.title
- FROM moz_places
- INNER JOIN moz_bookmarks ON (
+ private const string QueryAllBookmarks = """
+ SELECT moz_places.url, moz_bookmarks.title
+ FROM moz_places
+ INNER JOIN moz_bookmarks ON (
moz_bookmarks.fk NOT NULL AND moz_bookmarks.title NOT NULL AND moz_bookmarks.fk = moz_places.id
- )
- ORDER BY moz_places.visit_count DESC
- ";
+ )
+ ORDER BY moz_places.visit_count DESC
+ """;
- private const string dbPathFormat = "Data Source ={0}";
+ private const string DbPathFormat = "Data Source ={0}";
- protected static List GetBookmarksFromPath(string placesPath)
- {
- // Return empty list if the places.sqlite file cannot be found
- if (string.IsNullOrEmpty(placesPath) || !File.Exists(placesPath))
- return new List();
+ protected static List GetBookmarksFromPath(string placesPath)
+ {
+ // Return empty list if the places.sqlite file cannot be found
+ if (string.IsNullOrEmpty(placesPath) || !File.Exists(placesPath))
+ return new List();
- var bookmarkList = new List();
+ Main.RegisterBookmarkFile(placesPath);
- Main.RegisterBookmarkFile(placesPath);
+ // create the connection string and init the connection
+ string dbPath = string.Format(DbPathFormat, placesPath);
+ using var dbConnection = new SqliteConnection(dbPath);
+ // Open connection to the database file and execute the query
+ dbConnection.Open();
+ var reader = new SqliteCommand(QueryAllBookmarks, dbConnection).ExecuteReader();
- // create the connection string and init the connection
- string dbPath = string.Format(dbPathFormat, placesPath);
- using var dbConnection = new SqliteConnection(dbPath);
- // Open connection to the database file and execute the query
- dbConnection.Open();
- var reader = new SqliteCommand(queryAllBookmarks, dbConnection).ExecuteReader();
-
- // return results in List format
- bookmarkList = reader.Select(
- x => new Bookmark(x["title"] is DBNull ? string.Empty : x["title"].ToString(),
- x["url"].ToString())
- ).ToList();
+ // return results in List format
+ return reader
+ .Select(
+ x => new Bookmark(
+ x["title"] is DBNull ? string.Empty : x["title"].ToString(),
+ x["url"].ToString()
+ )
+ )
+ .ToList();
+ }
+}
- return bookmarkList;
- }
+
+public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
+{
+ ///
+ /// Searches the places.sqlite db and returns all bookmarks
+ ///
+ public override List GetBookmarks()
+ {
+ return GetBookmarksFromPath(PlacesPath);
}
-
- public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
+ ///
+ /// Path to places.sqlite
+ ///
+ private string PlacesPath
{
- ///
- /// Searches the places.sqlite db and returns all bookmarks
- ///
- public override List GetBookmarks()
+ get
{
- return GetBookmarksFromPath(PlacesPath);
- }
-
- ///
- /// Path to places.sqlite
- ///
- private string PlacesPath
- {
- get
- {
- var profileFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Mozilla\Firefox");
- var profileIni = Path.Combine(profileFolderPath, @"profiles.ini");
+ var profileFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Mozilla\Firefox");
+ var profileIni = Path.Combine(profileFolderPath, @"profiles.ini");
- if (!File.Exists(profileIni))
- return string.Empty;
+ if (!File.Exists(profileIni))
+ return string.Empty;
- // get firefox default profile directory from profiles.ini
- string ini;
- using (var sReader = new StreamReader(profileIni))
- {
- ini = sReader.ReadToEnd();
- }
+ // get firefox default profile directory from profiles.ini
+ using var sReader = new StreamReader(profileIni);
+ var ini = sReader.ReadToEnd();
- /*
- Current profiles.ini structure example as of Firefox version 69.0.1
-
- [Install736426B0AF4A39CB]
- Default=Profiles/7789f565.default-release <== this is the default profile this plugin will get the bookmarks from. When opened Firefox will load the default profile
- Locked=1
+ /*
+ Current profiles.ini structure example as of Firefox version 69.0.1
- [Profile2]
- Name=newblahprofile
- IsRelative=0
- Path=C:\t6h2yuq8.newblahprofile <== Note this is a custom location path for the profile user can set, we need to cater for this in code.
+ [Install736426B0AF4A39CB]
+ Default=Profiles/7789f565.default-release <== this is the default profile this plugin will get the bookmarks from. When opened Firefox will load the default profile
+ Locked=1
- [Profile1]
- Name=default
- IsRelative=1
- Path=Profiles/cydum7q4.default
- Default=1
+ [Profile2]
+ Name=newblahprofile
+ IsRelative=0
+ Path=C:\t6h2yuq8.newblahprofile <== Note this is a custom location path for the profile user can set, we need to cater for this in code.
- [Profile0]
- Name=default-release
- IsRelative=1
- Path=Profiles/7789f565.default-release
+ [Profile1]
+ Name=default
+ IsRelative=1
+ Path=Profiles/cydum7q4.default
+ Default=1
- [General]
- StartWithLastProfile=1
- Version=2
- */
+ [Profile0]
+ Name=default-release
+ IsRelative=1
+ Path=Profiles/7789f565.default-release
- var lines = ini.Split(new string[]
- {
- "\r\n"
- }, StringSplitOptions.None).ToList();
+ [General]
+ StartWithLastProfile=1
+ Version=2
+ */
+ var lines = ini.Split("\r\n").ToList();
- var defaultProfileFolderNameRaw = lines.Where(x => x.Contains("Default=") && x != "Default=1").FirstOrDefault() ?? string.Empty;
+ var defaultProfileFolderNameRaw = lines.FirstOrDefault(x => x.Contains("Default=") && x != "Default=1") ?? string.Empty;
- if (string.IsNullOrEmpty(defaultProfileFolderNameRaw))
- return string.Empty;
+ if (string.IsNullOrEmpty(defaultProfileFolderNameRaw))
+ return string.Empty;
- var defaultProfileFolderName = defaultProfileFolderNameRaw.Split('=').Last();
+ var defaultProfileFolderName = defaultProfileFolderNameRaw.Split('=').Last();
- var indexOfDefaultProfileAtttributePath = lines.IndexOf("Path=" + defaultProfileFolderName);
+ var indexOfDefaultProfileAttributePath = lines.IndexOf("Path=" + defaultProfileFolderName);
- // Seen in the example above, the IsRelative attribute is always above the Path attribute
- var relativeAttribute = lines[indexOfDefaultProfileAtttributePath - 1];
+ // Seen in the example above, the IsRelative attribute is always above the Path attribute
+ var relativeAttribute = lines[indexOfDefaultProfileAttributePath - 1];
- return relativeAttribute == "0" // See above, the profile is located in a custom location, path is not relative, so IsRelative=0
- ? defaultProfileFolderName + @"\places.sqlite"
- : Path.Combine(profileFolderPath, defaultProfileFolderName) + @"\places.sqlite";
- }
- }
- }
-
- public static class Extensions
- {
- public static IEnumerable Select(this SqliteDataReader reader, Func projection)
- {
- while (reader.Read())
- {
- yield return projection(reader);
- }
+ return relativeAttribute == "0" // See above, the profile is located in a custom location, path is not relative, so IsRelative=0
+ ? defaultProfileFolderName + @"\places.sqlite"
+ : Path.Combine(profileFolderPath, defaultProfileFolderName) + @"\places.sqlite";
+ }
+ }
+}
+
+public static class Extensions
+{
+ public static IEnumerable Select(this SqliteDataReader reader, Func projection)
+ {
+ while (reader.Read())
+ {
+ yield return projection(reader);
}
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/IBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/IBookmarkLoader.cs
index 2c48cfd55..8a9727352 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/IBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/IBookmarkLoader.cs
@@ -1,10 +1,9 @@
using Flow.Launcher.Plugin.BrowserBookmark.Models;
using System.Collections.Generic;
-namespace Flow.Launcher.Plugin.BrowserBookmark
+namespace Flow.Launcher.Plugin.BrowserBookmark;
+
+public interface IBookmarkLoader
{
- public interface IBookmarkLoader
- {
- public List GetBookmarks();
- }
-}
\ No newline at end of file
+ public List GetBookmarks();
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
index a13d6c929..a48d70f2d 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Windows;
using System.Windows.Controls;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin.BrowserBookmark.Commands;
@@ -12,233 +11,234 @@ using System.Threading.Channels;
using System.Threading.Tasks;
using System.Threading;
-namespace Flow.Launcher.Plugin.BrowserBookmark
+namespace Flow.Launcher.Plugin.BrowserBookmark;
+
+public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContextMenu, IDisposable
{
- public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContextMenu, IDisposable
+ private static PluginInitContext _context;
+
+ private static List _cachedBookmarks = new List();
+
+ private static Settings _settings;
+
+ private static bool _initialized = false;
+
+ public void Init(PluginInitContext context)
{
- private static PluginInitContext context;
+ _context = context;
- private static List cachedBookmarks = new List();
+ _settings = context.API.LoadSettingJsonStorage();
- private static Settings _settings;
+ LoadBookmarksIfEnabled();
+ }
- private static bool initialized = false;
-
- public void Init(PluginInitContext context)
+ private static void LoadBookmarksIfEnabled()
+ {
+ if (_context.CurrentPluginMetadata.Disabled)
{
- Main.context = context;
+ // Don't load or monitor files if disabled
+ return;
+ }
- _settings = context.API.LoadSettingJsonStorage();
+ _cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
+ _ = MonitorRefreshQueueAsync();
+ _initialized = true;
+ }
+ public List Query(Query query)
+ {
+ // For when the plugin being previously disabled and is now re-enabled
+ if (!_initialized)
+ {
LoadBookmarksIfEnabled();
}
- private static void LoadBookmarksIfEnabled()
+ string param = query.Search.TrimStart();
+
+ // Should top results be returned? (true if no search parameters have been passed)
+ var topResults = string.IsNullOrEmpty(param);
+
+
+ if (!topResults)
{
- if (context.CurrentPluginMetadata.Disabled)
- {
- // Don't load or monitor files if disabled
- return;
- }
-
- cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
- _ = MonitorRefreshQueueAsync();
- initialized = true;
- }
-
- public List Query(Query query)
- {
- // For when the plugin being previously disabled and is now renabled
- if (!initialized)
- {
- LoadBookmarksIfEnabled();
- }
-
- string param = query.Search.TrimStart();
-
- // Should top results be returned? (true if no search parameters have been passed)
- var topResults = string.IsNullOrEmpty(param);
-
-
- if (!topResults)
- {
- // Since we mixed chrome and firefox bookmarks, we should order them again
- var returnList = cachedBookmarks.Select(c => new Result()
- {
- Title = c.Name,
- SubTitle = c.Url,
- IcoPath = @"Images\bookmark.png",
- Score = BookmarkLoader.MatchProgram(c, param).Score,
- Action = _ =>
+ // Since we mixed chrome and firefox bookmarks, we should order them again
+ return _cachedBookmarks
+ .Select(
+ c => new Result
{
- context.API.OpenUrl(c.Url);
-
- return true;
- },
- ContextData = new BookmarkAttributes
- {
- Url = c.Url
- }
- }).Where(r => r.Score > 0);
- return returnList.ToList();
- }
- else
- {
- return cachedBookmarks.Select(c => new Result()
- {
- Title = c.Name,
- SubTitle = c.Url,
- IcoPath = @"Images\bookmark.png",
- Score = 5,
- Action = _ =>
- {
- context.API.OpenUrl(c.Url);
- return true;
- },
- ContextData = new BookmarkAttributes
- {
- Url = c.Url
- }
- }).ToList();
- }
- }
-
-
- private static Channel refreshQueue = Channel.CreateBounded(1);
-
- private static SemaphoreSlim fileMonitorSemaphore = new(1, 1);
-
- private static async Task MonitorRefreshQueueAsync()
- {
- if (fileMonitorSemaphore.CurrentCount < 1)
- {
- return;
- }
- await fileMonitorSemaphore.WaitAsync();
- var reader = refreshQueue.Reader;
- while (await reader.WaitToReadAsync())
- {
- if (reader.TryRead(out _))
- {
- ReloadAllBookmarks(false);
- }
- }
- fileMonitorSemaphore.Release();
- }
-
- private static readonly List Watchers = new();
-
- internal static void RegisterBookmarkFile(string path)
- {
- var directory = Path.GetDirectoryName(path);
- if (!Directory.Exists(directory) || !File.Exists(path))
- {
- return;
- }
- if (Watchers.Any(x => x.Path.Equals(directory, StringComparison.OrdinalIgnoreCase)))
- {
- return;
- }
-
- var watcher = new FileSystemWatcher(directory!);
- watcher.Filter = Path.GetFileName(path);
-
- watcher.NotifyFilter = NotifyFilters.FileName |
- NotifyFilters.LastWrite |
- NotifyFilters.Size;
-
- watcher.Changed += static (_, _) =>
- {
- refreshQueue.Writer.TryWrite(default);
- };
-
- watcher.Renamed += static (_, _) =>
- {
- refreshQueue.Writer.TryWrite(default);
- };
-
- watcher.EnableRaisingEvents = true;
-
- Watchers.Add(watcher);
- }
-
- public void ReloadData()
- {
- ReloadAllBookmarks();
- }
-
- public static void ReloadAllBookmarks(bool disposeFileWatchers = true)
- {
- cachedBookmarks.Clear();
- if (disposeFileWatchers)
- DisposeFileWatchers();
- LoadBookmarksIfEnabled();
- }
-
- public string GetTranslatedPluginTitle()
- {
- return context.API.GetTranslation("flowlauncher_plugin_browserbookmark_plugin_name");
- }
-
- public string GetTranslatedPluginDescription()
- {
- return context.API.GetTranslation("flowlauncher_plugin_browserbookmark_plugin_description");
- }
-
- public Control CreateSettingPanel()
- {
- return new SettingsControl(_settings);
- }
-
- public List LoadContextMenus(Result selectedResult)
- {
- return new List()
- {
- new Result
- {
- Title = context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_title"),
- SubTitle = context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_subtitle"),
- Action = _ =>
- {
- try
+ Title = c.Name,
+ SubTitle = c.Url,
+ IcoPath = @"Images\bookmark.png",
+ Score = BookmarkLoader.MatchProgram(c, param).Score,
+ Action = _ =>
{
- context.API.CopyToClipboard(((BookmarkAttributes)selectedResult.ContextData).Url);
+ _context.API.OpenUrl(c.Url);
return true;
- }
- catch (Exception e)
+ },
+ ContextData = new BookmarkAttributes { Url = c.Url }
+ }
+ )
+ .Where(r => r.Score > 0)
+ .ToList();
+ }
+ else
+ {
+ return _cachedBookmarks
+ .Select(
+ c => new Result
+ {
+ Title = c.Name,
+ SubTitle = c.Url,
+ IcoPath = @"Images\bookmark.png",
+ Score = 5,
+ Action = _ =>
{
- var message = "Failed to set url in clipboard";
- Log.Exception("Main", message, e, "LoadContextMenus");
-
- context.API.ShowMsg(message);
-
- return false;
- }
- },
- IcoPath = "Images\\copylink.png",
- Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8")
- }
- };
- }
-
- internal class BookmarkAttributes
- {
- internal string Url { get; set; }
- }
-
- public void Dispose()
- {
- DisposeFileWatchers();
- }
-
- private static void DisposeFileWatchers()
- {
- foreach (var watcher in Watchers)
- {
- watcher.Dispose();
- }
- Watchers.Clear();
+ _context.API.OpenUrl(c.Url);
+ return true;
+ },
+ ContextData = new BookmarkAttributes { Url = c.Url }
+ }
+ )
+ .ToList();
}
}
+
+
+ private static Channel _refreshQueue = Channel.CreateBounded(1);
+
+ private static SemaphoreSlim _fileMonitorSemaphore = new(1, 1);
+
+ private static async Task MonitorRefreshQueueAsync()
+ {
+ if (_fileMonitorSemaphore.CurrentCount < 1)
+ {
+ return;
+ }
+ await _fileMonitorSemaphore.WaitAsync();
+ var reader = _refreshQueue.Reader;
+ while (await reader.WaitToReadAsync())
+ {
+ if (reader.TryRead(out _))
+ {
+ ReloadAllBookmarks(false);
+ }
+ }
+ _fileMonitorSemaphore.Release();
+ }
+
+ private static readonly List Watchers = new();
+
+ internal static void RegisterBookmarkFile(string path)
+ {
+ var directory = Path.GetDirectoryName(path);
+ if (!Directory.Exists(directory) || !File.Exists(path))
+ {
+ return;
+ }
+ if (Watchers.Any(x => x.Path.Equals(directory, StringComparison.OrdinalIgnoreCase)))
+ {
+ return;
+ }
+
+ var watcher = new FileSystemWatcher(directory!);
+ watcher.Filter = Path.GetFileName(path);
+
+ watcher.NotifyFilter = NotifyFilters.FileName |
+ NotifyFilters.LastWrite |
+ NotifyFilters.Size;
+
+ watcher.Changed += static (_, _) =>
+ {
+ _refreshQueue.Writer.TryWrite(default);
+ };
+
+ watcher.Renamed += static (_, _) =>
+ {
+ _refreshQueue.Writer.TryWrite(default);
+ };
+
+ watcher.EnableRaisingEvents = true;
+
+ Watchers.Add(watcher);
+ }
+
+ public void ReloadData()
+ {
+ ReloadAllBookmarks();
+ }
+
+ public static void ReloadAllBookmarks(bool disposeFileWatchers = true)
+ {
+ _cachedBookmarks.Clear();
+ if (disposeFileWatchers)
+ DisposeFileWatchers();
+ LoadBookmarksIfEnabled();
+ }
+
+ public string GetTranslatedPluginTitle()
+ {
+ return _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_plugin_name");
+ }
+
+ public string GetTranslatedPluginDescription()
+ {
+ return _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_plugin_description");
+ }
+
+ public Control CreateSettingPanel()
+ {
+ return new SettingsControl(_settings);
+ }
+
+ public List LoadContextMenus(Result selectedResult)
+ {
+ return new List()
+ {
+ new Result
+ {
+ Title = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_title"),
+ SubTitle = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_subtitle"),
+ Action = _ =>
+ {
+ try
+ {
+ _context.API.CopyToClipboard(((BookmarkAttributes)selectedResult.ContextData).Url);
+
+ return true;
+ }
+ catch (Exception e)
+ {
+ var message = "Failed to set url in clipboard";
+ Log.Exception("Main", message, e, "LoadContextMenus");
+
+ _context.API.ShowMsg(message);
+
+ return false;
+ }
+ },
+ IcoPath = @"Images\copylink.png",
+ Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8")
+ }
+ };
+ }
+
+ internal class BookmarkAttributes
+ {
+ internal string Url { get; set; }
+ }
+
+ public void Dispose()
+ {
+ DisposeFileWatchers();
+ }
+
+ private static void DisposeFileWatchers()
+ {
+ foreach (var watcher in Watchers)
+ {
+ watcher.Dispose();
+ }
+ Watchers.Clear();
+ }
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Bookmark.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Bookmark.cs
index c2fa9d977..c738da389 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Bookmark.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Bookmark.cs
@@ -1,22 +1,21 @@
using System.Collections.Generic;
-namespace Flow.Launcher.Plugin.BrowserBookmark.Models
+namespace Flow.Launcher.Plugin.BrowserBookmark.Models;
+
+// Source may be important in the future
+public record Bookmark(string Name, string Url, string Source = "")
{
- // Source may be important in the future
- public record Bookmark(string Name, string Url, string Source = "")
+ public override int GetHashCode()
{
- public override int GetHashCode()
- {
- var hashName = Name?.GetHashCode() ?? 0;
- var hashUrl = Url?.GetHashCode() ?? 0;
- return hashName ^ hashUrl;
- }
-
- public virtual bool Equals(Bookmark other)
- {
- return other != null && Name == other.Name && Url == other.Url;
- }
-
- public List CustomBrowsers { get; set; }= new();
+ var hashName = Name?.GetHashCode() ?? 0;
+ var hashUrl = Url?.GetHashCode() ?? 0;
+ return hashName ^ hashUrl;
}
-}
\ No newline at end of file
+
+ public virtual bool Equals(Bookmark other)
+ {
+ return other != null && Name == other.Name && Url == other.Url;
+ }
+
+ public List CustomBrowsers { get; set; } = new();
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/CustomBrowser.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/CustomBrowser.cs
index 69bb56e48..74e0f299a 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/CustomBrowser.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/CustomBrowser.cs
@@ -1,45 +1,44 @@
-namespace Flow.Launcher.Plugin.BrowserBookmark.Models
-{
- public class CustomBrowser : BaseModel
- {
- private string _name;
- private string _dataDirectoryPath;
- private BrowserType browserType = BrowserType.Chromium;
+namespace Flow.Launcher.Plugin.BrowserBookmark.Models;
- public string Name
+public class CustomBrowser : BaseModel
+{
+ private string _name;
+ private string _dataDirectoryPath;
+ private BrowserType _browserType = BrowserType.Chromium;
+
+ public string Name
+ {
+ get => _name;
+ set
{
- get => _name;
- set
- {
- _name = value;
- OnPropertyChanged(nameof(Name));
- }
- }
-
- public string DataDirectoryPath
- {
- get => _dataDirectoryPath;
- set
- {
- _dataDirectoryPath = value;
- OnPropertyChanged(nameof(DataDirectoryPath));
- }
- }
-
- public BrowserType BrowserType
- {
- get => browserType;
- set
- {
- browserType = value;
- OnPropertyChanged(nameof(BrowserType));
- }
+ _name = value;
+ OnPropertyChanged();
}
}
- public enum BrowserType
+ public string DataDirectoryPath
{
- Chromium,
- Firefox,
+ get => _dataDirectoryPath;
+ set
+ {
+ _dataDirectoryPath = value;
+ OnPropertyChanged();
+ }
+ }
+
+ public BrowserType BrowserType
+ {
+ get => _browserType;
+ set
+ {
+ _browserType = value;
+ OnPropertyChanged();
+ }
}
}
+
+public enum BrowserType
+{
+ Chromium,
+ Firefox,
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs
index dc1016b4e..86532d275 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs
@@ -1,17 +1,16 @@
using System.Collections.ObjectModel;
-namespace Flow.Launcher.Plugin.BrowserBookmark.Models
+namespace Flow.Launcher.Plugin.BrowserBookmark.Models;
+
+public class Settings : BaseModel
{
- public class Settings : BaseModel
- {
- public bool OpenInNewBrowserWindow { get; set; } = true;
+ public bool OpenInNewBrowserWindow { get; set; } = true;
- public string BrowserPath { get; set; }
+ public string BrowserPath { get; set; }
- public bool LoadChromeBookmark { get; set; } = true;
- public bool LoadFirefoxBookmark { get; set; } = true;
- public bool LoadEdgeBookmark { get; set; } = true;
+ public bool LoadChromeBookmark { get; set; } = true;
+ public bool LoadFirefoxBookmark { get; set; } = true;
+ public bool LoadEdgeBookmark { get; set; } = true;
- public ObservableCollection CustomChromiumBrowsers { get; set; } = new();
- }
-}
\ No newline at end of file
+ public ObservableCollection CustomChromiumBrowsers { get; set; } = new();
+}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
index 392c9e0a7..f5017ced5 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
@@ -63,7 +63,6 @@
+/// Interaction logic for CustomBrowserSetting.xaml
+///
+public partial class CustomBrowserSettingWindow : Window
{
- ///
- /// Interaction logic for CustomBrowserSetting.xaml
- ///
- public partial class CustomBrowserSettingWindow : Window
+ private CustomBrowser _currentCustomBrowser;
+ public CustomBrowserSettingWindow(CustomBrowser browser)
{
- private CustomBrowser currentCustomBrowser;
- public CustomBrowserSettingWindow(CustomBrowser browser)
+ InitializeComponent();
+ _currentCustomBrowser = browser;
+ DataContext = new CustomBrowser
{
- InitializeComponent();
- currentCustomBrowser = browser;
- DataContext = new CustomBrowser
- {
- Name = browser.Name,
- DataDirectoryPath = browser.DataDirectoryPath,
- BrowserType = browser.BrowserType,
- };
- }
-
- private void ConfirmEditCustomBrowser(object sender, RoutedEventArgs e)
- {
- CustomBrowser editBrowser = (CustomBrowser)DataContext;
- currentCustomBrowser.Name = editBrowser.Name;
- currentCustomBrowser.DataDirectoryPath = editBrowser.DataDirectoryPath;
- currentCustomBrowser.BrowserType = editBrowser.BrowserType;
- DialogResult = true;
- Close();
- }
+ Name = browser.Name,
+ DataDirectoryPath = browser.DataDirectoryPath,
+ BrowserType = browser.BrowserType,
+ };
+ }
- private void CancelEditCustomBrowser(object sender, RoutedEventArgs e)
- {
- Close();
- }
+ private void ConfirmEditCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ CustomBrowser editBrowser = (CustomBrowser)DataContext;
+ _currentCustomBrowser.Name = editBrowser.Name;
+ _currentCustomBrowser.DataDirectoryPath = editBrowser.DataDirectoryPath;
+ _currentCustomBrowser.BrowserType = editBrowser.BrowserType;
+ DialogResult = true;
+ Close();
+ }
- private void WindowKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
- {
- if (e.Key == Key.Enter)
- {
- ConfirmEditCustomBrowser(sender, e);
- }
- }
+ private void CancelEditCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
- private void OnSelectPathClick(object sender, RoutedEventArgs e)
+ private void WindowKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter)
{
- var dialog = new FolderBrowserDialog();
- dialog.ShowDialog();
- CustomBrowser editBrowser = (CustomBrowser)DataContext;
- editBrowser.DataDirectoryPath = dialog.SelectedPath;
+ ConfirmEditCustomBrowser(sender, e);
}
}
+
+ private void OnSelectPathClick(object sender, RoutedEventArgs e)
+ {
+ var dialog = new FolderBrowserDialog();
+ dialog.ShowDialog();
+ CustomBrowser editBrowser = (CustomBrowser)DataContext;
+ editBrowser.DataDirectoryPath = dialog.SelectedPath;
+ }
}
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
index 2947c2cb5..4bdab89a9 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
@@ -4,119 +4,116 @@ using System.Windows.Input;
using System.ComponentModel;
using System.Threading.Tasks;
-namespace Flow.Launcher.Plugin.BrowserBookmark.Views
+namespace Flow.Launcher.Plugin.BrowserBookmark.Views;
+
+public partial class SettingsControl : INotifyPropertyChanged
{
- public partial class SettingsControl : INotifyPropertyChanged
+ public Settings Settings { get; }
+
+ public CustomBrowser SelectedCustomBrowser { get; set; }
+
+ public bool LoadChromeBookmark
{
- public Settings Settings { get; }
-
- public CustomBrowser SelectedCustomBrowser { get; set; }
-
- public bool LoadChromeBookmark
+ get => Settings.LoadChromeBookmark;
+ set
{
- get => Settings.LoadChromeBookmark;
- set
+ Settings.LoadChromeBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
+ public bool LoadFirefoxBookmark
+ {
+ get => Settings.LoadFirefoxBookmark;
+ set
+ {
+ Settings.LoadFirefoxBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
+ public bool LoadEdgeBookmark
+ {
+ get => Settings.LoadEdgeBookmark;
+ set
+ {
+ Settings.LoadEdgeBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
+ public bool OpenInNewBrowserWindow
+ {
+ get => Settings.OpenInNewBrowserWindow;
+ set
+ {
+ Settings.OpenInNewBrowserWindow = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OpenInNewBrowserWindow)));
+ }
+ }
+
+ public SettingsControl(Settings settings)
+ {
+ Settings = settings;
+ InitializeComponent();
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private void NewCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ var newBrowser = new CustomBrowser();
+ var window = new CustomBrowserSettingWindow(newBrowser);
+ window.ShowDialog();
+ if (newBrowser is not
{
- Settings.LoadChromeBookmark = value;
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
- }
-
- public bool LoadFirefoxBookmark
+ Name: null,
+ DataDirectoryPath: null
+ })
{
- get => Settings.LoadFirefoxBookmark;
- set
- {
- Settings.LoadFirefoxBookmark = value;
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
+ Settings.CustomChromiumBrowsers.Add(newBrowser);
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
}
+ }
- public bool LoadEdgeBookmark
+ private void DeleteCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ if (CustomBrowsers.SelectedItem is CustomBrowser selectedCustomBrowser)
{
- get => Settings.LoadEdgeBookmark;
- set
- {
- Settings.LoadEdgeBookmark = value;
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
+ Settings.CustomChromiumBrowsers.Remove(selectedCustomBrowser);
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
}
+ }
- public bool OpenInNewBrowserWindow
+ private void MouseDoubleClickOnSelectedCustomBrowser(object sender, MouseButtonEventArgs e)
+ {
+ EditSelectedCustomBrowser();
+ }
+
+ private void Others_Click(object sender, RoutedEventArgs e)
+ {
+ CustomBrowsersList.Visibility = CustomBrowsersList.Visibility switch
{
- get => Settings.OpenInNewBrowserWindow;
- set
- {
- Settings.OpenInNewBrowserWindow = value;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OpenInNewBrowserWindow)));
- }
- }
+ Visibility.Collapsed => Visibility.Visible,
+ _ => Visibility.Collapsed
+ };
+ }
- public SettingsControl(Settings settings)
+ private void EditCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ EditSelectedCustomBrowser();
+ }
+
+ private void EditSelectedCustomBrowser()
+ {
+ if (SelectedCustomBrowser is null)
+ return;
+
+ var window = new CustomBrowserSettingWindow(SelectedCustomBrowser);
+ var result = window.ShowDialog() ?? false;
+ if (result)
{
- Settings = settings;
- InitializeComponent();
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- private void NewCustomBrowser(object sender, RoutedEventArgs e)
- {
- var newBrowser = new CustomBrowser();
- var window = new CustomBrowserSettingWindow(newBrowser);
- window.ShowDialog();
- if (newBrowser is not
- {
- Name: null,
- DataDirectoryPath: null
- })
- {
- Settings.CustomChromiumBrowsers.Add(newBrowser);
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
- }
-
- private void DeleteCustomBrowser(object sender, RoutedEventArgs e)
- {
- if (CustomBrowsers.SelectedItem is CustomBrowser selectedCustomBrowser)
- {
- Settings.CustomChromiumBrowsers.Remove(selectedCustomBrowser);
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
- }
-
- private void MouseDoubleClickOnSelectedCustomBrowser(object sender, MouseButtonEventArgs e)
- {
- EditSelectedCustomBrowser();
- }
-
- private void Others_Click(object sender, RoutedEventArgs e)
- {
-
- if (CustomBrowsersList.Visibility == Visibility.Collapsed)
- {
- CustomBrowsersList.Visibility = Visibility.Visible;
- }
- else
- CustomBrowsersList.Visibility = Visibility.Collapsed;
- }
-
- private void EditCustomBrowser(object sender, RoutedEventArgs e)
- {
- EditSelectedCustomBrowser();
- }
-
- private void EditSelectedCustomBrowser()
- {
- if (SelectedCustomBrowser is null)
- return;
-
- var window = new CustomBrowserSettingWindow(SelectedCustomBrowser);
- var result = window.ShowDialog() ?? false;
- if (result)
- {
- _ = Task.Run(() => Main.ReloadAllBookmarks());
- }
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
}
}
}
diff --git a/README.md b/README.md
index 9ebbe246c..858d39d1c 100644
--- a/README.md
+++ b/README.md
@@ -16,77 +16,15 @@
-Dedicated to making your work flow more seamless. Search everything from applications, files, bookmarks, YouTube, Twitter and more. Flow will continue to evolve, designed to be open and built with the community at heart.
+A quick file search and app launcher for Windows with community-made plugins.
+
+
+Dedicated to making your work flow more seamless. Search everything from applications, files, bookmarks, YouTube, Twitter and more. Flow will continue to evolve, designed to be open and built with the community at heart.
Remember to star it, flow will love you more :)
-## 🎅 New Features🤶
-
-### Preview Panel
-
-
-
-- Use the F1 key to open/hide the preview panel.
-- Media files will be displayed as large images, otherwise a large icon and entire path will be displayed.
-- Turn on preview permanently via Settings (Always Preview).
-- Use hotkeys (Ctrl+Plus,Minus / Ctrl+],[) to adjust flow's search window width and height quickly if the preview area is too narrow.
-- This feature is currently in its early stages.
-
-### Everything Plugin Merged Into Explorer
-
-
-
-- Switch easily between Everything and Windows Search to take advantage of both search engines (remember to remove existing Everything plugin).
-- Use features available to both Everything and Explorer plugins
-
-### Date & Time Display In Search Window
-
-
-
-- Display the date and time when the search window is triggered.
-
-### Drag & Drop
-
-
-
-- Drag an item to Discord or computer location.
-- The target program determines whether the drop is to copy or move the item (can change via CTRL or Alt), and the operation is displayed on the mouse cursor.
-
-### Custom Shortcut
-
-
-
-
-- New shortcut functionality to set additional action keywords or search terms.
-
-### Improved Program Plugin
-
-- PATH is now indexed
-- Support for .url files, flow can now search installed steam/epic games.
-- Improved UWP indexing.
-
-### Improved Memory Usage
-
-- Fixed a memory leak and reduced overall memory usage.
-
-### Improved Plugin / Plugin Store
-
-- Search plugins in the Plugin Store and existing plugin tab.
-- Categorised sections in Plugin Store to easily see new and updated plugins.
-
-### Improved Non-C# Plugin's Panel Design
-
-
-
-- The design has been adjusted to align to the overall look and feel of flow.
-- Simplified the information displayed on buttons
-
-🚂[Full Changelogs](https://github.com/Flow-Launcher/Flow.Launcher/releases)
-
-
-
Getting Started •
Features •
@@ -104,15 +42,29 @@ Dedicated to making your work flow more seamless. Search everything from applica
### Installation
-| [Windows 7+ installer](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe) | [Portable](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Portable.zip) |
-| :----------------------------------------------------------: | :----------------------------------------------------------: |
+[Windows 7+ Installer](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe) or [Portable Version](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Portable.zip)
-| `winget install "Flow Launcher"` | `scoop install Flow-Launcher` | `choco install Flow-Launcher` |
-| :------------------------------: | :------------------------------: | :------------------------------: |
+#### Winget
+
+```
+winget install "Flow Launcher"
+```
+
+#### Scoop
+
+```
+scoop install Flow-Launcher
+```
+
+#### Chocolatey
+
+```
+choco install Flow-Launcher
+```
> When installing for the first time Windows may raise an issue about security due to code not being signed, if you downloaded from this repo then you are good to continue the set up.
-And you can download [early access version](https://github.com/Flow-Launcher/Prereleases/releases).
+Or download the [early access version](https://github.com/Flow-Launcher/Prereleases/releases).
@@ -123,6 +75,7 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- Search for apps, files or file contents.
+- Supports Everything and Windows Index.
@@ -156,7 +109,7 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- Run batch and PowerShell commands as Administrator or a different user.
-- Ctrl+Enter to Run as Administrator.
+- Ctrl+Shift+Enter to Run as Administrator.
### Explorer
@@ -164,6 +117,13 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- Save file or folder locations for quick access.
+#### Drag & Drop
+
+
+
+- Drag a file/folder to File Exlporer, or even Discord.
+- Copy/move behavior can be change via Ctrl or Shift, and the operation is displayed on the mouse cursor.
+
### Windows & Control Panel Settings
@@ -176,6 +136,16 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- Prioritise the order of each plugin's results.
+### Preview Panel
+
+
+
+- Use F1 to toggle the preview panel.
+- Media files will be displayed as large images, otherwise a large icon and full path will be displayed.
+- Turn on preview permanently via Settings (Always Preview).
+- Use Ctrl++/- and Ctrl+[/] to adjust search window width and height quickly if the preview area is too narrow.
+
+
### Customizations
@@ -187,12 +157,48 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- There are various themes and you also can make your own.
-### 💬 Language
+#### Date & Time Display In Search Window
+
+
+
+- Display date and time in search window.
+
+### 💬 Languages
- Supports languages from Chinese to Italian and more.
-- Supports Pinyin search.
+- Supports Pinyin (拼音) search.
- [Crowdin](https://crowdin.com/project/flow-launcher) support for language translations.
+
+Supported languages
+
+ - English
+ - 中文
+ - 中文(繁体)
+ - Українська
+ - Русский
+ - Français
+ - 日本語
+ - Dutch
+ - Polski
+ - Dansk
+ - de, Deutsch
+ - ko, 한국어
+ - Srpski
+ - Português
+ - Português (Brasil)
+ - Spanish
+ - es-419, Spanish (Latin America)
+ - Italiano
+ - Norsk Bokmål
+ - Slovenčina
+ - Türkçe
+ - čeština
+ - اللغة العربية
+ - Tiếng Việt
+
+
+
### Portable
- Fully portable.
@@ -206,7 +212,7 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
- Pause hotkey activation when you are playing games.
-- When in search window use Ctrl+F12 to toggle on/off.
+- When in search window use Ctrl+F12 to toggle on/off.
- Type `Toggle Game Mode`
@@ -257,6 +263,7 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
### 🛒 Plugin Store
+
- You can view the full plugin list or quickly install a plugin via the Plugin Store menu inside Settings
@@ -267,26 +274,29 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
## ⌨️ Hotkeys
-| Hotkey | Description |
-| ------------------------------------------------------------------ | ---------------------------------------------- |
-| Alt+ Space | Open search window (default and configurable) |
-| Enter | Execute |
-| Ctrl+Shift+Enter | Run as admin |
-| ↑↓ | Scroll up & down |
-| ←→ | Back to result / Open Context Menu |
-| Ctrl +O , Shift +Enter | Open Context Menu |
-| Tab | Autocomplete |
-| F1 | Toggle Preview Panel (default and configurable)|
-| Esc | Back to results / hide search window |
-| Ctrl +C | Copy the actual folder / file |
-| Ctrl +I | Open flow's settings |
-| Ctrl +R | Run the current query again (refresh results) |
-| F5 | Reload all plugin data |
-| Ctrl + F12 | Toggle Game Mode when in search window |
-| Ctrl + +,- | Quickly change maximum results shown |
-| Ctrl + [,] | Quickly change search window width |
-| Ctrl + H | Open search history |
-| Ctrl + Backspace | Back to previous directory |
+| Hotkey | Description |
+| ------------------------------------------------------------------------- | ----------------------------------------------- |
+| Alt+Space | Open search window (default and configurable) |
+| Enter | Execute |
+| Ctrl+Enter | Open containing folder |
+| Ctrl+Shift+Enter | Run as admin |
+| ↑/↓, Shift+Tab/Tab | Previous / Next result |
+| ←/→ | Back to result / Open Context Menu |
+| Ctrl+O , Shift+Enter | Open Context Menu |
+| Ctrl+Tab | Autocomplete |
+| F1 | Toggle Preview Panel (default and configurable) |
+| Esc | Back to results / hide search window |
+| Ctrl+C | Copy folder / file |
+| Ctrl+Shift+C | Copy folder / file path |
+| Ctrl+I | Open Flow's settings |
+| Ctrl+R | Run the current query again (refresh results) |
+| F5 | Reload all plugin data |
+| Ctrl+F12 | Toggle Game Mode when in search window |
+| Ctrl++,- | Adjust maximum results shown |
+| Ctrl+[,] | Adjust search window width |
+| Ctrl+H | Open search history |
+| Ctrl+Backspace | Back to previous directory |
+| PageUp/PageDown | Previous / Next Page |
## System Command List
@@ -313,8 +323,6 @@ And you can download [early access version](https://github.com/Flow-Launcher/Pre
| Flow Launcher UserData Folder | Open the location where Flow Launcher's settings are stored |
| Toggle Game Mode | Toggle Game Mode |
-
-
### 💁♂️ Tips
- [More tips](https://flowlauncher.com/docs/#/usage-tips)