Documentation ¶
Overview ¶
Package filer draws directories and files and handles inputs.
Index ¶
- func ConfigFinder(config func(*Finder) widget.Keymap)
- func SetBorderStyle(style widget.BorderStyle)
- func SetStatView(size, permission, time bool)
- func SetTimeFormat(format string)
- func TogglePermView()
- func TogglePriority()
- func ToggleShowHiddens()
- func ToggleSizeView()
- func ToggleTimeView()
- type Directory
- func (d *Directory) Base() string
- func (d *Directory) Chdir(path string)
- func (d *Directory) EnterDir()
- func (d *Directory) File() *FileStat
- func (d *Directory) Finder()
- func (d *Directory) Glob(pattern string)
- func (d *Directory) Globdir(pattern string)
- func (d *Directory) InvertMark()
- func (d *Directory) IsMark() bool
- func (d *Directory) Less(i, j int) bool
- func (d *Directory) MarkClear()
- func (d *Directory) MarkCount() int
- func (d *Directory) MarkfileNames() []string
- func (d *Directory) MarkfilePaths() []string
- func (d *Directory) MarkfileQuotedNames() []string
- func (d *Directory) MarkfileQuotedPaths() []string
- func (d *Directory) Markfiles() []*FileStat
- func (d *Directory) Reset()
- func (d *Directory) Resize(x, y, width, height int)
- func (d *Directory) SortExt()
- func (d *Directory) SortExtDec()
- func (d *Directory) SortMtime()
- func (d *Directory) SortMtimeDec()
- func (d *Directory) SortName()
- func (d *Directory) SortNameDec()
- func (d *Directory) SortSize()
- func (d *Directory) SortSizeDec()
- func (d *Directory) ToggleMark()
- type FileStat
- func (f *FileStat) Draw(x, y, width int, focus bool)
- func (f *FileStat) Ext() string
- func (f *FileStat) IsCharDevice() bool
- func (f *FileStat) IsDevice() bool
- func (f *FileStat) IsExec() bool
- func (f *FileStat) IsFIFO() bool
- func (f *FileStat) IsLink() bool
- func (f *FileStat) IsMarked() bool
- func (f *FileStat) IsSocket() bool
- func (f *FileStat) Mark()
- func (f *FileStat) Markoff()
- func (f *FileStat) Name() string
- func (f *FileStat) Path() string
- func (f *FileStat) ResetDisplay()
- func (f *FileStat) SetDisplay(name string)
- func (f *FileStat) ToggleMark()
- type Filer
- func (f *Filer) AddExtmap(a ...interface{})
- func (f *Filer) AddKeymap(keys ...interface{})
- func (f *Filer) CloseWorkspace()
- func (f *Filer) CreateWorkspace()
- func (f *Filer) Dir() *Directory
- func (f *Filer) Draw()
- func (f *Filer) File() *FileStat
- func (f *Filer) Input(key string)
- func (f *Filer) MergeExtmap(m widget.Extmap)
- func (f *Filer) MergeKeymap(m widget.Keymap)
- func (f *Filer) MoveWorkspace(amount int)
- func (f *Filer) Resize(x, y, width, height int)
- func (f *Filer) ResizeRelative(x, y, width, height int)
- func (f *Filer) SaveState(path string) error
- func (f *Filer) Workspace() *Workspace
- type Finder
- type Workspace
- func (w *Workspace) ChdirNeighbor()
- func (w *Workspace) CloseDir()
- func (w *Workspace) CreateDir()
- func (w *Workspace) Dir() *Directory
- func (w *Workspace) Draw()
- func (w *Workspace) LayoutFullscreen()
- func (w *Workspace) LayoutOnecolumn()
- func (w *Workspace) LayoutOnerow()
- func (w *Workspace) LayoutTile()
- func (w *Workspace) LayoutTileBottom()
- func (w *Workspace) LayoutTileTop()
- func (w *Workspace) MoveFocus(amount int)
- func (w *Workspace) NextDir() *Directory
- func (w *Workspace) PrevDir() *Directory
- func (w *Workspace) ReloadAll()
- func (w *Workspace) Resize(x, y, width, height int)
- func (w *Workspace) ResizeRelative(x, y, width, height int)
- func (w *Workspace) SetFocus(x int)
- func (w *Workspace) SetTitle(title string)
- func (w *Workspace) SwapNextDir()
- func (w *Workspace) SwapPrevDir()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFinder ¶
ConfigFinder sets the finder keymap function.
func SetBorderStyle ¶
func SetBorderStyle(style widget.BorderStyle)
SetBorderStyle sets a directory default border style.
func SetStatView ¶
func SetStatView(size, permission, time bool)
SetStatView sets the file state view.
func TogglePriority ¶
func TogglePriority()
TogglePriority toggles the priority for sorting files. The directory is prioritized in sorting if this is true.
func ToggleShowHiddens ¶
func ToggleShowHiddens()
ToggleShowHiddens toggles the showing of hidden files.
Types ¶
type Directory ¶
type Directory struct { *widget.ListBox Path string `json:"path"` Sort sortType `json:"sort_kind"` // contains filtered or unexported fields }
Directory is a list box to store file stats.
func NewDirectory ¶
NewDirectory creates a new directory based on specified size and coordinates.
func (*Directory) Chdir ¶
Chdir changes the current directory and reads a new path by the default reader. Sets the cursor to the history name or to the previous directory name if parent destinats.
func (*Directory) EnterDir ¶
func (d *Directory) EnterDir()
EnterDir changes the directory to a path on the cursor.
func (*Directory) Finder ¶
func (d *Directory) Finder()
Finder starts a finder in the directory for filtering files.
func (*Directory) Globdir ¶
Globdir sets a reader to matching pattern in the directory includeing sub directories.
func (*Directory) MarkfileNames ¶
MarkfileNames returns marked file names.
func (*Directory) MarkfilePaths ¶
MarkfilePaths returns marked file paths.
func (*Directory) MarkfileQuotedNames ¶
MarkfileQuotedNames returns quoted file names for marked.
func (*Directory) MarkfileQuotedPaths ¶
MarkfileQuotedPaths returns quoted file paths for marked.
func (*Directory) SortExt ¶
func (d *Directory) SortExt()
SortExt sorts files in ascending order by the file extension.
func (*Directory) SortExtDec ¶
func (d *Directory) SortExtDec()
SortExtDec sorts files in descending order by the file extension.
func (*Directory) SortMtime ¶
func (d *Directory) SortMtime()
SortMtime sorts files in ascending order by the modified time.
func (*Directory) SortMtimeDec ¶
func (d *Directory) SortMtimeDec()
SortMtimeDec sorts files in descending order by the modified time.
func (*Directory) SortName ¶
func (d *Directory) SortName()
SortName sorts files in ascending order by the file name.
func (*Directory) SortNameDec ¶
func (d *Directory) SortNameDec()
SortNameDec sorts files in descending order by the file name.
func (*Directory) SortSize ¶
func (d *Directory) SortSize()
SortSize sorts files in ascending order by the file size.
func (*Directory) SortSizeDec ¶
func (d *Directory) SortSizeDec()
SortSizeDec sorts files in descending order by the file size.
func (*Directory) ToggleMark ¶
func (d *Directory) ToggleMark()
ToggleMark toggles the file mark on the cursor.
type FileStat ¶
FileStat is file information.
func NewFileStat ¶
NewFileStat creates a new file stat of the file in the directory.
func (*FileStat) IsCharDevice ¶
IsCharDevice reports whether the character device file.
func (*FileStat) ResetDisplay ¶
func (f *FileStat) ResetDisplay()
ResetDisplay resets the display name to the file name.
func (*FileStat) SetDisplay ¶
SetDisplay sets the display name for drawing.
type Filer ¶
type Filer struct { *widget.Window Workspaces []*Workspace `json:"workspaces"` Current int `json:"current"` // contains filtered or unexported fields }
Filer is a file manager with workspaces to layout directorires to list files.
func New ¶
New creates a new filer based on specified size and coordinates. Creates five workspaces and default path is home directory.
func NewFromState ¶
NewFromState creates a new filer form the state json file.
func (*Filer) AddExtmap ¶
func (f *Filer) AddExtmap(a ...interface{})
AddExtmap adds to the filer extmap.
func (*Filer) AddKeymap ¶
func (f *Filer) AddKeymap(keys ...interface{})
AddKeymap adds to the filer keymap.
func (*Filer) CloseWorkspace ¶
func (f *Filer) CloseWorkspace()
CloseWorkspace closes a workspace on the current.
func (*Filer) CreateWorkspace ¶
func (f *Filer) CreateWorkspace()
CreateWorkspace creates and adds a workspace to the end.
func (*Filer) File ¶
File returns the cursor file in the focused directory on the current workspace.
func (*Filer) MergeExtmap ¶
MergeExtmap merges to the filer extmap.
func (*Filer) MergeKeymap ¶
MergeKeymap merges to the filer keymap.
func (*Filer) MoveWorkspace ¶
MoveWorkspace moves to the other workspace.
func (*Filer) ResizeRelative ¶
ResizeRelative resize relative to current sizes.
type Finder ¶
Finder represents textbox for filtering files in the directory.
func (*Finder) Exit ¶
func (f *Finder) Exit()
Exit the finder and reload the directory to clear filtering.
func (*Finder) MoveHistory ¶
MoveHistory moves histories with specified amounts and sets to textbox.
type Workspace ¶
type Workspace struct { *widget.Window Dirs []*Directory `json:"directories"` Layout layoutType `json:"layout"` Title string `json:"title"` Focus int `json:"focus"` }
Workspace is a box storing and layouting directories.
func NewWorkspace ¶
NewWorkspace returns a new workspace of specified sizes.
func (*Workspace) ChdirNeighbor ¶
func (w *Workspace) ChdirNeighbor()
ChdirNeighbor changes the focused path a neighbor directory path.
func (*Workspace) CreateDir ¶
func (w *Workspace) CreateDir()
CreateDir adds the home directory to the head.
func (*Workspace) Draw ¶
func (w *Workspace) Draw()
Draw all directories and hide a cursor if all finders not active.
func (*Workspace) LayoutFullscreen ¶
func (w *Workspace) LayoutFullscreen()
LayoutFullscreen allocates to the full screen layout.
func (*Workspace) LayoutOnecolumn ¶
func (w *Workspace) LayoutOnecolumn()
LayoutOnecolumn allocates to the one column layout.
func (*Workspace) LayoutOnerow ¶
func (w *Workspace) LayoutOnerow()
LayoutOnerow allocates to the one line layout.
func (*Workspace) LayoutTile ¶
func (w *Workspace) LayoutTile()
LayoutTile allocates to the tile layout.
func (*Workspace) LayoutTileBottom ¶
func (w *Workspace) LayoutTileBottom()
LayoutTileBottom allocates to the tile bottom layout.
func (*Workspace) LayoutTileTop ¶
func (w *Workspace) LayoutTileTop()
LayoutTileTop allocates to the tile top layout.
func (*Workspace) ResizeRelative ¶
ResizeRelative relative resizes and layout allocates.
func (*Workspace) SwapNextDir ¶
func (w *Workspace) SwapNextDir()
SwapNextDir swaps focus and next directories.
func (*Workspace) SwapPrevDir ¶
func (w *Workspace) SwapPrevDir()
SwapPrevDir swaps focus and previous directories.