Documentation
¶
Index ¶
- Variables
- func AddProperty(property string, value interface{})
- func ConfigPath(configType string) (string, error)
- func GetProperty(property string) string
- func GetPropertyMap(property string) map[string]string
- func Init(bluez *bluez.Bluez)
- func IsPropertyEnabled(property string) bool
- func KeyName(kb Keybinding) string
- func NavigationKey(pressed Key, event *tcell.EventKey) (*tcell.EventKey, bool)
- func Parse()
- func Print(message string, status ...int)
- func PrintError(message string, err ...error)
- func PrintWarn(message string)
- type Config
- type ConfigDir
- type Key
- type KeyContext
- type KeyData
- type Keybinding
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( // OperationKeys matches the operation name (or the menu ID) with the keybinding. OperationKeys = map[Key]*KeyData{ KeySwitch: { Title: "Switch", Context: KeyContextApp, Kb: Keybinding{tcell.KeyTab, ' ', tcell.ModNone}, Global: true, }, KeyClose: { Title: "Close", Context: KeyContextApp, Kb: Keybinding{tcell.KeyEscape, ' ', tcell.ModNone}, Global: true, }, KeyQuit: { Title: "Quit", Context: KeyContextApp, Kb: Keybinding{tcell.KeyRune, 'Q', tcell.ModNone}, Global: true, }, KeyMenu: { Title: "Menu", Context: KeyContextApp, Kb: Keybinding{tcell.KeyRune, 'm', tcell.ModAlt}, }, KeySelect: { Title: "Select", Context: KeyContextApp, Kb: Keybinding{tcell.KeyEnter, ' ', tcell.ModNone}, Global: true, }, KeyCancel: { Title: "Cancel", Context: KeyContextApp, Kb: Keybinding{tcell.KeyCtrlX, ' ', tcell.ModCtrl}, Global: true, }, KeySuspend: { Title: "Suspend", Context: KeyContextApp, Kb: Keybinding{tcell.KeyCtrlZ, ' ', tcell.ModCtrl}, Global: true, }, KeyHelp: { Title: "Help", Context: KeyContextApp, Kb: Keybinding{tcell.KeyRune, '?', tcell.ModNone}, Global: true, }, KeyNavigateUp: { Title: "Navigate Up", Context: KeyContextApp, Kb: Keybinding{tcell.KeyUp, ' ', tcell.ModNone}, }, KeyNavigateDown: { Title: "Navigate Down", Context: KeyContextApp, Kb: Keybinding{tcell.KeyDown, ' ', tcell.ModNone}, }, KeyNavigateRight: { Title: "Navigate Right", Context: KeyContextApp, Kb: Keybinding{tcell.KeyRight, ' ', tcell.ModNone}, }, KeyNavigateLeft: { Title: "Navigate Left", Context: KeyContextApp, Kb: Keybinding{tcell.KeyLeft, ' ', tcell.ModNone}, }, KeyNavigateTop: { Title: "Navigate Top", Context: KeyContextApp, Kb: Keybinding{tcell.KeyPgUp, ' ', tcell.ModNone}, }, KeyNavigateBottom: { Title: "Navigate Bottom", Context: KeyContextApp, Kb: Keybinding{tcell.KeyPgDn, ' ', tcell.ModNone}, }, KeyAdapterTogglePower: { Title: "Power", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'o', tcell.ModNone}, }, KeyAdapterToggleDiscoverable: { Title: "Discoverable", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'S', tcell.ModNone}, }, KeyAdapterTogglePairable: { Title: "Pairable", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'P', tcell.ModNone}, }, KeyAdapterToggleScan: { Title: "Scan", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 's', tcell.ModNone}, }, KeyAdapterChange: { Title: "Change", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'a', tcell.ModNone}, }, KeyDeviceConnect: { Title: "Connect", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'c', tcell.ModNone}, }, KeyDevicePair: { Title: "Pair", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'p', tcell.ModNone}, }, KeyDeviceTrust: { Title: "Trust", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 't', tcell.ModNone}, }, KeyDeviceBlock: { Title: "Block", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'b', tcell.ModNone}, }, KeyDeviceSendFiles: { Title: "Send", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'f', tcell.ModNone}, }, KeyDeviceNetwork: { Title: "Network Options", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'n', tcell.ModNone}, }, KeyDeviceAudioProfiles: { Title: "Audio Profiles", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'A', tcell.ModNone}, }, KeyDeviceInfo: { Title: "Info", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'i', tcell.ModNone}, }, KeyDeviceRemove: { Title: "Remove", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'd', tcell.ModNone}, }, KeyPlayerShow: { Title: "Show Media Player", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'm', tcell.ModNone}, }, KeyPlayerHide: { Title: "Hide Media Player", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, 'M', tcell.ModNone}, }, KeyPlayerTogglePlay: { Title: "Play/Pause", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, ' ', tcell.ModNone}, }, KeyPlayerNext: { Title: "Next", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, '>', tcell.ModNone}, }, KeyPlayerPrevious: { Title: "Previous", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, '<', tcell.ModNone}, }, KeyPlayerSeekForward: { Title: "Seek Forward", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyLeft, ' ', tcell.ModNone}, }, KeyPlayerSeekBackward: { Title: "Seek Backward", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRight, ' ', tcell.ModNone}, }, KeyPlayerStop: { Title: "Stop", Context: KeyContextDevice, Kb: Keybinding{tcell.KeyRune, ']', tcell.ModNone}, }, KeyFilebrowserConfirmSelection: { Title: "Confirm Selection", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyCtrlS, ' ', tcell.ModCtrl}, }, KeyFilebrowserDirForward: { Title: "Go Forward", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyRight, ' ', tcell.ModNone}, }, KeyFilebrowserDirBack: { Title: "Go Back", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyLeft, ' ', tcell.ModNone}, }, KeyFilebrowserSelect: { Title: "Select", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyRune, ' ', tcell.ModNone}, }, KeyFilebrowserInvertSelection: { Title: "Invert Selection", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyRune, 'a', tcell.ModNone}, }, KeyFilebrowserSelectAll: { Title: "Select All", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyRune, 'A', tcell.ModNone}, }, KeyFilebrowserRefresh: { Title: "Refresh", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyCtrlR, ' ', tcell.ModCtrl}, }, KeyFilebrowserToggleHidden: { Title: "Hidden", Context: KeyContextFiles, Kb: Keybinding{tcell.KeyRune, 'h', tcell.ModCtrl}, }, KeyProgressTransferResume: { Title: "Resume Transfer", Context: KeyContextProgress, Kb: Keybinding{tcell.KeyRune, 'g', tcell.ModNone}, }, KeyProgressTransferCancel: { Title: "Cancel Transfer", Context: KeyContextProgress, Kb: Keybinding{tcell.KeyRune, 'x', tcell.ModNone}, }, KeyProgressView: { Title: "View Downloads", Context: KeyContextProgress, Kb: Keybinding{tcell.KeyRune, 'v', tcell.ModNone}, }, KeyProgressTransferSuspend: { Title: "Suspend Transfer", Context: KeyContextProgress, Kb: Keybinding{tcell.KeyRune, 'z', tcell.ModNone}, }, } // Keys match the keybinding to the key type. Keys map[KeyContext]map[Keybinding]Key )
var Version string
Version stores the version information.
Functions ¶
func AddProperty ¶ added in v0.1.7
func AddProperty(property string, value interface{})
AddProperty adds a property and its value to the properties store.
func ConfigPath ¶ added in v0.0.6
ConfigPath returns the absolute path for the given configType.
func GetProperty ¶ added in v0.1.7
GetProperty returns the value for the given property.
func GetPropertyMap ¶ added in v0.1.8
GetPropertyMap returns a map of values for the given property.
func IsPropertyEnabled ¶ added in v0.1.7
IsPropertyEnabled returns if a property is enabled.
func KeyName ¶ added in v0.1.7
func KeyName(kb Keybinding) string
KeyName formats and returns the key's name.
func NavigationKey ¶ added in v0.1.8
NavigationKey checks whether the provided key is a navigation key.
func PrintError ¶ added in v0.1.7
PrintError prints an error to the screen.
Types ¶
type Config ¶ added in v0.1.7
type Config struct { *koanf.Koanf // contains filtered or unexported fields }
Config describes the configuration for the app.
type ConfigDir ¶ added in v0.1.7
type ConfigDir struct {
// contains filtered or unexported fields
}
ConfigDir describes the path and properties of a configuration directory.
type Key ¶ added in v0.1.7
type Key string
Key describes the application keybinding type.
const ( KeyMenu Key = "Menu" KeySelect Key = "Select" KeyCancel Key = "Cancel" KeySuspend Key = "Suspend" KeyQuit Key = "Quit" KeySwitch Key = "Switch" KeyClose Key = "Close" KeyHelp Key = "Help" KeyAdapterChange Key = "AdapterChange" KeyAdapterTogglePower Key = "AdapterTogglePower" KeyAdapterToggleDiscoverable Key = "AdapterToggleDiscoverable" KeyAdapterTogglePairable Key = "AdapterTogglePairable" KeyAdapterToggleScan Key = "AdapterToggleScan" KeyDeviceSendFiles Key = "DeviceSendFiles" KeyDeviceNetwork Key = "DeviceNetwork" KeyDeviceConnect Key = "DeviceConnect" KeyDevicePair Key = "DevicePair" KeyDeviceTrust Key = "DeviceTrust" KeyDeviceBlock Key = "DeviceBlock" KeyDeviceAudioProfiles Key = "DeviceAudioProfiles" KeyDeviceInfo Key = "DeviceInfo" KeyDeviceRemove Key = "DeviceRemove" KeyPlayerShow Key = "PlayerShow" KeyPlayerHide Key = "PlayerHide" KeyFilebrowserDirForward Key = "FilebrowserDirForward" KeyFilebrowserDirBack Key = "FilebrowserDirBack" KeyFilebrowserSelect Key = "FilebrowserSelect" KeyFilebrowserInvertSelection Key = "FilebrowserInvertSelection" KeyFilebrowserSelectAll Key = "FilebrowserSelectAll" KeyFilebrowserRefresh Key = "FilebrowserRefresh" KeyFilebrowserToggleHidden Key = "FilebrowserToggleHidden" KeyFilebrowserConfirmSelection Key = "FilebrowserConfirmSelection" KeyProgressView Key = "ProgressView" KeyProgressTransferSuspend Key = "ProgressTransferSuspend" KeyProgressTransferResume Key = "ProgressTransferResume" KeyProgressTransferCancel Key = "ProgressTransferCancel" KeyPlayerTogglePlay Key = "PlayerTogglePlay" KeyPlayerNext Key = "PlayerNext" KeyPlayerPrevious Key = "PlayerPrevious" KeyPlayerSeekForward Key = "PlayerSeekForward" KeyPlayerSeekBackward Key = "PlayerSeekBackward" KeyPlayerStop Key = "PlayerStop" )
The different application keybinding types.
func KeyOperation ¶ added in v0.1.7
func KeyOperation(event *tcell.EventKey, keyContexts ...KeyContext) Key
KeyOperation returns the operation name for the provided keyID and the keyboard event.
type KeyContext ¶ added in v0.1.7
type KeyContext string
KeyContext describes the context where the keybinding is supposed to be applied in.
const ( KeyContextApp KeyContext = "App" KeyContextDevice KeyContext = "Device" KeyContextFiles KeyContext = "Files" KeyContextProgress KeyContext = "Progress" )
The different context types for keybindings.
type KeyData ¶ added in v0.1.7
type KeyData struct { Title string Context KeyContext Kb Keybinding Global bool }
KeyData stores the metadata for the key.
func OperationData ¶ added in v0.1.7
OperationData returns the key data associated with the provided keyID and operation name.
type Keybinding ¶ added in v0.1.7
type Keybinding struct { Key tcell.Key Rune rune Mod tcell.ModMask }
Keybinding stores the keybinding.