forked from Shinonome/dots-hyprland
make google lens tool use normal region selection by default
This commit is contained in:
@@ -60,7 +60,7 @@ bindd = Super, V, Copy clipboard history entry, exec, qs -c $qsConfig ipc call T
|
|||||||
bindd = Super, Period, Copy an emoji, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill fuzzel || ~/.config/hypr/hyprland/scripts/fuzzel-emoji.sh copy # [hidden] Emoji >> clipboard (fallback)
|
bindd = Super, Period, Copy an emoji, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill fuzzel || ~/.config/hypr/hyprland/scripts/fuzzel-emoji.sh copy # [hidden] Emoji >> clipboard (fallback)
|
||||||
bind = Super+Shift, S, global, quickshell:regionScreenshot # Screen snip
|
bind = Super+Shift, S, global, quickshell:regionScreenshot # Screen snip
|
||||||
bind = Super+Shift, S, exec, qs -c $qsConfig ipc call TEST_ALIVE || pidof slurp || hyprshot --freeze --clipboard-only --mode region --silent # [hidden] Screen snip (fallback)
|
bind = Super+Shift, S, exec, qs -c $qsConfig ipc call TEST_ALIVE || pidof slurp || hyprshot --freeze --clipboard-only --mode region --silent # [hidden] Screen snip (fallback)
|
||||||
bind = Super+Shift, A, global, quickshell:regionSearch # Circle to Search
|
bind = Super+Shift, A, global, quickshell:regionSearch # Google Lens
|
||||||
# OCR
|
# OCR
|
||||||
bindd = Super+Shift, T, Character recognition,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract "tmp.png" - | wl-copy && rm "tmp.png" # [hidden]
|
bindd = Super+Shift, T, Character recognition,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract "tmp.png" - | wl-copy && rm "tmp.png" # [hidden]
|
||||||
# Color picker
|
# Color picker
|
||||||
|
|||||||
@@ -355,8 +355,6 @@ Singleton {
|
|||||||
property JsonObject search: JsonObject {
|
property JsonObject search: JsonObject {
|
||||||
property int nonAppResultDelay: 30 // This prevents lagging when typing
|
property int nonAppResultDelay: 30 // This prevents lagging when typing
|
||||||
property string engineBaseUrl: "https://www.google.com/search?q="
|
property string engineBaseUrl: "https://www.google.com/search?q="
|
||||||
property string imageSearchEngineBaseUrl: "https://lens.google.com/uploadbyurl?url="
|
|
||||||
property string fileUploadApiEndpoint: "https://uguu.se/upload"
|
|
||||||
property list<string> excludedSites: ["quora.com", "facebook.com"]
|
property list<string> excludedSites: ["quora.com", "facebook.com"]
|
||||||
property bool sloppy: false // Uses levenshtein distance based scoring instead of fuzzy sort. Very weird.
|
property bool sloppy: false // Uses levenshtein distance based scoring instead of fuzzy sort. Very weird.
|
||||||
property JsonObject prefix: JsonObject {
|
property JsonObject prefix: JsonObject {
|
||||||
@@ -369,6 +367,11 @@ Singleton {
|
|||||||
property string shellCommand: "$"
|
property string shellCommand: "$"
|
||||||
property string webSearch: "?"
|
property string webSearch: "?"
|
||||||
}
|
}
|
||||||
|
property JsonObject imageSearch: JsonObject {
|
||||||
|
property string imageSearchEngineBaseUrl: "https://lens.google.com/uploadbyurl?url="
|
||||||
|
property string fileUploadApiEndpoint: "https://uguu.se/upload"
|
||||||
|
property bool useCircleSelection: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject sidebar: JsonObject {
|
property JsonObject sidebar: JsonObject {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ PanelWindow {
|
|||||||
signal dismiss()
|
signal dismiss()
|
||||||
|
|
||||||
property string screenshotDir: Directories.screenshotTemp
|
property string screenshotDir: Directories.screenshotTemp
|
||||||
property string imageSearchEngineBaseUrl: Config.options.search.imageSearchEngineBaseUrl
|
property string imageSearchEngineBaseUrl: Config.options.search.imageSearch.imageSearchEngineBaseUrl
|
||||||
property string fileUploadApiEndpoint: Config.options.search.fileUploadApiEndpoint
|
property string fileUploadApiEndpoint: Config.options.search.imageSearch.fileUploadApiEndpoint
|
||||||
property color overlayColor: "#77111111"
|
property color overlayColor: "#77111111"
|
||||||
property color genericContentColor: Qt.alpha(root.overlayColor, 0.9)
|
property color genericContentColor: Qt.alpha(root.overlayColor, 0.9)
|
||||||
property color genericContentForeground: "#ddffffff"
|
property color genericContentForeground: "#ddffffff"
|
||||||
@@ -424,13 +424,13 @@ PanelWindow {
|
|||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.larger
|
||||||
text: switch(root.selectionMode) {
|
text: switch(root.selectionMode) {
|
||||||
case RegionSelection.SelectionMode.RectCorners:
|
case RegionSelection.SelectionMode.RectCorners:
|
||||||
return "crop_free"
|
return "activity_zone"
|
||||||
break;
|
break;
|
||||||
case RegionSelection.SelectionMode.Circle:
|
case RegionSelection.SelectionMode.Circle:
|
||||||
return "gesture"
|
return "gesture"
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return "crop_free"
|
return "activity_zone"
|
||||||
}
|
}
|
||||||
color: root.genericContentForeground
|
color: root.genericContentForeground
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,11 @@ Scope {
|
|||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
root.action = RegionSelection.SnipAction.Search
|
root.action = RegionSelection.SnipAction.Search
|
||||||
root.selectionMode = RegionSelection.SelectionMode.Circle
|
if (Config.options.search.imageSearch.useCircleSelection) {
|
||||||
|
root.selectionMode = RegionSelection.SelectionMode.Circle
|
||||||
|
} else {
|
||||||
|
root.selectionMode = RegionSelection.SelectionMode.RectCorners
|
||||||
|
}
|
||||||
GlobalStates.regionSelectorOpen = true
|
GlobalStates.regionSelectorOpen = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,5 +147,19 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ContentSubsection {
|
||||||
|
title: Translation.tr("Google Lens")
|
||||||
|
|
||||||
|
ConfigSelectionArray {
|
||||||
|
currentValue: Config.options.search.imageSearch.useCircleSelection ? "circle" : "rectangles"
|
||||||
|
onSelected: newValue => {
|
||||||
|
Config.options.search.imageSearch.useCircleSelection = (newValue === "circle");
|
||||||
|
}
|
||||||
|
options: [
|
||||||
|
{ icon: "activity_zone", value: "rectangles", displayName: Translation.tr("Rectangular selection") },
|
||||||
|
{ icon: "gesture", value: "circle", displayName: Translation.tr("Circle to Search") }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user