├── Ollama-Spotlight
├── Ollama-Spotlight (Package)
│ ├── Images
│ │ ├── StoreLogo.backup.png
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-125.png
│ │ ├── LargeTile.scale-150.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── LargeTile.scale-400.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-125.png
│ │ ├── SmallTile.scale-150.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SmallTile.scale-400.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-125.png
│ │ ├── StoreLogo.scale-150.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── StoreLogo.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-125.png
│ │ ├── Square44x44Logo.scale-150.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-125.png
│ │ ├── Wide310x150Logo.scale-150.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-125.png
│ │ ├── Square150x150Logo.scale-150.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16.png
│ │ ├── Square44x44Logo.targetsize-24.png
│ │ ├── Square44x44Logo.targetsize-256.png
│ │ ├── Square44x44Logo.targetsize-32.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-lightunplated_targetsize-24.png
│ │ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png
│ │ ├── Square44x44Logo.altform-lightunplated_targetsize-32.png
│ │ └── Square44x44Logo.altform-lightunplated_targetsize-48.png
│ ├── Package.appxmanifest
│ └── Ollama-Spotlight (Package).wapproj
└── Ollama-Spotlight
│ ├── NativeMethods.txt
│ ├── App.xaml
│ ├── app.manifest
│ ├── Ollama-Spotlight.csproj
│ ├── App.xaml.cs
│ ├── Utilities
│ ├── Easing.cs
│ └── Monitor.cs
│ ├── MainWindow.xaml
│ └── MainWindow.xaml.cs
├── README.md
├── .gitattributes
├── Ollama-Spotlight.sln
└── .gitignore
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.backup.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/NativeMethods.txt:
--------------------------------------------------------------------------------
1 | RegisterHotKey
2 | SetWindowLong
3 | SetWindowLongPtr
4 | CallWindowProc
5 | ShowWindow
6 | SetForegroundWindow
7 | SetFocus
8 | SetActiveWindow
9 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LargeTile.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SmallTile.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-24.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-32.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/not-nullptr/Spotllama/HEAD/Ollama-Spotlight/Ollama-Spotlight (Package)/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Spotllama
2 |
3 | /Images/Square44x44Logo.targetsize-256.png)
4 |
5 | A native, macOS ChatGPT-like Spotlight interface for Ollama.
6 |
7 | ## Info
8 | The default bind to open the UI is Ctrl + Alt + Shift + Win + Page Down. **This is meant to be remapped using Powertoys, so you can override system shortcuts like Win + Space or Ctrl + Space.**
9 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | PerMonitorV2
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/Ollama-Spotlight.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net6.0-windows10.0.19041.0
5 | 10.0.17763.0
6 | Ollama_Spotlight
7 | app.manifest
8 | x86;x64;ARM64
9 | win10-x86;win10-x64;win10-arm64
10 | true
11 |
12 |
13 |
14 |
15 |
16 | all
17 | runtime; build; native; contentfiles; analyzers; buildtransitive
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Microsoft.UI.Xaml.Controls;
3 | using Microsoft.UI.Xaml.Controls.Primitives;
4 | using Microsoft.UI.Xaml.Data;
5 | using Microsoft.UI.Xaml.Input;
6 | using Microsoft.UI.Xaml.Media;
7 | using Microsoft.UI.Xaml.Navigation;
8 | using Microsoft.UI.Xaml.Shapes;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.IO;
12 | using System.Linq;
13 | using System.Runtime.InteropServices.WindowsRuntime;
14 | using Windows.ApplicationModel;
15 | using Windows.ApplicationModel.Activation;
16 | using Windows.Foundation;
17 | using Windows.Foundation.Collections;
18 |
19 | // To learn more about WinUI, the WinUI project structure,
20 | // and more about our project templates, see: http://aka.ms/winui-project-info.
21 |
22 | namespace Ollama_Spotlight
23 | {
24 | ///
25 | /// Provides application-specific behavior to supplement the default Application class.
26 | ///
27 | public partial class App : Application
28 | {
29 | ///
30 | /// Initializes the singleton application object. This is the first line of authored code
31 | /// executed, and as such is the logical equivalent of main() or WinMain().
32 | ///
33 | public App()
34 | {
35 | this.InitializeComponent();
36 | }
37 |
38 | ///
39 | /// Invoked when the application is launched.
40 | ///
41 | /// Details about the launch request and process.
42 | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
43 | {
44 | m_window = new MainWindow();
45 | }
46 |
47 | private Window m_window;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
14 |
15 |
16 |
17 |
18 | Spotllama
19 | nullptr
20 | Images\StoreLogo.png
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
36 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/Utilities/Easing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | // ironically, llama3:8b wrote this code
8 |
9 | namespace Ollama_Spotlight.Utilities
10 | {
11 | public class BezierCurve
12 | {
13 | public double X { get; set; }
14 | public double Y { get; set; }
15 |
16 | public BezierCurve(double x, double y)
17 | {
18 | X = x;
19 | Y = y;
20 | }
21 | }
22 |
23 | public class Easing
24 | {
25 | public BezierCurve Bezier1 { get; set; }
26 | public BezierCurve Bezier2 { get; set; }
27 |
28 | public Easing(BezierCurve bezier1, BezierCurve bezier2)
29 | {
30 | Bezier1 = bezier1 ?? throw new ArgumentNullException(nameof(bezier1));
31 | Bezier2 = bezier2 ?? throw new ArgumentNullException(nameof(bezier2));
32 | }
33 | }
34 |
35 | public static class EasingFunctions
36 | {
37 | public static double Ease(double t, Easing easing)
38 | {
39 | if (t < 0 || t > 1)
40 | throw new ArgumentOutOfRangeException(nameof(t), "t must be between 0 and 1.");
41 |
42 | // Cubic Bezier formula: B(t) = (1 - t)^3 * P0 + 3 * (1 - t)^2 * t * P1 + 3 * (1 - t) * t^2 * P2 + t^3 * P3
43 | double CalculateBezier(double t, double p0, double p1, double p2, double p3)
44 | {
45 | double u = 1 - t;
46 | double tt = t * t;
47 | double uu = u * u;
48 | double uuu = uu * u;
49 | double ttt = tt * t;
50 |
51 | return (uuu * p0) + (3 * uu * t * p1) + (3 * u * tt * p2) + (ttt * p3);
52 | }
53 |
54 | // P0 and P3 are always (0, 0) and (1, 1)
55 | double x = CalculateBezier(t, 0, easing.Bezier1.X, easing.Bezier2.X, 1);
56 | double y = CalculateBezier(t, 0, easing.Bezier1.Y, easing.Bezier2.Y, 1);
57 |
58 | return y;
59 | }
60 |
61 | public static double EaseBetween(double startValue, double endValue, double t, Easing easing)
62 | {
63 | double easedT = Ease(t, easing);
64 | return startValue + (endValue - startValue) * easedT;
65 | }
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Ollama-Spotlight.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.9.34728.123
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Ollama-Spotlight (Package)", "Ollama-Spotlight\Ollama-Spotlight (Package)\Ollama-Spotlight (Package).wapproj", "{DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ollama-Spotlight", "Ollama-Spotlight\Ollama-Spotlight\Ollama-Spotlight.csproj", "{1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|ARM64 = Debug|ARM64
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|ARM64 = Release|ARM64
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|ARM64.ActiveCfg = Debug|ARM64
21 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|ARM64.Build.0 = Debug|ARM64
22 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|ARM64.Deploy.0 = Debug|ARM64
23 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x64.ActiveCfg = Debug|x64
24 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x64.Build.0 = Debug|x64
25 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x64.Deploy.0 = Debug|x64
26 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x86.ActiveCfg = Debug|x86
27 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x86.Build.0 = Debug|x86
28 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Debug|x86.Deploy.0 = Debug|x86
29 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|ARM64.ActiveCfg = Release|ARM64
30 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|ARM64.Build.0 = Release|ARM64
31 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|ARM64.Deploy.0 = Release|ARM64
32 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x64.ActiveCfg = Release|x64
33 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x64.Build.0 = Release|x64
34 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x64.Deploy.0 = Release|x64
35 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x86.ActiveCfg = Release|x86
36 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x86.Build.0 = Release|x86
37 | {DA3C7FDB-1E42-40BA-BC86-F24D2FA4D881}.Release|x86.Deploy.0 = Release|x86
38 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|ARM64.ActiveCfg = Debug|ARM64
39 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|ARM64.Build.0 = Debug|ARM64
40 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|x64.ActiveCfg = Debug|x64
41 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|x64.Build.0 = Debug|x64
42 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|x86.ActiveCfg = Debug|x86
43 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Debug|x86.Build.0 = Debug|x86
44 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|ARM64.ActiveCfg = Release|ARM64
45 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|ARM64.Build.0 = Release|ARM64
46 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|x64.ActiveCfg = Release|x64
47 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|x64.Build.0 = Release|x64
48 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|x86.ActiveCfg = Release|x86
49 | {1A3FE0A6-8181-4E91-A6D6-1B5BA435D5BC}.Release|x86.Build.0 = Release|x86
50 | EndGlobalSection
51 | GlobalSection(SolutionProperties) = preSolution
52 | HideSolutionNode = FALSE
53 | EndGlobalSection
54 | GlobalSection(ExtensibilityGlobals) = postSolution
55 | SolutionGuid = {55786CCA-97D7-40D9-9880-EA227C63E0CE}
56 | EndGlobalSection
57 | EndGlobal
58 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/Utilities/Monitor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using Windows.Graphics;
9 |
10 | namespace Ollama_Spotlight.Utilities
11 | {
12 | public sealed class Monitor
13 | {
14 | private Monitor(IntPtr handle)
15 | {
16 | Handle = handle;
17 | var mi = new MONITORINFOEX();
18 | mi.cbSize = Marshal.SizeOf(mi);
19 | if (!GetMonitorInfo(handle, ref mi))
20 | throw new Win32Exception(Marshal.GetLastWin32Error());
21 |
22 | DeviceName = mi.szDevice.ToString();
23 | Bounds = new RectInt32(mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right - mi.rcMonitor.left, mi.rcMonitor.bottom - mi.rcMonitor.top);
24 | WorkingArea = new RectInt32(mi.rcWork.left, mi.rcWork.top, mi.rcWork.right - mi.rcWork.left, mi.rcWork.bottom - mi.rcWork.top);
25 | IsPrimary = mi.dwFlags.HasFlag(MONITORINFOF.MONITORINFOF_PRIMARY);
26 | }
27 |
28 | public IntPtr Handle { get; }
29 | public bool IsPrimary { get; }
30 | public RectInt32 WorkingArea { get; }
31 | public RectInt32 Bounds { get; }
32 | public string DeviceName { get; }
33 |
34 | public static IEnumerable All
35 | {
36 | get
37 | {
38 | var all = new List();
39 | EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, (m, h, rc, p) =>
40 | {
41 | all.Add(new Monitor(m));
42 | return true;
43 | }, IntPtr.Zero);
44 | return all;
45 | }
46 | }
47 |
48 | public override string ToString() => DeviceName;
49 | public static IntPtr GetNearestFromWindow(IntPtr hwnd) => MonitorFromWindow(hwnd, MFW.MONITOR_DEFAULTTONEAREST);
50 | public static IntPtr GetDesktopMonitorHandle() => GetNearestFromWindow(GetDesktopWindow());
51 | public static IntPtr GetShellMonitorHandle() => GetNearestFromWindow(GetShellWindow());
52 | public static Monitor FromWindow(IntPtr hwnd, MFW flags = MFW.MONITOR_DEFAULTTONULL)
53 | {
54 | var h = MonitorFromWindow(hwnd, flags);
55 | return h != IntPtr.Zero ? new Monitor(h) : null;
56 | }
57 |
58 | [Flags]
59 | public enum MFW
60 | {
61 | MONITOR_DEFAULTTONULL = 0x00000000,
62 | MONITOR_DEFAULTTOPRIMARY = 0x00000001,
63 | MONITOR_DEFAULTTONEAREST = 0x00000002,
64 | }
65 |
66 | [Flags]
67 | public enum MONITORINFOF
68 | {
69 | MONITORINFOF_NONE = 0x00000000,
70 | MONITORINFOF_PRIMARY = 0x00000001,
71 | }
72 |
73 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
74 | private struct MONITORINFOEX
75 | {
76 | public int cbSize;
77 | public RECT rcMonitor;
78 | public RECT rcWork;
79 | public MONITORINFOF dwFlags;
80 |
81 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
82 | public string szDevice;
83 | }
84 |
85 | [StructLayout(LayoutKind.Sequential)]
86 | private struct RECT
87 | {
88 | public int left;
89 | public int top;
90 | public int right;
91 | public int bottom;
92 | }
93 |
94 | private delegate bool MonitorEnumProc(IntPtr monitor, IntPtr hdc, IntPtr lprcMonitor, IntPtr lParam);
95 |
96 | [DllImport("user32")]
97 | private static extern IntPtr GetDesktopWindow();
98 |
99 | [DllImport("user32")]
100 | private static extern IntPtr GetShellWindow();
101 |
102 | [DllImport("user32")]
103 | private static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip, MonitorEnumProc lpfnEnum, IntPtr dwData);
104 |
105 | [DllImport("user32")]
106 | private static extern IntPtr MonitorFromWindow(IntPtr hwnd, MFW flags);
107 |
108 | [DllImport("user32", CharSet = CharSet.Unicode)]
109 | private static extern bool GetMonitorInfo(IntPtr hmonitor, ref MONITORINFOEX info);
110 | }
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight (Package)/Ollama-Spotlight (Package).wapproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 |
6 |
7 |
8 | Debug
9 | x86
10 |
11 |
12 | Release
13 | x86
14 |
15 |
16 | Debug
17 | x64
18 |
19 |
20 | Release
21 | x64
22 |
23 |
24 | Debug
25 | ARM64
26 |
27 |
28 | Release
29 | ARM64
30 |
31 |
32 |
33 | $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
34 | Ollama-Spotlight\
35 |
36 |
37 |
38 | da3c7fdb-1e42-40ba-bc86-f24d2fa4d881
39 | 10.0.22621.0
40 | 10.0.17763.0
41 | net6.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)
42 | en-US
43 | True
44 | ..\Ollama-Spotlight\Ollama-Spotlight.csproj
45 | False
46 | CA8A980C35E35D34880788FEFE8D154219679B54
47 | SHA256
48 | True
49 | False
50 | True
51 | x64
52 | 0
53 |
54 |
55 | Always
56 |
57 |
58 | Always
59 |
60 |
61 | Always
62 |
63 |
64 | Always
65 |
66 |
67 | Always
68 |
69 |
70 | Always
71 |
72 |
73 |
74 | Designer
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 | True
133 | Properties\PublishProfiles\win10-$(Platform).pubxml
134 |
135 |
136 |
137 |
138 | build
139 |
140 |
141 | build
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/Ollama-Spotlight/Ollama-Spotlight/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Windows.Win32;
3 | using Windows.Win32.UI.WindowsAndMessaging;
4 | using Windows.Win32.Foundation;
5 | using WinRT.Interop;
6 | using System;
7 | using System.Runtime.InteropServices;
8 | using Windows.Win32.UI.Input.KeyboardAndMouse;
9 | using Microsoft.UI.Windowing;
10 | using Microsoft.UI;
11 | using Windows.Foundation;
12 | using Ollama_Spotlight.Utilities;
13 | using System.Linq;
14 | using Windows.Graphics;
15 | using Microsoft.UI.Xaml.Input;
16 | using OllamaSharp;
17 | using System.Diagnostics;
18 | using OllamaSharp.Models;
19 | using OllamaSharp.Streamer;
20 | using System.Threading.Tasks;
21 | using Microsoft.UI.Dispatching;
22 | using Microsoft.UI.Xaml.Controls;
23 | using System.Net.Http;
24 | using System.Text.Json;
25 |
26 | // To learn more about WinUI, the WinUI project structure,
27 | // and more about our project templates, see: http://aka.ms/winui-project-info.
28 |
29 | namespace Ollama_Spotlight {
30 | public sealed partial class MainWindow : Window
31 | {
32 | private readonly Easing easing = new(
33 | new BezierCurve(0.25, 0.8),
34 | new BezierCurve(0.45, 0.9)
35 | );
36 | private const uint SPACE_KEY = 0x22;
37 | private const uint WM_HOTKEY = 0x0312;
38 | private readonly WNDPROC origPrc;
39 | private readonly WNDPROC hotKeyPrc;
40 | private AppWindow _apw;
41 | private OverlappedPresenter _presenter;
42 | private Monitor lastMonitor = null;
43 | public Microsoft.UI.Dispatching.DispatcherQueue dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
44 | [DllImport("user32.dll")]
45 | [return: MarshalAs(UnmanagedType.Bool)]
46 | internal static extern bool GetCursorPos(ref Win32Point pt);
47 |
48 | [StructLayout(LayoutKind.Sequential)]
49 | internal struct Win32Point
50 | {
51 | public Int32 X;
52 | public Int32 Y;
53 | };
54 | public static Point GetMousePosition()
55 | {
56 | Win32Point w32Mouse = new Win32Point();
57 | GetCursorPos(ref w32Mouse);
58 | return new Point(w32Mouse.X, w32Mouse.Y);
59 | }
60 | public static Monitor GetMouseMonitor()
61 | {
62 | Monitor[] monitors = Monitor.All.ToArray();
63 | Point point = GetMousePosition();
64 | Monitor monitor = monitors.Where(m =>
65 | point.X >= m.WorkingArea.X &&
66 | point.X <= m.WorkingArea.X + m.WorkingArea.Width &&
67 | point.Y >= m.WorkingArea.Y &&
68 | point.Y <= m.WorkingArea.Y + m.WorkingArea.Height)
69 | .FirstOrDefault();
70 | return monitor;
71 | }
72 | private LRESULT HotKeyPrc(HWND hwnd,
73 | uint uMsg,
74 | WPARAM wParam,
75 | LPARAM lParam)
76 | {
77 | if (uMsg == WM_HOTKEY)
78 | {
79 | Monitor monitor = GetMouseMonitor();
80 | int width = monitor.WorkingArea.Width / 2;
81 | int height = 100;
82 | int centeredX = monitor.WorkingArea.X + (monitor.WorkingArea.Width - width) / 2;
83 | int centeredY = monitor.WorkingArea.Y + (monitor.WorkingArea.Height - height) / 2;
84 |
85 | if (!Visible)
86 | {
87 | AppWindow.Move(
88 | new PointInt32(centeredX, centeredY)
89 | );
90 | AppWindow.Resize(new SizeInt32(width, height));
91 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_SHOW);
92 | PInvoke.SetForegroundWindow(hwnd);
93 | PInvoke.SetFocus(hwnd);
94 | PInvoke.SetActiveWindow(hwnd);
95 | LlamaInput.Visibility = Visibility.Visible;
96 | LlamaInput.Focus(FocusState.Programmatic);
97 | Response.Visibility = Visibility.Collapsed;
98 | System.Threading.Thread thread = new(new System.Threading.ThreadStart(async () =>
99 | {
100 | var client = new HttpClient();
101 | await client.PostAsync("http://127.0.0.1:11434/api/generate", new StringContent(
102 | JsonSerializer.Serialize(new
103 | {
104 | model = "llama3:8b"
105 | }
106 | )));
107 | }));
108 | thread.Start();
109 | }
110 | else
111 | {
112 | if (lastMonitor is not null)
113 | {
114 | if (lastMonitor.Bounds.X != monitor.Bounds.X ||
115 | lastMonitor.Bounds.Y != monitor.Bounds.Y ||
116 | lastMonitor.Bounds.Width != monitor.Bounds.Width ||
117 | lastMonitor.Bounds.Height != monitor.Bounds.Height)
118 | {
119 | AppWindow.Move(
120 | new PointInt32(centeredX, centeredY)
121 | );
122 | AppWindow.Resize(new SizeInt32(width, height));
123 |
124 | }
125 | else
126 | {
127 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_HIDE);
128 | LlamaInput.Text = "";
129 | }
130 | }
131 | else
132 | {
133 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_HIDE);
134 | LlamaInput.Text = "";
135 | }
136 |
137 | }
138 | lastMonitor = monitor;
139 | return (LRESULT)IntPtr.Zero;
140 | }
141 |
142 | return PInvoke.CallWindowProc(origPrc, hwnd, uMsg, wParam, lParam);
143 | }
144 |
145 | public MainWindow()
146 | {
147 | InitializeComponent();
148 | HWND hwnd = new HWND(WindowNative.GetWindowHandle(this));
149 | PInvoke.RegisterHotKey(hwnd, 0, HOT_KEY_MODIFIERS.MOD_WIN | HOT_KEY_MODIFIERS.MOD_CONTROL | HOT_KEY_MODIFIERS.MOD_ALT | HOT_KEY_MODIFIERS.MOD_SHIFT, SPACE_KEY);
150 |
151 | hotKeyPrc = HotKeyPrc;
152 | var hotKeyPrcPointer = Marshal.GetFunctionPointerForDelegate(hotKeyPrc);
153 | origPrc = Marshal.GetDelegateForFunctionPointer((IntPtr)PInvoke.SetWindowLongPtr(hwnd, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, hotKeyPrcPointer));
154 | ExtendsContentIntoTitleBar = true;
155 | GetAppWindowAndPresenter();
156 | _apw.IsShownInSwitchers = false;
157 | _presenter.SetBorderAndTitleBar(false, false);
158 | _presenter.IsResizable = false;
159 |
160 | }
161 |
162 | private void Current_Activated(object sender, WindowActivatedEventArgs args)
163 | {
164 | HWND hwnd = new HWND(WindowNative.GetWindowHandle(this));
165 | if (args.WindowActivationState == WindowActivationState.Deactivated)
166 | {
167 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_HIDE);
168 | LlamaInput.Text = "";
169 | }
170 | }
171 |
172 | public void GetAppWindowAndPresenter()
173 | {
174 | var hWnd = WindowNative.GetWindowHandle(this);
175 | WindowId myWndId = Win32Interop.GetWindowIdFromWindow(hWnd);
176 | _apw = AppWindow.GetFromWindowId(myWndId);
177 | _presenter = _apw.Presenter as OverlappedPresenter;
178 | }
179 |
180 | private void LlamaInput_KeyDown(object sender, KeyRoutedEventArgs e)
181 | {
182 | HWND hwnd = new HWND(WindowNative.GetWindowHandle(this));
183 | if (e.Key == Windows.System.VirtualKey.Escape)
184 | {
185 | e.Handled = true;
186 | LlamaInput.Text = "";
187 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_HIDE);
188 | }
189 | else if (e.Key == Windows.System.VirtualKey.Enter)
190 | {
191 | ResponseBlock.Text = "";
192 | e.Handled = true;
193 | Uri uri = new("http://localhost:11434");
194 | OllamaApiClient ollama = new(uri);
195 | ollama.SelectedModel = "llama3:8b";
196 | string text = LlamaInput.Text;
197 | LlamaInput.Text = "";
198 | Monitor monitor = GetMouseMonitor();
199 | float width = monitor.WorkingArea.Width / 1.25f;
200 | int height = monitor.WorkingArea.Height / 2;
201 | float centeredX = monitor.WorkingArea.X + (monitor.WorkingArea.Width - width) / 2;
202 | int centeredY = monitor.WorkingArea.Y + (monitor.WorkingArea.Height - height) / 2;
203 | AppWindow.MoveAndResize(new RectInt32
204 | {
205 | Width = (int)width,
206 | Height = height,
207 | X = (int)centeredX,
208 | Y = centeredY,
209 | });
210 | LlamaInput.Visibility = Visibility.Collapsed;
211 | Response.Visibility = Visibility.Visible;
212 | System.Threading.Tasks.Task.Run(async () =>
213 | {
214 | await ollama.StreamCompletion(text, null, stream =>
215 | {
216 | dispatcherQueue.TryEnqueue(() =>
217 | {
218 | ResponseBlock.Text += stream.Response;
219 | Scroller.UpdateLayout();
220 | Scroller.ScrollTo(0, Scroller.ScrollableHeight);
221 | });
222 | });
223 | await ollama.StreamCompletion(new GenerateCompletionRequest()
224 | {
225 | System = "You are LLaMA, a helpful AI assistant. The user is unable to provide any follow-up questions, chats or anything else. Your message will end the conversation.",
226 | Prompt = text
227 | }, new ResponseStreamer(dispatcherQueue, ResponseBlock, Scroller));
228 | });
229 | }
230 | }
231 |
232 | private void Container_KeyDown(object sender, KeyRoutedEventArgs e)
233 | {
234 | if (e.Key == Windows.System.VirtualKey.Escape)
235 | {
236 | HWND hwnd = new HWND(WindowNative.GetWindowHandle(this));
237 | PInvoke.ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_HIDE);
238 | LlamaInput.Text = "";
239 | }
240 | }
241 |
242 | public class ResponseStreamer : IResponseStreamer
243 | {
244 | private DispatcherQueue DispatcherQueue;
245 | private CommunityToolkit.WinUI.UI.Controls.MarkdownTextBlock ResponseBlock;
246 | private ScrollView Scroller;
247 | public ResponseStreamer(DispatcherQueue dispatcher, CommunityToolkit.WinUI.UI.Controls.MarkdownTextBlock responseBlock, ScrollView scrollView)
248 | {
249 | DispatcherQueue = dispatcher;
250 | ResponseBlock = responseBlock;
251 | Scroller = scrollView;
252 | }
253 | void IResponseStreamer.Stream(GenerateCompletionResponseStream stream)
254 | {
255 | DispatcherQueue.TryEnqueue(() =>
256 | {
257 | ResponseBlock.Text += stream.Response;
258 | Scroller.UpdateLayout();
259 | Scroller.ScrollTo(0, Scroller.ScrollableHeight);
260 | });
261 | }
262 | }
263 | }
264 |
265 | }
266 |
--------------------------------------------------------------------------------