Giter Site home page Giter Site logo

catapult's Introduction

catapult

A simple console application to launch multiple urls or applications simultaneously.

๐Ÿ’ก Why?

When working on a project, I often have multiple webpages that I want to open together; and stow away when I'm done. While I utilize the "Restore Last Session" feature of the browser, the fact that there can be only one "last" session, limits me to a single project at a time. I usually have an exorbitant amount of tabs open at any given time, but not all of them are relevant to the work I'm doing at the moment. They persist because I need to get back to them later.

Tab-session-manager extensions offer a solution, but I wanted something that would persist the information on the disk - something that I can launch like a url shortcut. This way, the browser workspace can live next to the project files.

๐Ÿ“˜ Usage

Note

This is technically a command-line application, so you can use it directly from the terminal as shown below, but the main idea was to associate a file extension with this application, so that you can launch the urls directly by double-clicking on the file.

catapult.exe <filename>
  • filename: The path to a file containing urls/filepaths to launch.

Note

All this really does is extract the paths from the file and tells the shell to open them. The shell does the rest.

URLs/Paths can be put in any plaintext file (e.g. .txt, .md, .catapult, .browser-workspace) on the disk - akin to Internet Shortcut (.url) files. For example:

https://google.com
https://github.com
# This is a comment

However, unlike Internet Shortcuts that can only launch one url at a time, this application allows you to specify multiple urls in a single file and launch them all at once.

This allows me to swiftly get back to work, without having to recall the urls I had open for a given project.

๐Ÿ“„ File Association

Windows

When you open a file with an un-encountered extension, Windows will ask you to choose a program to open it with. You can choose an application (you may have to browse to the .exe) and check the "Always use this app to open" option to associate the file extension with this application.

From then on, you can simply double-click on the file to launch it using the specified application.

Linux

You can achieve the same effect by creating a .desktop file and associating it with the file extension. The .desktop file can be used to launch the application with the file as an argument.

You may also need to create a MIME type for the custom file extension.

I'm mostly on the terminal when using linux, so I normally use the command-line there instead of double-clicking the file. That said, desktop file-association can be done.

How does this work?

The path to the file is passed as the first argument to the application. The application is designed to take the first argument, read the file, extract the paths and instruct the shell to "start" them. The shell already knows how to handle the urls and the filepaths, so it does the rest.

๐ŸŽฏ Objectives

One of the goals of this project was to leverage the Windows file-association mechanism. By specifying a custom file extension (i.e. .catapult), that I associate with this application, I could launch the urls by double-clicking on the file - mirroring the behaviour of a Internet Shortcut (.url) file. This allows me to save all the urls for a project to the disk, and launch them all collectively.

I also took the opportunity to write this application in C++. I initially wrote the entire thing in Go in about 5 minutes, and thought to myself, "Maybe I should write this in a language I don't normally use!". So I did. I had only ever used C++ in an academic setting, and never really made anything useful with it.

I thought, it can't get much simpler than this, so why the hell not?

๐Ÿ“„ License

This project is licensed under the MIT License

catapult's People

Contributors

shresht7 avatar

Watchers

 avatar

catapult's Issues

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.