tbg (teabag) allows the user to have and manage multiple background images that rotate at a set amount of time for Windows Terminal
This edits the settings.json
used by Windows Terminal; specifically, the
backgroundImage
on the default profile by default but user can override it.
It overwrites the backgroundImage
value every 30 minutes by default but the
user can override that too (as well as image alignment, stretch, and opacity)
Download the latest release of tbg
or
- clone the repo
git clone [email protected]:saltkid/tbg.git
cd tbg
- build it:
go mod tidy
go build -ldflags '-s'
Optionally add the tbg
executable to your path
tbg run
On initial execution of tbg, it will create a default config
(.tbg.yml
) in the same directory as the executable. You can edit this
manually or use tbg commands to edit these with input
validation
While tbg is running, it takes in optional user input through key presses. Here's a list of commands:
q
: quitc
: shows the available commandsn
: goes to next image in the current images pathN
: goes to next images pathp
: goes to previous image in the current images pathP
: goes to previous images pathr
: randomize imagesR
: randomize images paths
See fields for more information about images paths.
The images paths wrap around so if you go past the last image in the last path, it will go back to the first image in the first images path. Same goes for the reverse direction.
.tbg.yml
is what is used by tbg to edit the settings.json
Windows
Terminal uses.
Although you can edit the fields in the config directly, it is recommended to
use the config
command to edit them.
- profile
- args:
default
,list-0
,list-1
, ... - target profile in Windows Terminal.
- args:
- interval
- args: any positive integer
- time in minutes between each image change.
- paths
- args:
[]
- path: path/to/dir1
-
- path: path/to/dir2 alignment: center # optional stretch: uniformToFill # optional opacity: 1.0 # optional
- paths containing images used in changing the background image of Windows Terminal
- args:
- alignment
- ( args ):
top
,topLeft
,topRight
,left
,center
,right
,bottom
,bottomLeft
,bottomRight
- image alignment in Windows Terminal.
- Can be overriden on a per-path basis
- ( args ):
stretch
- args:
uniform
,fill
,uniformToFill
,none
- image stretch in Windows Terminal. Can be overriden on a per-path basis
- args:
opacity
- args: inclusive range between
0
and1
- image opacity of background images in Windows Terminal.
- Can be overriden on a per-path basis
- args: inclusive range between
For a more detailed explanation on each command, follow the command name links
- run
- args: none
- flags:
-p, --profile
,-i, --interval
,-a, --alignment
,-o, --opacity
,-s, --stretch
,-r, --random
- edit
settings.json
used by Windows Terminal using settings from.tbg.yml
. If any of the flags are specified, it will use those values in editingsettings.json
instead of what's specified in the.tbg.yml
- config
- args: none
- flags:
-p, --profile
,-i, --interval
,-a, --alignment
,-o, --opacity
,-s, --stretch
- If no flags are present, it will print out
.tbg.yml
to console. If any of the flags are present, it will edit the fields of the config based on the flags and values passed
- add
path/to/dir
- flags:
-a, --alignment
,-o, --opacity
,-s, --stretch
- Add a path containing images to
.tbg.yml
. - If any flags are present, it will add those options to that path, regardless of whether the path exists or not
- remove
path/to/dir
- flags:
-a, --alignment
,-o, --opacity
,-s, --stretch
- Remove a path from
.tbg.yml
. - If any flags are present, it will remove only those options of that path
- help
- args: no arg, or any command or any flag (can be multiple)
- Prints the general help message when no arg is given
- Prints the help message/s of command/s and/or flag/s if specified
Flags are used to override field entries in a config, which are then passed to the parent command.
Flags behave differently based on the parent command so for more detailed explanation, go to the documentation of the command instead.
Flag | Field Overriden |
---|---|
-p, --profile |
profile |
-i, --interval |
interval |
-a, --alignment |
alignment |
-o, --opacity |
opacity |
-s, --stretch |
stretch |
- Windows Terminal
- keyboard for handling key events
- saltkid