Giter VIP home page Giter VIP logo

statusbarextended's Introduction

StatusBarExtended

Extends the status bar in fman to show additional information.

Turn the plugin on or off by using a keyboard shortcut, default is F3.

Configure the plugin by using a keyboard shortcut, default is ShiftF3.

Features

Adds extra information to the status bar.

  • Show the number of directories/files and the total size of files in the current directory for both panes
  • Show "Toggle hidden files" status ( shown hidden)
  • Show the number of selected directories/files and the total size of selected files
  • Show the currently active pane indicator ( left right)

Aligns indicator positions to avoid "jitter" on selection/navigation

Allows a user to configure all the options via the configure_status_bar_extended command aliased as StatusBarExtended: configure in the Command Palette:

Option Default Description
Enabled True Enable or disable this plugin
SizeDivisor 1024 File size format: decimal (1k=1000=10³) or binary (1k=1024=2¹⁰)
MaxGlob 5000 Skip folders with as many items (folders+files)
SymbolPane Left/Right pane symbol
SymbolHiddenF Hidden files Shown/Hidden symbol (tip: try 👁 👀👓 ✓✗ ◎◉ 🐵🙈)
HideDotfile False Treat .dotfiles as hidden files on Windows
Justify 5 5 7 Minimum width of the Folder/File/Size values, e.g.
5,321
   21

Preview

Status Bar without selection Status Bar with selection
Screenshot macOS 10 v0.3.0 Screenshot macOS 10 v0.3.0-selection
Status Bar alignment
Screenshot of alignment

Known issues

  • fman raises ValueError on the first Toggle hidden files if a pane is launched with hidden files hidden (and status bar is not updated this one time) (tip: you might be able to conveniently close the error warning window with the same keybind you toggled hidden files with)
  • Status bar is NOT updated when switching panes with a mouse since plugins can't notice a pane switch due to a lack of the necessary APIs
  • Alignment of indicators only works for monospaced (fixed-width) fonts since it's currently implemented using regular spaces (tip: you can change this font in your Theme.css file .statusbar{font-family:"yourMonospacedFont"}). And even then fancy icons/emojis might slightly break it
  • On launch the right pane is ignored in the status bar udpate to improve performance since fman always activates the left one (and doesn't have an API to let a plugin know which pane is the active one)

statusbarextended's People

Contributors

boushley avatar eugenesvk avatar kek91 avatar mherrmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

statusbarextended's Issues

Progress bar for IO operations

Needs to extend functionality of fileoperations.py in Core plugin.

class CopyFiles(FileTreeOperation)
class MoveFiles(FileTreeOperation)

Formatting suggestions

Just FYI I've made a few edits to the format of the toolbar in a fork. If you like them, would be happy to send a PR
(for some reason selection stopped working even with a clean install of your plugin, so can't provide a screenshot of the new format)
fman-plugin-statusbarextendedf

Below is a brief description of the changes

  • Shorter size indicators with lower-case for (kilo)bytes: b, k, M, G, T. Kibibyte (2^10) format is preserved
  • Change status icon of hidden files toggle to ◻white (hidden files shown) and ◼black (hidden files hidden) Unicode square symbols
  • Align all indicator position to keep it the same regardless of the length of the indicator (file/folder count is consistent up to 9,999)
  • Remove empty folder/file numbers indicators (including labels) Toolbar only screenshot with a custom theme v0.1.1f
  • Add thousands separator (,) to file/folder numbers (e.g. Files: 1,000)
  • Change status of selected items to be consistent with the regular view for faster read

Exception raised when reading filesize on file with no access

DirectoryPaneListener 'StatusBarExtended' raised error.

Traceback (most recent call last):
File "\StatusBarExtended\statusbarextended_init_.py", line 79, in on_path_changed
ShowStatusBarExtended.refresh(self)
File "\StatusBarExtended\statusbarextended_init_.py", line 42, in refresh
dir_filesize += stat(f).st_size
PermissionError: [WinError 5] Access is denied: 'F:\/hiberfil.sys'

Possible solution: Implement a try/catch block to ignore the file if access is denied

Performance problem refreshing both panes

StatusBarExtended currently computes fileinfo for both panes, even if you only change working directory on one of the panes. This can be particularly annoying if viewing a large directory in one pane while using the other for smaller directories, because the large directory will compute size on every directory change and ultimately slow down fman.

Squigly brackets in filename cause an error

When having a file with a squigly bracket in the filename "{" or "}", an error is raised:

DirectoryPaneListener 'StatusBarExtended' raised error.

Traceback (most recent call last):
  File "fman\impl\plugins\plugin.py", line 311, in _notify_listener_in_thread
  File "C:\Users\ahayun\AppData\Roaming\fman\Plugins\Third-party\StatusBarExtended\statusbarextended\__init__.py", line 144, in on_path_changed
    StatusBarExtended.refresh(self)
  File "C:\Users\ahayun\AppData\Roaming\fman\Plugins\Third-party\StatusBarExtended\statusbarextended\__init__.py", line 33, in refresh
    dir_files_in_dir      = glob.glob(current_dir + "/*")
  File "glob.py", line 20, in glob
  File "glob.py", line 71, in _iglob
  File "glob.py", line 72, in _iglob
  File "glob.py", line 83, in _glob1
  File "fnmatch.py", line 52, in filter
  File "fnmatch.py", line 46, in _compile_pattern
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 233, in compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 301, in _compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_compile.py", line 562, in compile
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 855, in parse
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 416, in _parse_sub
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 765, in _parse
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 416, in _parse_sub
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 553, in _parse
sre_constants.error: bad character range 2-0 at position 20

IndexError when opening fman if left pane is currently on show drives

If you quit fman while the left pane is showing drives (Alt+F1), you will get the following error next time you open fman:

DirectoryPaneListener 'StatusBarExtended' raised error.

Traceback (most recent call last):
  File "...\statusbarextended\__init__.py", line 88, in on_path_changed
    StatusBarExtended.refresh(self)
  File "...\statusbarextended\__init__.py", line 21, in refresh
    pane2 = panes[1].id
IndexError: list index out of range

It doesn't happen when showing drives on the right pane.

Unable to resize when plugin enabled

When trying to resize the fman window size I'm only able to make it wider but not smaller then the bars default size. And if I disable the plugin and resize the window and then enable the plugin again it resizes the whole window again to the bars default size.

I have uploaded a youtube example window showing this error
https://youtu.be/Dxa1CC3koWc

Updating upon toggling

This plugin doesn't show anything when you toggle. You have to toggle, move directories and then it starts to show. I would rather it display something when turned on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.