Code Monkey home page Code Monkey logo

lanceur's Introduction

This repository is not maintained anymore because I've started a rewrite of this tool at this address: https://github.com/jibedoubleve/lanceur-bis

Table of content

Lanceur

This is a free adaptation of Slickrun written in .NET and with features inspired by Wox

What does it do?

Make a list of shortcuts, configure them and earn a lot of time by just typing the shortcut and press ENTER

How does it work?

To display the window, by default, the shortcut is ctrl + alt + space

ctrl + alt has the same behaviour as AltGr

img

When you've used the shortcut, a window appears.

  • In the searchbox (point 1), enter the keyword you want to execute
  • You'll see as you type the results that correspond to what you're typing (point 2)
  • You can type ENTER to execute the first element of the list
  • OR you can click on the element you want to execute

What is a command line?

command [space] parameters

For instance, I've configured a google search as follow ? my_search. In other words, if I want to search 'aeroplane' in google, I write ? aeroplane.

Here's how the command is configured

keyword file name
? https://www.google.com/search?hl=en&q=\$W\$

the use of $W$\ is defined HERE

This command line is divided as follow:

item value
? Command
aeroplane Parameters

Create a new keyword

There are two ways to create a new shortcut

Going to the configuration window

  1. Type setup
  2. Go to the tab keywords

With the keyword add

Type Add <the_keyword_you_want>, a window appear:

Create shortcuts (UI)

img

  1. Type the name of the shortcut you want to configure.

    You can set as many keywords as you want

  2. Set the path of the shortcut.

    The path can be:

    • the path of an executable
    • a path to a directory
    • an URL
  3. As a convenience you can use the cross to infer the executable.

    Drag and drop the cross on a window and Lanceur will infer the path of the executable

  4. Add the argument that will be used when launching the executable
  5. RunAs can be:
    • Admin: launch the application with administration privileges
    • CurrentUser: launch the application with the privilege of the current user
  6. StartMode can be:
    • Default: keep default configuration of the app
    • Maximized: start in fullscreen
    • Minimized: start minimised in the taskbar
  7. The working directory is the path that will be specified to the program as the working directory when starting it.
  8. Some notes user can add to the shortcut.

Predifined keywords

Some keyword are reserved and have some specific behaviour:

keyword explanation parameters
add Create a new keyword. The name of the keyword you want
centre Centre the window in the middle of the main screen N.A.
clear Clears the database. โ— Erase the database N.A.
guid Put a new guid into the clipboard N.A.
import Automatically import data from Slickrun N.A.
quit Quit the application N.A.
sessions List all the sessions N.A.
switch Switch to another session The name of the session
setup Opens the setup window N.A.
statistics Displays statistics on the usage N.A.
version Displays the version of Lanceur N.A.

Replacement macros

Any occurence of these macro in the File Name text box will be replace as follow.

macro explanation
$C$ will replace with the Clipboard in the format most web URLs expect
$R$ will replace with the Clipboard
$I$ will replace with typed parameters
$W$ will replace with typed parameters in the format most web URLs expect

Plugins

Read more here

Data Reconciliation

Read more here

Print screens

img

Architecture

Read more here

Acknowledgement

lanceur's People

Contributors

dependabot[bot] avatar jibedoubleve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yakimovim

lanceur's Issues

Better unhandled exception handling

Now unhandled exceptions are handled in a bare MessageBox. Improve the way application dispays errors and continue execution even on error.

Add mini calculator

Todo

  • Analyse the GUI
  • Do I include it as a plugin?
  • Analyse how it'll work internally

An error occured while trying to execute the alias 'corner'

Description

Cannot use the keyword corner

Logs

System.NullReferenceException: Object reference not set to an instance of an object.
   at Caliburn.Micro.EventAggregatorExtensions.PublishOnUIThread(IEventAggregator eventAggregator, Object message)
   at Probel.Lanceur.Services.ReservedKeywordService.ExecuteActionFor(String name, String arg) in D:\Projects\lanceur\src\Probel.Lanceur.Services\ReservedKeywordService.cs:line 47
   at Probel.Lanceur.ViewModels.MainViewModel.ExecuteText(String cmdLine) in D:\Projects\lanceur\src\Probel.Lanceur\ViewModels\MainViewModel.cs:line 99

Parameters not working

When parameters is string.Empty, and user set parameters to the alias, no parameters is taken into acount.

Focus issues.

Issue

Sometimes, for some reasons (to be analysed) when you make the shortcut to show the AliasBox, it does not give the focus to the TextBox and the application that has the focus when you execute the shortcut keeps the focus.

Investigation & explanation

TODO

Create statistic view of usage

Create a view with count by used alias.

SQL

create view stat_alias_count as
	select sn.name      as alias
	     , count(sn.id) as count
	from alias_usage su
	inner join alias s on su.id_alias = s.id
	inner join alias_name sn on s.id = sn.id_alias
	group by sn.name
	order by count desc;

Cannot update Alias

Log

2019-12-04 17:24:17.4087;FATAL;Default;1;Unexpected crash occured: Exception has been thrown by the target of an invocation.;"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SQLite.SQLiteException: SQL logic error
near ""working_dir"": syntax error
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader) in C:\projects\dapper\Dapper\SqlMapper.cs:line 2797
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 568
   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 441
   at Probel.Lanceur.SQLiteDb.Services.SQLiteDatabaseService.Update(Alias alias) in D:\Projects\lanceur\src\Probel.Lanceur.SQLiteDb\Services\SQLiteDatabaseService.cs:line 260
   at Probel.Lanceur.ViewModels.EditAliasViewModel.UpdateAlias() in D:\Projects\lanceur\src\Probel.Lanceur\ViewModels\EditAliasViewModel.cs:line 103
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Caliburn.Micro.ActionMessage.<>c.<.cctor>b__33_0(ActionExecutionContext context)
   at Caliburn.Micro.ActionMessage.Invoke(Object eventArgs)
   at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)"

Create new alias crashes

Error

When user creates new Alias, an error occurs

Logs

Unexpected crash occured: Exception has been thrown by the target of an invocation.;"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SQLite.SQLiteException: SQL logic error
table alias has no column named id_alias
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader) in C:\projects\dapper\Dapper\SqlMapper.cs:line 2797
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 568
   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 441
   at Probel.Lanceur.SQLiteDb.Services.SQLiteDatabaseService.Create(Alias s) in D:\Projects\lanceur\src\Probel.Lanceur.SQLiteDb\Services\SQLiteDatabaseService.cs:line 75
   at Probel.Lanceur.ViewModels.EditAliasViewModel.CreateAlias() in D:\Projects\lanceur\src\Probel.Lanceur\ViewModels\EditAliasViewModel.cs:line 78
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Caliburn.Micro.ActionMessage.<>c.<.cctor>b__33_0(ActionExecutionContext context)
   at Caliburn.Micro.ActionMessage.Invoke(Object eventArgs)
   at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)"

Process is never disposed

Processus is never disposed.

public void Run(Alias alias)
{
    if (alias.IsExecutable)
    {
        var pInfo = GetProcessStartInfo(alias);
        var ps = new Process { StartInfo = pInfo };
        ps.Start();
        _databaseService.SetUsage(alias);
    }
    else { _keywordService.ExecuteActionFor(alias.Name, alias.Arguments); }
}

Update Cake Script

  • Add Zip files with binaries
  • Automatically set version in the executable

Rename Shortcut into Alias

The word Shortcut has different meanings which could be error prone. Now the shortcuts (MagicWord in Slickrun vocabulary) should be renamed into alias

Releasing: management of version

When releasing, developer have to handle

  • verison in Inno Setup script
  • version in GitVersion configuration file

Automatisation is required

Improve logging

Now logging is simple Trace.WriteLine encapsulated into a simple ILogService. Replace olf facility with NLog

Keyword search management

Tasks

  • Ctrl+F should give focus on the search box
  • Give control to TextBox when page is loaded

Assets

image

Keyword 'corner' does not work

Log


2019-12-04 19:33:02.4251;WARN;Default;1;An error occured while trying to execute the alias 'corner';"System.NullReferenceException: Object reference not set to an instance of an object.
   at Caliburn.Micro.EventAggregatorExtensions.PublishOnUIThread(IEventAggregator eventAggregator, Object message)
   at Probel.Lanceur.Services.ReservedKeywordService.ExecuteActionFor(String name, String arg) in D:\Projects\lanceur\src\Probel.Lanceur.Services\ReservedKeywordService.cs:line 47
   at Probel.Lanceur.ViewModels.MainViewModel.ExecuteText(String cmdLine) in D:\Projects\lanceur\src\Probel.Lanceur\ViewModels\MainViewModel.cs:line 99"
2019-12-04 19:36:31.7300;DEBUG;Default;1;Executing 'C:\Users\jibedoubleve\AppData\Roaming\Spotify\Spotify.exe' with args '';
2019-12-04 19:38:31.0796;DEBUG;Default;1;Executing 'C:\Program Files\ConEmu\ConEmu64.exe' with args '-run {Shells::PowerShell}';
2019-12-04 19:41:37.3174;DEBUG;Default;1;Executing 'C:\Program Files\Double Commander\doublecmd.exe' with args '--no-splash --client --no-console';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.