• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto-magic file organisation and routing for all your machines. 📂

Switchboard

GitHub Actions Status GitHub Actions Status Go Report Card Homebrew Downloads Downloads GitHub go.mod Go version of a Go module GoDoc reference example GitHub stars GitHub forks

Gomerge logo

Description

Do you ever get annoyed that your Downloads folder gets cluttered with all types of files? Do you wish you could automatically organise them into seperate, organised folders? Switchboard is a tool to help simplfy file organization on your machine/s.

Switchboard works by monitoring a directory you provide (or list of directories), and uses file system notifications to move a matched file to the appropriate destination directory of your choosing.

See the video below as example. Here, I give switchboard a path to watch, a destination where I want matched files to move to, and the file extension of the type of files I want to move.

Pro

As of version v1.0.0 we have released a pro version which has a ton more features and functionality. Head over to https://goswitchboard.io/pro for more info.

Switchboard Pro gives you extra features and support over the free open-source version.

Purchasing a pro or enterprise license for Switchboard Pro helps us to continue working on both the pro and free version of the software, and bring more features to YOU!

  • Support for prioritising specific file events over others.
  • Regex support so you can watch for any file name or type you choose.
  • Support for archival file extractions, .zip/.rar et al.
  • Support for optional file removal.
  • Product support should you run into any issues.
  • Access to product roadmap.
  • Priority feature requests.

asciicast

You can also visit https://goswitchboard.io/ for all your documentation needs, news, and updates!

Installation

You can install switchboard pre-compiled binary in a number of ways.

Homebrew
brew tap Cian911/switchboard
brew install switchboard

// Check everything is working as it should be
switchboard -h

You can also upgrade the version of switchboard you already have installed by doing the following.

brew upgrade switchboard
Docker
docker pull ghcr.io/cian911/switchboard:${VERSION}

docker run -d -v ${SRC} -v ${DEST} ghcr.io/cian911/switchboard:${VERSION} watch -h
Go Install
go install github.com/Cian911/switchboard@${VERSION}
Manually

You can download the pre-compiled binary for your specific OS type from the OSS releases page. You will need to copy these and extract the binary, then move it to you local bin directory. See the example below for extracting a zipped version.

curl https://github.com/Cian911/switchboard/releases/download/${VERSION}/${PACKAGE_NAME} -o ${PACKAGE_NAME}
sudo tar -xvf ${PACKAGE_NAME} -C /usr/local/bin/
sudo chmod +x /usr/local/bin/switchboard

Quick Start

Using switchboard is pretty easy. Below lists the set of commands and flags you can pass in.

Run the switchboard application passing in the path, destination, and file type you'd like to watch for.

Usage:
   watch [flags]

Flags:
      --config string        Pass an optional config file containing multiple paths to watch.
  -d, --destination string   Path you want files to be relocated.
  -e, --ext string           File type you want to watch for.
  -h, --help                 help for watch
  -p, --path string          Path you want to watch.
      --poll int             Specify a polling time in seconds. (default 60)
  -r, --regex-pattern string Pass a regex pattern to watch for any files matching this pattern.

To get started quickly, you can run the following command, passing in the path, destination, and file extenstion you want to watch for. See the example below.

switchboard watch -p /home/user/Downloads -d /home/user/Movies -e .mp4

We highly recommend using absolute file paths over relative file paths. Always include the . when passing the file extension to switchboard.

And that's it! Once ran, switchboard will start observing the user downloads folder for mp4 files added. Once it receives a new create event with the correct file extension, it will move the file to the users movies folder.

Important Notes

Polling

We set a high polling time on switchboard as in some operating systems we don't get file closed notifications. Therefore switchboard implements a polling solution to check for when a file was last written to. If the file falls outside the time since last polled, the file is assumed to be closed and will be moved to the destination directory. This obviously is not ideal, as we can't guarentee that a file is actually closed. Therefore the option is there to set the polling interval yourself. In some cases, a higher polling time might be necessary.

Polling & Linux

As of release v1.0.0 we now support IN_CLOSE_WRITE events in linux systems. For context, this event tells us when a process has finished writing to a file (something we don't get on OSX & Windows). This means we do not need to use polling for linux systems (though we do for some circumstances) however the functionaity still exists should you wish to use it.

Absolute File Path

As you might have noticed in the example above, we passed in the absolute file path. While relative file paths will work too, they have not been tested in all OS systems. Therefore we strongly recommend you use absolute file paths when running switchboard.

File Extenstion

You may have also noticed in the above example, we used .mp4 including the prefixed .. This is important, as switchboard will not match file extenstions correctly if the given --ext flag does not contain the ..

More Repositories

1

gomerge

Gomerge is a tool which allows you to quickly bulk merge, approve and close several pull requests from your terminal. 🌟
Go
46
star
2

vim-cadence

Syntax highlight for the Cadence programming language. A high level programming lanaguage intended for smart contract development. :neckbeard:
Vim Script
14
star
3

flink-home

Custom made CO2 sensor using data to automate home ventilation system. 😷
Scala
4
star
4

syncwave

Tool to automate the provisioning of my at home raspberry-pi kubernetes cluster.
Go
4
star
5

gomerge-action

Github action utilising the Gomerge CLI tool to bulk merge and approve pull requests.
Shell
2
star
6

goverview

Dashboard to give real-time updates to running github actions across an organisation.
HTML
2
star
7

Broconut

Completely customizable Java application that allows you to screen cap and upload to a server of your choosing.
Java
2
star
8

angularjs_samples

Test repository for different uses and experiments with AngularJs
JavaScript
1
star
9

torrent-client

Go
1
star
10

phpmvc-scratch

Creating a PHP MVC framework from scratch
PHP
1
star
11

playing-with-rails

My Blog, written in rails..
Ruby
1
star
12

php-custom-mvc

A custom PHP MVC framework.
JavaScript
1
star
13

autodev

Bash script which automates the process of setting up a local apache development server
Shell
1
star
14

bento

Go client to automate blauberg-vento smart fan & ventilation systems based on CO2 data from InfluxDB.
Go
1
star
15

slackbot-healthcheck

A slack bot that sends team members a notification to stretch and get up outta their desks every so often
Ruby
1
star