GithubHelp home page GithubHelp logo

hellosystem / utilities Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 29.0 3.33 MB

Utilities written in PyQt5, meant for use with helloSystem

License: BSD 2-Clause "Simplified" License

Python 98.10% Shell 1.12% QML 0.78%
zeroconf bonjour freebsd pyqt5 hellosystem

utilities's People

Contributors

alphamodh0 avatar aurelienmaury avatar bitigchi avatar bittin avatar cneira avatar comradekingu avatar davidliang11292 avatar hugok79 avatar ijiki16 avatar kettle-7 avatar larshenrikoern avatar lisapple avatar louies0623 avatar mazsibazsi avatar mbnunes avatar merkex avatar oscarholst avatar probonopd avatar satoq9 avatar sburris0 avatar szowisz avatar taniokaeiji avatar taraspanchenko avatar theloicoffrance avatar trivoxel avatar vitorhcl avatar weblate avatar xaoseric avatar xoascf avatar yarons avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

utilities's Issues

Sharing.app: Warn if no password is set

Sharing.app: Warn if no password is set and ssh is about to be enabled.
Because when no ssh password is set (as is on the Live system), then trying to log in fails.

Consider adding a Hardware Probe utility

We should consider adding a Hardware Probe utility that could optionally upload data to https://bsd-hardware.info/.

https://abf.rosalinux.ru/import/hw-probe-gui/blob/d010f11a86fc880a18dd2e12d2b5c79453cf92e7/dialog.sh is doing:

hw-probe -all -upload -clean -id "${i[*]}" > $tmpdir/probe 2>&1

if [ -f $tmpdir/probe ]
then
    public_url=$(grep -o https:.*probe=.* $tmpdir/probe | grep -v 'token=')
    probe_is_done="$probe_is_done<br/><br/><b>$probe_view:</b> <a href='$public_url'>$public_url</a><br/>"
    
    if grep -q "Uploaded" $tmpdir/probe
    then
        kdialog --passivepopup "$probe_is_done" 15
        echo "$probe_is_done">$tmpdir/report
    else
        kdialog --passivepopup "$probe_is_failed" 15
        echo "$probe_is_failed">$tmpdir/report
    fi
    kdialog --title "$title" --textbox $tmpdir/report 630 200
fi

I do have some privacy concerns though.

  • Is the exact combination of devices really needed ? This basically fingerprints machines as a globally unique configuration, which is less than desirable from a privacy point of view. For example, I would be more than happy to upload information regarding each of my devices individually, but not in combination
  • Is there a way to review everything that gets uploaded before it gets uploaded?
  • How are Mac addresses, serial numbers, UUIDs, etc. treated?

cc @linuxhw

Welcome.app: Offer to migrate /home over SSH or from disk

Welcome.app: Offer to migrate /home over SSH (using Zeroconf, using existing code from Zeroconf.app as a starting point) or from a locally attached disk.

So that users going from one helloSystem installation to another can easily take /home with them.

Possibly need to move away all directories that are in skel, and re-apply skel so that the migrated system gets the current helloSystem defaults applied.

Backup utility

image

We need a Backup utility that can make backups to local media, the local area network, and to Cloud providers. Probably the initial focus should be on Cloud Backup.

Cloud Backup

Requirements

  • All data including all metadata needs to be encrypted so that the cloud provider cannot peek into the data
  • GUI should offer an option to shut down the machine after the upload

Possible underlying tools

  • zfs send/receive (native to zfs but also dependent on it, hence not really cross-platform; mature?)
  • restic (optimized for speed, Golang, cross-platform, not zfs dependent; not 1.0 yet. How risky is purging data that is no longer needed on the server?)

Possible cloud service providers

Consider supporting bsdstats.org in the Hardware Probe tool

Unlike https://bsd-hardware.info/?d=helloSystem which is about details of hardware components, https://bsdstats.org/ seems to be about ongoing measurement of BSD variant popularity. It requires a cron job to be installed and enabled. We could add a checkbox to this effect in the Hardware Probe tool...

[ ] Submit monthly anonymous monthly statistics to https://bsdstats.org/

https://bsdstats.org/bt/instructions.html

What do people think?

cc @scrappy

Progress bar is jumpy when downloading Developer applications

Progress bar is jumpy when downloading Developer applications

This is because we add + 1 to the progress whenever we see a . in the output of pkg.

self.progress.setValue(self.progress.value() + 1) # Give some indication that something is still going on, even though this is not precise

We should find a more accurate way for pkg to tell us the progress, especially during the download phase. Is there a way to make it print out the bytes downloaded every second or so? This would help a lot.

zsync tool/utility

Need a zsync tool/utility that can download the incremental update vs the already-downloaded ISO.

zsync allows you to download a file from a remote server, but by comparing with a local file it will only retrieve the newer parts, thereby minimizing the volume of your download.

This will hopefully speed up downloading coninuous builds significantly.

The zsync in FreeBSD cannot handle https and/or redirects properly, but my fork does, by utilizing libcurl: https://github.com/probonopd/zsync-curl/

Also see:
probonopd/zsync-curl#38

Improve Logs utility

  • Allow to search through all logs
  • Highlight lines that contain the word "error", "fail", "critical", "warn".. in red

Installer should use efibootmgr to set helloSystem as the active entry

Installer should use efibootmgr to set helloSystem as the active entry.

Some firmwares have the tendency to set the entry for Windows active automatically all the time, resulting in the fact that Windows is booted by default right after the installation of helloSystem.

This should be opt-in.

If an application has no more than one non-tabbed window, Meta-W should close the window

Windows for applications such as Boot Environments, Desktop, Keyboard, Mouse, Print Settings, Screen Settings, Sharing, Shortcut Keys and Sound do not close when expected.

(Windows of Wireless Networks could not be tested in a VirtualBox guest.)

Under /Applications/Utilities I found Calculator similarly non responsive to the keyboard shortcut, so I guess that it's a generic issue.

Screencast utility

Add a Screencast utility that does something sensible to get good audio quality, e.g.,

#!/bin/sh

# Sound filters from
# https://dsp.stackexchange.com/questions/22442/ffmpeg-audio-filter-pipeline-for-speech-enhancement

PCM=/dev/$(cat /dev/sndstat | grep rec | tail -n 1 | cut -d ":" -f 1)
DSP=$(echo "${PCM}" | sed -e 's|pcm|dsp|g')
echo $DSP

if [ -e /tmp/screencast.mp4 ] ; then
  pkill -f ffmpeg
  pkill -f screenkey
  notify-send  "Stopped because /tmp/screencast.mp4 exists"
  sleep 1
  xdg-open /tmp/screencast.mp4
else
  screenkey &
#  ffmpeg -y -thread_queue_size 1024 -f oss -i "${DSP}" -framerate 30 -video_size 1920x1080 -f x11grab -i :0 -c:v libx264 -b:v 2000k -maxrate 2000k -bufsize 5000k -g 50 -flags +global_header -vf format=yuv420p  -filter:a "volume=10" -c:a aac -b:a 128k /tmp/screencast.mp4
  ffmpeg -y -thread_queue_size 1024 -f oss -i "${DSP}" -framerate 25 -f x11grab -i :0 -c:v libx264 -b:v 2000k -maxrate 2000k -bufsize 5000k -g 50 -flags +global_header -vf format=yuv420p -vf scale=-1:720 -af highpass-frequency=300 -af lowpass-frequency=4000 -af "bass=frequency=100:gain=-50" -af "bandreject=frequency=200:width_type=h:width=200" -af "compand=attacks=.05:decays=.05:points=-90/-90 -70/-90 -15/-15 0/-10:soft-knee=6:volume=-70:gain=10" -c:a aac -b:a 128k /tmp/screencast.mp4

fi

Zeroconf.app: Handle _scanner._tcp

skanlite seems to recognize

=    em0 IPv4 HP LaserJet 200 colorMFP M276n (...)       _scanner._tcp        local
   hostname = [....local]
   address = [...]
   port = [8289]
   txt = ["note=" "flatbed=T" "feeder=T" "button=T" "mdl=200 colorMFP M276n" "mfg=Hewlett Packard" "ty=HP LaserJet 200 colorMFP M276n" "adminurl=http://....local." "txtvers=1"]

=    em0 IPv4 HP LaserJet 200 colorMFP M276n (...)       _ipp._tcp            local
   hostname = [....local]
   address = [192.168.0.30]
   port = [631]
   txt = ["mac=..." "usb_MDL=HP LaserJet 200 colorMFP M276n" "usb_MFG=Hewlett-Packard" "UUID=..." "Fax=T" "Scan=T" "Duplex=F" "Color=T" "note=" "adminurl=http://....local." "priority=10" "product=(HP LaserJet 200 colorMFP M276n)" "ty=HP LaserJet 200 colorMFP M276n" "URF=V1.1,CP99,W8,OB10,PQ3-4-5,ADOBERGB24,DEVRGB24,DEVW8,SRGB24,IS1-4,MT1-2-3-5-12,RS600" "rp=ipp/print" "pdl=application/postscript,application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/pdf,image/urf" "qtotal=1" "txtvers=1"]

but then ends with

image

xsane gives:

image

Semi-related discussion:
helloSystem/ISO#58

Wired network management

Spun off from helloSystem/Menu#23 (comment)

Need a GUI for when:

  • network connection with DHCP is not automated
  • static addressing is required.

Example (DHCP)

  1. Start the system offline
  2. make a wired connection to a DHCP network

– there's no interface to the connection.

Need to create the interface, and so on.

Reference

Thoughts

I shouldn't recommend writing an app from scratch (thin end of a wedge).

Instead, seek an existing app. Ideally one that can integrate with the global menu, although I don't view https://github.com/helloSystem/Menu as a strict requirement; an app amongst utilities should suffice.

Sharing: Publish SANE scanners via AirScan

Publish SANE scanners to MacOS and Android via Apple AirScan (also known as eSCL).

A SANE WebScan frontend that supports Apple's AirScan protocol. Scanners are detected automatically, and published through mDNS. Though images may be acquired and transferred in JPEG, PNG, and PDF/raster format through a simple web interface, AirSane's intended purpose is to be used with AirScan/eSCL clients such as Apple's Image Capture.

https://github.com/SimulPiscator/AirSane

System Update utility

Write a System Update utility that installs the update into a new Boot Environment.

Along the lines of

 pkg upgrade --fetch-only -y
 beadm list
 beadm create c572e
 beadm mount c572e /media/c572e
 chroot /media/c572e
  pkg upgrade -y
  pkg upgrade -r FreeBSD -y
  exit
 beadm list
 beadm umount c572e

Thanks @grahamperrin

We could then make the next boot go into the new Boot Environment, and ask the user there whether all subsequent boots should continue to go there. Or something like that.

Dock: Use procstat on FreeBSD to get the arguments for a given process ID

Dock needs to find the icon for a given process ID.

We should use the procstat command on FreeBSD to get the arguments for a given process ID because proc is not mounted by default and is considered deprecated.

# Get the absolute path to the binary (first argument)
FreeBSD% procstat --libxo=json binary 92274   
{"__version": "1", "procstat": {"binary": {"92274": {"process_id":92274,"command":"dunst","osrel":1201000,"pathname":"/usr/local/bin/dunst"}}}
}

# Get the other arguments; note that the first argument is a relative path here (but not above)
FreeBSD% procstat --libxo=json arguments 92274
{"__version": "1", "procstat": {"arguments": {"92274": {"process_id":92274,"command":"dunst", "arguments": ["dunst"]}}}
}

# Note that in some (which?) cases we get the full absolute path in arguments...
FreeBSD% procstat --libxo=json arguments 59215
{"__version": "1", "procstat": {"arguments": {"59215": {"process_id":59215,"command":"falkon", "arguments": ["/usr/local/bin/falkon"]}}}
}

GPLv3 licensing of elementary icons

Hey there,

Have been following helloSystem since it showed up on Lobste.rs a few months ago and happy to see it coming along. :)

Something I noticed in the new website and double-checked here, it seems like you're using some of the elementary icons without the license attached. I'm not sure how many there are, but the "big" one seems to be:

I ran this by the elementary folks on their Slack and as more of an FYI, these icons are under the GPLv3 license which is available here and should be reproduced with usage of the icons.

If you have any questions cc @danrabbit

Thanks!

Installer: Remove the need for xterm

The following executes an external process and displays its output in a Qt widget.

#!/usr/bin/env python3.7

# Based on https://stackoverflow.com/a/41751956

import sys

from PyQt5.QtCore import pyqtSignal, pyqtSlot, QProcess, QTextCodec
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import QApplication, QPlainTextEdit


class ProcessOutputReader(QProcess):
    produce_output = pyqtSignal(str)

    def __init__(self, parent=None):
        super().__init__(parent=parent)
        self.setProcessChannelMode(QProcess.MergedChannels)
        codec = QTextCodec.codecForLocale()
        self._decoder_stdout = codec.makeDecoder()
        self.readyReadStandardOutput.connect(self._ready_read_standard_output)


    @pyqtSlot()
    def _ready_read_standard_output(self):
        raw_bytes = self.readAllStandardOutput()
        text = self._decoder_stdout.toUnicode(raw_bytes)
        self.produce_output.emit(text)

class MyConsole(QPlainTextEdit):

    def __init__(self, parent=None):
        super().__init__(parent=parent)

        self.setReadOnly(True)
        self.setMaximumBlockCount(10000)  # limit console to 10000 lines

        self._cursor_output = self.textCursor()

    @pyqtSlot(str)
    def append_output(self, text):
        self._cursor_output.insertText(text)
        self.scroll_to_last_line()

    def scroll_to_last_line(self):
        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.End)
        cursor.movePosition(QTextCursor.Up if cursor.atBlockStart() else
                            QTextCursor.StartOfLine)
        self.setTextCursor(cursor)


app = QApplication(sys.argv)

reader = ProcessOutputReader()
console = MyConsole()
reader.produce_output.connect(console.append_output)
reader.start('ping', ['heise.de'])

console.show()
app.exec_()

Set up localization using Weblate

  • Do we need a separate ts file, and hence a separate Weblate subproject for each of the utilities?
  • How is Hosted Weblate supposed to get its permissions to push something into a GitHub Repository? Doesn't one need to enter a GitHub Token somewhere into the Weblate GUI? (Where is this documented?) --> Need to add the user weblate in https://github.com/helloSystem/Utilities/settings/access and give it Write rights
  • Alternatively, how exactly does one need to set up hosted Weblate so that it creates (and appends to existing) GitHub Pull Requests instead of trying to push?

Pending on

Proposal for brightness control

Hello!

I'm a long-time laptop user and just installed HelloSystem on my secondary laptop and already absolutely love the user-experience.
However, I really needed some finer options for brightness control so I just started making an application for it.
If PR-s for system applications are welcome I'd love to contribute this back when I meet the design goals described below.
Below is my proposal for a brightness control application, currently it's just a draft, any opinion, feedback, design consideration is most welcome!

What do I have currently:
(youtube video)
IMAGE ALT TEXT HERE

A simple PyQt application in a .app format that adds a brightness control slider to the menu bar.
I'd like to extend this further as I have some ideas from a user-experience standpoint.

My design goals:

  • Brightness control should work out of the box on all laptop models that have their corresponding graphic drivers installed.
  • Brightness control should work both via the laptop’s built-in brightness control keys (if any) and a UI (slider?), the two should -never interfere with each other and just work.
  • Brightness should persist between reboots (obviously)
  • Nothing, not even an ACPI event should ever override the preferred brightness levels set by the user (like going into/coming out of sleep, plugging in/out the power chord, etc..).

This always bugged me on everything.
On windows, if I ever plug in my laptop the brightness immediately changes and I have to set it again.
On some Linux distros if I go to sleep the brightness just resets.

Why? What changed that warrants a changed brightness in this case?
Like I know I can use more power but I already set my preferred brightness, don’t ever change it!
If I would want different brightness I will set it because I as the user know what I want and already set it.
It’s just following the philosophy of the system completely getting out of your way and letting you do your stuff.

I guess this is a remainder from yesteryear’s laptops when screen brightness was considered a luxury from a power point of view.
But we are in 2021, now we have laptops with 12-24 hours of battery life, and even on low-end/older models we have at least 6-10 ish, and new batteries for older laptops are very cheap (30-60 $ ish on eBay and repair shops).
I think if a user would still like to use their old laptop it's very likely that they do a battery swap at least one point in the product's lifecycle if they are seriously daily driving it.

It would be awesome to get some second opinion regarding this (brightness never changing on plug/unplug) for design considerations.

The ideal brightness control application:

  • Following the philosophy of HelloSystem, it does one thing only (brightness) but it does it very well.
  • Would be developed as a PyQt application in a HelloSystem .app format with a complete python source, easily extendable, hackable, etc.
  • Shouldn't require root. This is a no-brainer but it gets complicated because of the ACPI stuff.
  • The application starts on startup and places itself on the top menu bar if it detects a controllable brightness on the system.
  • Can communicate with other applications in the system (like for example maybe a brightness control slider in the displays preferences in the future, get/set brightness).

Features I'd love to experiment with if PR-s are welcome, the project gets accepted, and meets its described design goals:

Realtime histogram-based adaptive brightness:
Okay, I know how this might sound at first but hear me out.
Imagine you are home at night, all the lights are off and you are reading some stuff on your laptop from the bed.
Suddenly you open another application/web page with a really bright/white background and your eyes go up in eternal flames.
alt text
I'm sure at least some laptop users can relate, It happened to me too many times :D

I come from the game-dev industry we already worked out a solution for going into really bright places from the dark and dynamic/drastic changes to the lighting.
In fact, since Half-Life 2 almost every AAA game uses it.
It's called Auto-Exposure or sometimes eye-adaptation.
https://docs.unrealengine.com/en-US/RenderingAndGraphics/PostProcessEffects/AutomaticExposure/index.html

You might have even heard of it or have some bad experiences with it.
Yes, it's a hard task, if done wrong it can cripple the user experience drastically.
But when it's done right (for example in some video games) you just don't even notice it.
On the desktop, we don't have real-time 3D objects and lighting but we do have dynamic and rich applications/content that can drastically change the colors displayed on the screen.
Following the thought experiment of John Carmack of Oculus when designing display tech (take manufacturer specs, not as specs but recommendation) we could totally use a system like this for the desktop.

The whole idea of it is that when there's a change in the perceived brightness level our eyes (or in the case of video games the camera) have to adopt.
What if we could do something that our eyes don't have to but the screen's brightness adapts automatically so that the perceived brightness would always be approximately the same?
This could drastically reduce eye-strain for people who spend 10-12 hours near screens and in theory, make a way more natural user experience for the desktop.
Or even a next-gen night mode that doesn't just makes your display yellow but actually doing something.
Maybe even an option where the user doesn't set the exact brightness but the perceived brightness and the backlight adjusts automatically to the set perceived brightness levels.

Enviroment based adaptive brightness:
This is a well-known one.
We already have this on all apple machine, all iPhones, most of our phones and tablets.. etc
Basically, if you go out into sunlight or switch on/off the light indoors, a light sensor automatically detects the change in brightness and the display set's the brightness in a way that you can see the screen and or it's not too bright.
Since on changes to the environmental lighting your eyes have to adapt anyway we could just make it easier for the user and dynamically adapt with the lighting.

The main problem is that we don't really have light sensors in every laptop and even if we had the drivers can be problematic.
But we have the next best thing on like 90% of the laptops.
A web camera.
Yes I know, users really don't like when an application constantly uses their web camera, some even tape it off.
But we don't even have to get a clear picture of the camera, we would totally be fine with a really low-res or even blurry image, all we need it for is to just compute some brightness from a histogram.
I'm not really sure how I would work this out from a user experience standpoint, obviously using the camera all the time is not a good solution but would love to experiment with this too.

Anyway, this was a long one, thanks for reading, and thanks to everyone who worked on this so far! :D
If it's something that would be a great fit for HelloSystem do let me know :)

Use sudo less globally

Right now we invoke sudo when launching some of the utilities. It would be better if we would raise the privileges only when needed.

Is there a way to do this without

  • PolKit, which is considered an unwelcome technology due to its roots in the Gtk/Gnome stack
  • External helper processes, which make everything more complicated than needed

If not, then external helper processes are probably the way to go...

Thin-installed Gtk applications do not use the global menu bar

When launched with launch audacity (then it is using audacity from the $PATH):

image

When launched with launch Audacity (then it is using /Applications/Audio/Audacity.app/Audacity which is our thin-install wrapper Python script):

image

Possibly because GTK_MODULES="appmenu-gtk-module" does not arrive?

Correction in Keyboard layout settings

In the keyboard settings keyboard layout its written 日本人(japanese person) instead of 日本語 (japanese language) please fix it as its language list (keyboard layout) not nationality list.

Hardware Probe utility: Clipboard gets cleared when application exits

Interesting observation by @linuxhw:

After copying of the probe URL to clipboard (by right mouse click), the clipboard is cleared after closing the application and I can't use it (e.g. paste it to the browser).

Workaround: Paste it in the browser while the app is running.

Even better: We should directly open the browser, maybe we need a button rather than a symlink.

Optionally preserve /home when installing

Optionally preserve (= do not touch) /home when it is already existing on a suitable ZFS partitioning scheme.
This would allow for re-installing the OS while keeping user data.

  • Disk partitioning and formatting would need to be skipped.
  • The existing ZFS datasets would need to be re-used.
  • User creation would need to be handled somehow, e.g., by preserving all users with UID >= 1000 from the told to the new system and skipping the user creation dialog.

Replace arandr with something in PyQt

0.4.0 (0D25)

I didn't make a screen recording, but it was (repeatedly) difficult to use drag-and-drop.

drag and drop difficulties

More often than not, I simply could not move a screen from left to right, or vice versa.

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.