Skip to main content
Topic: Utilities shell script (Read 10089 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Re: Utilities shell script

Reply #31
i ended up with a lot more ideas than anticipated :)

V8:

-Added scrollback in terminal mode! No more limitations on array length, and looks way better on longer menus.
-Added Kernel tools (info about kernels and modules, GRUB and DKMS config updater, kernel module manager load/unload/add to startup)
-Added cdrom /dev/sr0 support in Mount tools (i started using optical media again after 10 years :) )
-Added a fix filesystem option in Mount tools for ext4/xfs (with this occasion now calling it Mount and filesystem tools)
-Added an option to set TearFree in X
-Added mprime and unixbench in diagnostics/benchmark
-Added device name to ALSA devices menu
-tidied up the boot commands, if you use them please review, some hacky ones were removed
-minor cosmetic fix: some redundant case items were removed and some potential path issues in root mode were fixed
-minor cosmetic fix: autodetermine runlevels in OpenRC startup options
-minor cosmetic fix: in menus list, a better check if a space is empty

Re: Utilities shell script

Reply #32
V8.0.5:

-Added an option to disable the scrollback in terminal mode (i only did my testing in Alacritty which is gpu accelerated, when i tested later on a slower pc with normal terminal it got a bit laggy when there was lots of text)
-Disabled text wrapping when scrollback is enabled to avoid overflowing lines
-Got rid of the subshell in dynamic menus (in zsh the other elements can be quoted and moved inside the array, in posix-y bash the createarray function can be fed directly). This improves the script's aspect further and is probably a small performance benefit
-More redundancies cleaned up in the selector arguments function
-More small issues fixed in zsh version (recommended update if you use it)
-Updated readme

Re: Utilities shell script

Reply #33
V8.1:

This version is focused on solving some left over UX hiccups

- no more need to restart the script when changing preferred terminal emulator
- in the submenu of Mount tools only the relevant and/or supported options appear + drive info was added + doesn't longer hang after opening file manager
- downloaders are (mostly) ported to terminal mode + the target download directory has now free space indicated next to it
- in the main menu, the remaining options that require gui or display (-wine, -xvnc/tf/disp) are now hidden in terminal mode to avoid confusion
- help text now shows in the non root mode too on invalid argument
- display timeout option, show the current setting in the main menu
- terminal, renamed the text for some options where it said "click ..." in both modes, or when it was missing the space before inputting the value
- archiving tools no longer exits the entire script + checks valid directory + fixed some hiccups
- if 2 or more consecutive fields are empty in the terminal option selector, skip to a valid option as expected
- more small optimizations in regards to some recent changes (autorefreshing in terminal) and for uniformization of certain workarounds

enjoy  :)

Re: Utilities shell script

Reply #34
Good evening!

V9:

- "System - Cleanup" was moved into a new Maintenance menu which has added defrag (for ext4/xfs) and fstrim commands
- Kernel tools - added an option to view and set kernel parameters
- The option for vncserver will ask to create the passwd file if it doesn't exist, making it always available
- The option to set TearFree in X11 now toggles between on and off
- Implemented searching in terminal menus! Press the Insert key, enter a query and it will skip to the first matching option
- Allow pressing any key to continue in terminal sleep mode, like in the old versions but this time working fully
- Fixes in some status/warning messages and clarified some comments
- ZSH - removed most of the unneeded double quotes since the shell doesn't word split, more native feature use coming


screenshot-7dc00e1c.jpg

To do:
Fix some ugly text problem in Kernel tools status when having multiple kernels
Improve Dinit startup manager to not be confusing to use


Re: Utilities shell script

Reply #35
V10:

-fixed the above noted issues, plus:
-IPSets and Hosts: added Nftables support! Very big for futureproofing and much better filtering of ip classes than legacy iptables
-IPSets and Hosts: keep existing rules in the /etc/hosts file
-Pacman commands: added bulk install/uninstall from a text file, useful on a fresh system
-Pacman commands: added an option to refresh keys
-Disk space analyzer: added options to find temporary and large files, and the chmod command will now run as root if it fails
-improved some functions
-fixed "grep: warning: stray \ before white space" in new versions of grep


A screenshot with recent features:

(LE: now i see most of the earlier screenshots are missing, damn image hosting sites, if i knew the forum can attach files :) )


Re: Utilities shell script

Reply #36
V12:

Update is recommended if on a recent system base

- Extended the summary in the main menu with cpu average, network route/number of connections, and free space/cpu warnings (all under 10ms extra processing time);
- System cleanup: added more paths (incl. for new mozilla versions) and improved the existing ones;
- amdgpu utility: some fixes, toggle for every pstate, power profiles and preliminary navi support;
- Btrfs support added on volume repair and defrag (V11);
- Pacman commands: added database manager and cleaned up naming and menus (V11);
- Nftables backend for ipsets&hosts now properly filters ipv6 addresses (V11);
- The script now logs the error output for every menu to /tmp/utilities.log;
- Worked around some new possible exceptions in some programs, concerning ps/pgrep (where it hangs because of glibc, simple timeout added in front), watch (where it doesn't see amount of columns, replaced with while loop), cp (it started to demand more explicit paths);
- Kernel tools: make the command to get available kernels simpler and more robust, to fix a potential cosmetic bug;
- Extended the summary in sensors view with cpu/ram totals;
- Improved terminal, kernel module and package searching with case insensitive and simpler regex support (for kernel module searching i removed the regex in favour of native globbing in find, simpler to use and faster);
- Parralelize a few more commands, terminal navigation should be even faster;
- A number of small cleanups and improvements across menus;
- Regression: terminal searching will be only available in the zsh version, due to a change in variable behavior of bash shell that broke it a few weeks ago. (A fix would be to to implement associative arrays, but this would limit gui support to kdialog only and make menus more complex)

Re: Utilities shell script

Reply #37
New minor release and Zsh ver. is on latest revision, enjoy!

Todo in the future when free time will allow me:

-Simple Nftables firewall (separate from ipsets&hosts) with important features like opening ports or certain packet types, changing a route, blocking traffic from an interface or allowing/blocking a custom address
-FFmpeg media converter, possibly also including mpv for it's shaders processing (drifting a bit away from my original idea of just system utilities, will release that as a standalone script too)
-Wait until the ps/pgrep and watch bugs are solved to remove the workarounds i've put in place

Re: Utilities shell script

Reply #38
Best wishes for the new year, I've polished up and finished testing on V13:

- Firewall manager (nftables and xtables-untested). For now the commands are: open a port tcp/udp, blacklist/whitelist connections to an IPv4/6 address, and (nftables only) kill switch, exporting config, clearing config.
- Custom nftables chain names are also used for ipsets&hosts now, to avoid conflicts with any external rule that might be translated from xtables, and for -fw to take precedence.
- Switched to full RGB color mode for the terminal title bar and selection text (all compatibility is retained incl. in plain tty). Also added some more text formatting to create more of an elegant and easy to read theme.
- Extended KDialog support with file choosing/saving, text input
- Improved the appearance of service listings by putting status at the front
- More grep improvements, including in dinit service listing (new grep didn't like escaped '}' very much), in the command to check for executable attr. and in some unnecessary usage of 'grep -P'.
- Downloaders - disable preallocation in aria2, something that it recently made default.
- Logging system improvements, including simplifying it to just 1 redirection, quieting down some typical log spam, fixed the regression in zsh ver.  and fixed a potential issue in root mode.
- Fixed cosmetic bugs when selecting on some header messages or warnings
- Delete the exclude file if it's empty (-arc), and delete the fio benchmark file once finished (-diags)
- Addressed the watch workaround. The timeout workaround I've decided to leave permanent since I was already using it for the root detection, has a few ms of overhead but improves reliability. With this occasion I've added it in a few more places too.
- Big optimizations in -iomons by using customized ps command instead of top
- Added cumulated disk i/o in -iomons, useful in case there is no root access for iotop
- Other numerous small fixes, cleanups and optimizations

Re: Utilities shell script

Reply #39
With V13.5, I have reworked the code of the service manager and Wine version manager, simplifying them by a lot, reducing the size with up to 50%. Almost nothing changes for the end user, apart from improvements listed below:

- Service manager:
* a more tidy header text that also shows number of services hidden, with a menu to display them;
* detailed information directly in the front menu;
* adding multiple runlevels in OpenRC startup services;
* more robust detection of Dinit startup services (actually follows the dependency cycle of 'boot' now);
* formal removal of suite66 support
- Wine manager:
* setting wine prefix for all the options actually works since they'll use the detection mechanism now
* easier to read description

- Kernel manager: Grub installation will work in more cases now
- Added power limit setting in the AMDGPU menu
- Created a safety system for the loop menus and improved error code handling in some of them Spoiler (click to show/hide)
- Simplified the logging system further, it now splits the log file when the script runs as root; this fixes the remaining access issues for good.
- Other minor cosmetic adjustments and fixes in some menus, and some more small optimizations

Re: Utilities shell script

Reply #40
Arrived to some interesting recent developments per some personal needs or to fix left over annoyances. Update is recommended if you use some of the functions below:

As always, enjoy!

V14.5:
- Terminal: searching is back in all versions;
- Followed some more shellcheck recommendations and enabled basic compatibility in busybox distros, without affecting or complicating existing code;
- reworked the package mgr. menus, adding support for Alpine, an audit option, and extended searching for both installed and available pkg's;
- Some completions and fixes in Firewall mgr., Kernel mgr., amdgpu menu, -mnt, -wpstreams and a few others;
- Hardening and reliability tweaks in IPSets&Hosts, comprehensive regex now used to process ip's, simpler mechanism to process hosts, custom_hosts file support added (like custom_ips but in full format rather than raw).
- Improvements around many variables, redundancies and strings across the script. The overall look is further improved to increase readability;

V14:
- Added X11 tools menu, moving previous options from the main menu (timeout, vnc server, tearfree, etc), and adding 'Set display resolution', choosing from the available xrandr modes. The main menu is more tidy now; some options have been reordered with this occasion.
- Added Wireplumber stream stats/volume control, supporting PW, Pulse and JACK streams.
- Wine manager: DXVK will get manually placed/registered as their script is not longer included in their archives (it has been removed starting v2.1); there will be no backup support but everything else works fine, tested extensively in my prefixes.
Support for adding variables was also removed since recent Wine isolates parts of the environment; for now I manually added some of the variables that I use in the script, they should not affect stability/compatibility for general usage.
- IPSets & Hosts - A custom list of IP's to block (raw format) can now be added in the "custom_ips" file next placed to the script. On first usage the script will set immutable attribute, to modify the file later run "chattr -i custom_ips". The fetch functions were simplified with this occasion, with some improvements in sorting, filtering and restoring also.
- Service manager: most services that were hidden will now show up again in the front menu as "[Running - only restartable]". A few small robustness changes and optimizations were also done in a few functions.
- Downloaders - Small refactors in stream downloader and in "[wget] Download files listed on a website" - will work in more cases now, and the result will be cleaner;
- Disk space analyzer - A few optimizations, safety improvements and some more utilities added under Deletion options;
- More typical log spam quieted down;
- Added support for left arrow to go back/cancel in the terminal mode, kind of like how closing does in the gui mode.
- For now removed kdialog slider support as it was causing issues;
- Minor fixes (mainly zsh), a few cleanups and completions (mainly subfunctions, documentation, some displays).

UX improvements as of previous version:
Spoiler (click to show/hide)

Re: Utilities shell script

Reply #41
After some testing I'm delighted to present V15:

- Terminal mode:
 *An elegant ticker-like info bar with system info will show in autorefreshing menus;
 *Refactored drawing with further usage of ANSI escape sequences - eliminating any flickering, improving padding at any tty size, further increasing performance when navigating and more! The section is now entirely documented;
- Added a menu to execute custom quick commands, they can be added one per line in custom_commands file, placed like usual next to the script :-);
- KDialog directory and slider are added again, they have been fixed with the recent kde updates;
- Added host/connect iperf under Benchmarks;
- Further small improvements and consolidations under Maintenance - Cleanup and IPSets&Hosts;
- Added support for two more common terminal emulators;
- Improve shortcut checking and listing in some DE's;
- More misc. compatibility improvements;
- A few other touch ups in some strings + as of last few versions, removed practically every redundancy in the ZSH version.

* Note: 'excluded' file when creating tar backups is now called '.excluded', please rename if used.


Re: Utilities shell script

Reply #42
Text disappears on urxvt (tabbed)
Dinit init




Re: Utilities shell script

Reply #43
Can confirm, urxvt doesn't like something in the clearing of rows. Strangely other standard vt's like xterm and fbdev are fine.

I can probably address it, was working on and off on a new version this past month so hoping to finish it soon.

PS. Found a workaround for now:
line 1200, replace
Code: [Select]
echo -e '\e[1K\e[H\e[1;3J
with
Code: [Select]
echo -e '\e[1K\e[H\e[J
This removes the flicker-free partial cleanup for a full one, equivalent to the clear command. It can potentially be the fault of urxvt, not completely sure atm.

Re: Utilities shell script

Reply #44
V16-pre:

A beta for the next major version of my beloved swiss army knife :). It has a lot of fixes and new stuff but also a few known issues where some testing will be needed, so if you want to wait for the final one, along with ZSH, they will be complete by sometime next month.

As a second "milestone" from V7,  the script is now feature complete for basic remote work!
Enjoy!

- Revision of the argument systems:
*There are now 3 argument categories: args_all(new, runs both as root and user), args_rootonly, args_useronly. writeconf will run more smartly thanks in part to this;
*The main menu will now show up when running as root (terminal mode only), adding new options to specify the normal user and launch the script/add sudoers rule for it;
*Added an option to disable GUI;
*The terminal emulator will attempt to run as root in some cases when option is launched outside of a terminal and under root. Disabling GUI also turns this off. X11 only;

- Added a file manager! (terminal mode only, meant for usage over ssh). It is used internally for file/folder selection, and standalone to browse, edit, rename or delete files.

- Added CPU freq. and bat.% to term. footer;

- Added a menu to change CPU min/max and governor (in it was also merged my legacy zenstates thing to clean up a bit);

- Added user, host(if connected over ssh) and weekday/time to term. titlebar;

- Better separator size determiner, done for the GUI mode but also looks better in terminal mode;


-More completions in:
*Disk space analyzer - has been rebased off the file manager "API" so was made aswell terminal only to use the hotkeys F3/F4/Del, also extended finding large+temp files with more depth ability;
*Improved main menu option in submenus. F2 hotkey also added as override from anywhere, useful from root. F1 now shows help+stats+debug anywhere;
*Logging system - added ability to write info messages, duplicates are prevented;
*runfromroot - more ways to determine xauthority;
*help text - also print summary info and debug of all variables;
*completed a bit more the busybox checking (gnu awk/sed, ps/pgrep) to reduce more potential annoyances;
*-swp - also drop caches when clearing /tmp;
*package mgr. - the two sections are clearly defined and some bugs were fixed;
*-wpstreams - partly redid the processing of wpctl output to be less confusing;
*-fw - added port limit options and a safety feature for the nftables kill switch;

-Revised:
*better method of obtaining normal user in root mode, script can run with none e.g. just root.
*footer now shows always, when not autorefreshing it will show some static os release summary;
*Archiving and backup tools - adding homedir backup shortcuts, safety system for extracting and some fixes;
*method of obtaining partitions/drives - no more false positives and faster;
*faster method of obtaining init;
*shortcut replacement is more resilient;
*disk i/o under -iomons does both read and write now, can ctrl+c out of -iomons without exiting.
*system cleanup and -swp(when clearing /tmp): keep the *auth* files from /tmp, workaround for recent change which breaks DE's.
*disabling scrollback in terminal also disables flicker-free refresh, workaround for *rxvt. @purpleleaf
*many more I probably overlooked, mostly layout related.