Comments (3)
Flow Launcher can be used in portable mode allowing the use of cloud drives, git, syncthing, etc.
from flow.launcher.
It's true but it really costs my space and time. Sync the whole app in cloud might have some problem for too many files.
Flowlauncher was packed with runtime. Can they be deleted if I installed .net?
I think just sync a folder wasn't difficult. In C#,we can use Microsoft.Graph.
This is an example (bad code):
using Microsoft.Graph;
using Microsoft.Identity.Client;
using System;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace OneDriveAppFolderExample{
class Program{
private static GraphServiceClient graphClient;
private static string clientId = "*#*#*#*#*";
private static string[] scopes = new string[] { "Files.ReadWrite.AppFolder" };
static async Task Main(string[] args){
var authProvider = new InteractiveAuthenticationProvider(clientId, scopes);
graphClient = new GraphServiceClient(authProvider);
var appFolder = await CreateAppFolder();
await UploadFileToAppFolder(appFolder, @"UserData/settings");
//This need keep flow's working directory not change
//In file search plugin, if user use the position of the executable file as the working directory, it will not work. We need not change the working directory of the main process.
}
private static async Task<DriveItem> CreateAppFolder(){
try{
var appFolder = await graphClient.Me.Drive.Special.AppRoot
.Request()
.GetAsync();
return appFolder;
}
catch (ServiceException ex){
if (ex.StatusCode == System.Net.HttpStatusCode.NotFound){
var folderToCreate = new DriveItem{
Name = "Flow.Launcher",
Folder = new Folder()
};
var appFolder = await graphClient.Me.Drive.Special.AppRoot
.Children
.Request()
.AddAsync(folderToCreate);
return appFolder;
}
else{
throw;
}
}
}
private static async Task UploadFileToAppFolder(DriveItem appFolder, string localFilePath){
using (var fileStream = System.IO.File.OpenRead(localFilePath)){
var uploadedFile = await graphClient.Me.Drive.Items[appFolder.Id]
.ItemWithPath(System.IO.Path.GetFileName(localFilePath))
.Content
.Request()
.PutAsync<DriveItem>(fileStream);
Console.WriteLine("Uploaded file ID: " + uploadedFile.Id);
}
}
}
public class InteractiveAuthenticationProvider : IAuthenticationProvider {
private IPublicClientApplication _msalClient;
private string[] _scopes;
public InteractiveAuthenticationProvider(string clientId, string[] scopes){
_msalClient = PublicClientApplicationBuilder.Create(clientId).Build();
_scopes = scopes;
}
public async Task AuthenticateRequestAsync(HttpRequestMessage request){
var authResult = await _msalClient.AcquireTokenInteractive(_scopes).ExecuteAsync();
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", authResult.AccessToken);
}
}
}
from flow.launcher.
We want to create this feature, but we don't have anyone to work on it now.
(Sadly, The simple setting backup/restore feature too.)
If you know how to write code, please make a PR.
from flow.launcher.
Related Issues (20)
- The ability to re-queue last queries. HOT 2
- BUG: Flow Launcher won't show up HOT 6
- BUG: Launched programs have old environment variables HOT 3
- Preview usage HOT 1
- Non-rounded (rectangle) search bar corners HOT 2
- BUG: Unhandled exception after setting Explorer > Customize Action Keywords > Path Search
- Crash after wake up from power save HOT 2
- BUG: System.UriFormatException: Invalid URI HOT 1
- Difficulty accessing plugin settings programmatically with Python HOT 2
- BUG: System.UnauthorizedAccessException HOT 2
- Can't set hotkey to "Win + Space" HOT 8
- way too long startup time HOT 1
- Browser bookmark HOT 1
- BUG: Error on launch HOT 2
- Flow launcher got an error
- hide Uninstallers filters options in Programs Plugin
- WebView/Live search plugin HOT 4
- BUG: Translation. FL Portable v1.18.0.8643 HOT 2
- BUG: Open “uri schemes” no longer showing up as an option
- Error when Flow Launcher is starting HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow.launcher.