xmb-bigscreen
XMB for Plasma BigScreen, console-like fullscreen launcher for living room gamepad users
A CLI-based launcher and general productivity tool.
git clone https://github.com/reibitto/command-center.gitreibitto/command-centerA CLI-based launcher and general productivity tool.
Command Center is used to launch applications, find files, control music playback, search the web, run one-off CLI commands, manage windows, and anything else you can imagine since it's customizable.
If you're familiar with tools like Alfred, Wox, ueli, Keypirinha, etc. you may already understand the concept. These tools already work great. Command Center aims to fill a slightly different niche though, targeting hackers/programmers who enjoy and are familiar with working in the command line.
(Note: Command Center is still in active development. Some of these are still being worked on.)
Start typing the name of the file you're looking for. You can also use the following commands:
find filename - Find file by filenamein filename - Find file by its contentsplay - Start playing music (e.g. by default opens iTunes on macOS)pause - Pause the current trackstop - Stop the current tracknext - Switch to the next track in your playlistprevious - Switch to the previous track in your playlistrate [1-5] - Rate the current trackIf you want to start a simple countdown timer:
timer 15m -m "Call Sally"
This will pop up a notification after 15 minutes. Specifying a message is optional.
You can suspend (toggle) a process by its PID with:
suspend 321
The suspend command also has a configurable suspendShortcut attribute that is a global shortcut. This is
useful if you want to be able to pause applications that don't have a built-in pause feature, such as games. The idea
for this feature came from Universal Pause Button.
Global hotkeys can be mapped to various window management actions. For example:
Note: This feature currently only supports Windows. The goal is to support all OSes soon.
You can use some built-in constructions and functions to quickly evaluate mathematical expressions:
numbers, e. g. 5, -2., +2.6constants (case-insensitive):
pi() (parentheses for grouping)+, -, *, /, % (modulo), ^ (power), e. g. 5 * (3 - 4/2) ^ 2 % 3^ has a higher precedence than any other symbolic operators, all of which has equal precedence! (factorial), acos, asin, atan, ceil, cos, cosh, exp, floor, ln,
round, sin, sinh, sqrt, tan, tanh, toDeg (radians -> degrees), toRad (degrees -> radians)atan2, choose (Newton's binomial), gcd (greatest common divisor), hypot (square root of x^2 + y^2), log, randommax, minWhitespaces between parts of an expression are ignored.
One-parametric functions can be written in two forms:
sin PI, sqrt 16sin(PI / 2), sqrt(9).Two- or multi-parametric functions can be written in three forms: gcd 20 16, or gcd 20; 16, or gcd(20; 16)
(; is here the configurable parameterSeparator).
choose has also an infix form: 6 choose 3.
max/min can have more than two parameters: max 0 5 (-6/4).
random has 3 flavours:
random (zero-parametric): a random number from [0, 1]random a b (two-parametric): a random number from [a, b]random int a b (two-parametric): a whole random number from [a, b]Constraints:
n choose r, both n and r have to be whole and non-negative, n >= rn!, n has to be whole and non-negativegcd(a, b), both a and b have to be wholeParameters
As different countries may have their own traditions for writing numbers (one of the obvious differences being the decimal separator —
dot vs. comma), some of the most important parameters are determined locale-specifically or can be overriden in application.conf if needed:
{
type: "CalculatorCommand"
decimalSeparator: ","
groupingSeparator: "_"
parameterSeparator: ";"
groupingSize: 3
groupingUsed: true
maximumFractionDigits: 10
}
These settings apply both for parsing and displaying. parameterSeparator can be used with a multi-parametric function.
All other parameters correspond to properties of DecimalFormat/DecimalFormatSymbols of the same name.
Any of them can be omitted, their default values are then locale-specific. For the parameterSeparator the default is ;.
List available operators/functions
Type in calculator functions to see the full list of available operators and functions.
List available configuration parameters
Type in calculator parameters to see the full list of available configuration parameters for application.conf.
At the moment there is no simple "1-step install". You need to compile and generate an executable yourself (or run directly from SBT).
application.conf is needed to run Command Center. The following locations are searched (in order):
COMMAND_CENTER_CONFIG_PATH (if defined)~/.command-center/application.conf./application.confImportant note: For the pop-up emulator window to activate and come to the front properly on macOS you need to make sure you
place the cc-tools executable in the proper location. Either place it in ~/.command-center/cc-tools or define the
COMMAND_CENTER_TOOLS_PATH environment variable if you want to specify a custom location.
Command Center comes with some optional plugins. These plugins are optional because they're either too niche or bring in heavier dependencies that normal users wouldn't need. Currently there are:
A real-time, offline dictionary plugin (currently only supports Japanese). This is based on Ject.
You'll need to build the Lucene index first as described in the README. Then specify the command in application.conf like this:
{
type: "commandcenter.ject.JectJaCommand$",
dictionaryPath: "/path/to/ject/data/lucene/word-ja"
}
A tool for searching kanji by parts. This plugin also uses Ject and requires a Lucene index for the kanji dictionary to be created first.
Some example queries:
kanji 日月: 明, 朝, 晴, 腸, 盟, etc.kanji 大山可: 崎, 嵜, etc.kanji キヒ日: 指, 掲, etc.kanji B東: 陳As you can see, there are some "shortcuts" for convenience if you don't know how to type a certain radical. These can be found here.
To install the Kanji plugin, you need the following in application.conf:
{
type: "commandcenter.ject.KanjiCommand$",
dictionaryPath: "/path/to/ject/data/lucene/kanji"
}
Used to bring up the stroke order of kanji. This relies on having Kanji stroke order font
installed. Also it requires using the terminal emulator as native CLI clients rarely allow changing the default font. Usage is stroke 漢字. The config
looks like this:
{type: "commandcenter.strokeorder.StrokeOrderCommand$"}
You can either set an sbt option or environment variable to enable the above plugins:
export COMMAND_CENTER_PLUGINS="stroke-order-plugin, ject-plugin"
or start up sbt like this:
sbt -Dcommand-center-plugins="ject-plugin, stroke-order-plugin"
To enable all plugins, you can also use *.
Command Center mainly uses Scala with a strong focus on typed functional programming (via ZIO). Types make developing plugins a much more pleasant experience as you get feedback quicker and features are more discoverable. Writing a command is as simple as writing a single class like so.
Once you start SBT, you should be presented a list of common commands. For example:
~compile - Compile all modules with file-watch enabledcli/run - Run Command Center CLI client (interactive mode by default). Particularly useful for local development.emulator-swing/run - Run the Command Center emulated terminal (cmd+space to summon terminal emulator)emulator-swing/assembly - Create an executable JAR for running in terminal emulator modecli/assembly - Create an executable JAR for running command line utilitycli/graalvm-native-image:packageBin - Create a native executable of the CLI clientAll commands can be configured. You can disable any core command, rename them, change their options, add new commands, create aliases (useful for shortening argument passing), and so on.
Commands and options are configured with a single HOCON configuration file. To see an example, take a look at application.conf.
If you created a plugin and it's general-purpose and doesn't bring in extra dependencies, feel free to create an issue or PR to get the command into Command Center's core commands. If not (or if you'd prefer to maintain the plugin yourself), you can create your own separate repository to host it. If you let me know, I can add it to a list of external plugins.
Eventually the goal is to make installing external plugins as simple as running a single install command. See this issue here.
Until then, it's a matter of dropping your jar file in the plugins folder and restarting the app. For more details on
external plugins, refer to the plugins readme.
There are a lot of issues marked as "good first issue" here. Feel free to take any that interest you. I'd also appreciate any help for OS-specific features. Help with Windows and Linux would be great since I've mainly been focusing on macOS for now.
Writing your own commands is a great way to begin learning ZIO. Each command can be developed, tested, and run in isolation. For more help with ZIO, the Discord channel is a great place to ask questions.
more like this
XMB for Plasma BigScreen, console-like fullscreen launcher for living room gamepad users
search projects, people, and tags