You are not logged in.

#1 2024-07-21 14:08:00

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

i did make a system information

i did make a system information tool is made in bash like neofetch but is a mix between neofetch and inixi

https://github.com/stuffbymax/sysi

Offline

#2 2024-07-21 16:17:19

cryptearth
Member
Registered: 2024-02-03
Posts: 1,015

Re: i did make a system information

cons:
- double post https://bbs.archlinux.org/viewtopic.php?id=297921
- relies on YAY
- has dependencies for a simple script
- bloated
- there're better already exist

pros:
wasn't able to find any

Online

#3 2024-07-21 17:00:41

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

cryptearth wrote:

cons:
- double post https://bbs.archlinux.org/viewtopic.php?id=297921
- relies on YAY
- has dependencies for a simple script
- bloated
- there're better already exist

pros:
wasn't able to find any

double post i accidentally posted on wrong subject

does not directly rely on yay

Many of the dependencies mentioned are commonly available on most Linux distributions by default, especially those related to basic system information and text processing. only some tools (like lm-sensors, xrandr, and upower) may not be pre-installed and might need to be
added manually based on your needs and the system environment.

it could be considered "bloated" but those features can be turn off

"I’m open to exploring alternatives. What features or aspects do you think are better in the existing options? Maybe we can discuss how they align with what I’m looking for."

Offline

#4 2024-07-21 17:01:49

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

also is still in development so i need objective feedback

Offline

#5 2024-07-21 20:51:11

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,426
Website

Re: i did make a system information

Mod note: Moving to Community Contributions.

Last edited by WorMzy (2024-07-24 11:11:44)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#6 2024-07-21 21:29:28

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

do you like the software?

Last edited by zdislavo (2024-07-21 21:29:39)

Offline

#7 2024-07-22 17:23:56

cryptearth
Member
Registered: 2024-02-03
Posts: 1,015

Re: i did make a system information

Online

#8 2024-07-23 11:16:05

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,977

Re: i did make a system information

Which may be present on standard endeavouros & manjaro installations but definitely is NOT (and never will be)  on a 'standard' archlinux instalaltion .

Maybe rewrite to use pacman instead of yay ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2024-07-23 13:37:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: i did make a system information

zdislavo, is your main goal in this thread to get feedback on your current project that will help you develop as a programmer, or to get feedback on your script proposed as an alternative to / competitor with those existing options you mentioned?  Since this thread was moved to "Community Contributions" I suspect many people responding are biased towards seeing it as the latter which might result in some harsh critiques.

If instead it's the former, it might be best to give specific criteria you are looking for feedback on.  Is there a certain part of the script you're still unhappy with and trying to figure out?  Or would you like to know how readable it is: does it make sense to others such that they'd be able to edit / maintain it (i.e., is it "good" shareable code)?  Or what aspects of your programming / scripting skills are you most hoping to develop based on feedback on this project?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2024-07-23 14:02:38

cryptearth
Member
Registered: 2024-02-03
Posts: 1,015

Re: i did make a system information

as another objective constructive contribution:
the install script defeats the purpose of a systems package manager
I would recommend build and provide proper packages - this solves several points:
- have the package manager to figure out dependencies and conflicts
- version control
- correct place of system-wide files like configs, libraries and binaries (not every distro places the same type files in the same locations)
- correct and complete removal on uninstalling

Online

#11 2024-07-23 16:54:44

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

cryptearth wrote:

as another objective constructive contribution:
the install script defeats the purpose of a systems package manager
I would recommend build and provide proper packages - this solves several points:
- have the package manager to figure out dependencies and conflicts
- version control
- correct place of system-wide files like configs, libraries and binaries (not every distro places the same type files in the same locations)
- correct and complete removal on uninstalling

can you build it because i cannot do it

Offline

#12 2024-07-23 16:58:00

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

Trilby wrote:

zdislavo, is your main goal in this thread to get feedback on your current project that will help you develop as a programmer, or to get feedback on your script proposed as an alternative to / competitor with those existing options you mentioned?  Since this thread was moved to "Community Contributions" I suspect many people responding are biased towards seeing it as the latter which might result in some harsh critiques.

If instead it's the former, it might be best to give specific criteria you are looking for feedback on.  Is there a certain part of the script you're still unhappy with and trying to figure out?  Or would you like to know how readable it is: does it make sense to others such that they'd be able to edit / maintain it (i.e., is it "good" shareable code)?  Or what aspects of your programming / scripting skills are you most hoping to develop based on feedback on this project?

is kind of 50/50 my goals is get feedback to make better the project better and "superior than alternatives" also i want to improve my scripting skills

Offline

#13 2024-07-23 18:21:51

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: i did make a system information

Why would you wrap a bunch of function calls in a main function and do nothing but calling it? Why are there even functions that get exactly called once, in a function that gets exactly called once? I think you need to read a massive amount of bash scripts to get rid of those - what? - pythonisms and embrace scripting.

Offline

#14 2024-07-23 18:42:44

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

what?

Offline

#15 2024-07-23 18:51:48

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: i did make a system information

You have a main function. You do nothing with it but calling it once. Why do you do this, instead of just executing the content of that function? Is there a reason or do you do it, because you've seen it elsewhere?

Offline

#16 2024-07-23 21:24:24

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

Awebb wrote:

You have a main function. You do nothing with it but calling it once. Why do you do this, instead of just executing the content of that function? Is there a reason or do you do it, because you've seen it elsewhere?

i have many reasons but the main one is i just found it convenient.and allow us to reuse code instead of rewriting it also In order for the program to execute the code that's inside the function also is for Organizational Clarity, Reusability ,Maintenance ,etc

also do you know how to make a PKGBUILD because i don't

Last edited by zdislavo (2024-07-23 21:25:14)

Offline

#17 2024-07-23 22:41:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: i did make a system information

I'm not opposed to a main function, but you have other top-level code outside of functions that runs as the script is loaded - but this content is interspersed (basically hidden) between a bunch of function definitions.  I'd suggest having all the top-level code either all at the start or all at the end of the script.  Perhaps you could split it and have some at the beginning and some at the end, if the bit at the beginning is setting configuration-type variables.

As for a PKGBUILD, there's a wiki page for that.  Please read it - then feel free to ask if you run into specific challenges.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#18 2024-07-23 22:54:00

cryptearth
Member
Registered: 2024-02-03
Posts: 1,015

Re: i did make a system information

zdislavo wrote:

also do you know how to make a PKGBUILD because i don't

https://wiki.archlinux.org/title/PKGBUILD
sorry not sorry for shouting this out loud - but if you not able to use your prefered search engine to find the archwiki and use its search function to find the pkgbuild page - you shouldn't try to convince others to run your code which copies some arbitrary script into some system-wide location for which another install script requires elevated permissions - or how I often call this: "If you don't know how to USE that black-magic box we call a computer - you better not try to TELL that thing WHAT to do!" - as you obviously lack one of the most basic skills: use a search engine to find answers to already asked questions

to get you a more wider story of it: for quite some time every once in a while I look at the beginners section of the coderanch java forums - and I read the same questions over and over and over again - most of them are explained in pretty much any beginners book since I first learned java about 20 years ago - and the internet grew A LOT since
if you are not able to utilize available information and leverage the power of the internet and its mighty search engines - you're far from the required skills to even think about starting coding as you better should first read A LOT and learn about what a computer is, how it works and why it does what a programmer tells to do - and you should learn to use search engines and search functions in forums you find to search for existing questions - READ THEM! - try to understand them and compare them if they and thier answers match your question and try what's given 10 years ago - as most of it is still valid
if all you got so far is to use the big G just to find a forum to place your question - you're doomed to fail - and in the not so far future I can guarantee you from personal experience you will come up with some code that will either kill your own system or those of others who blindly trust your code and run it

why I'm so sure?
well - look no further than valve and thier bad implementation of steam for linux: at some point there was a fatal flaw which ended up in the famous "rm -rf /" and destroyed many systems of many people - and as we all practice bad habits out of convenience instead of having proper backups offline not connected to the running system this simple mistake also wiped a lot of "backups" and lost many people so many personal data and memories: https://www.theregister.com/2015/01/17/ … linux_pcs/
THAT is the real risk of putting strangers systems in danger ...

Online

#19 2024-07-23 23:24:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: i did make a system information

That's what I was getting at with my question of the goal of this thread.  While harsh to the point of certainly being missed by the target audience, I can't disagree with the point of cryptearth's thread.  Zdislavo, if you think you have something that is worthy of distributing and running on other people's machines, I'm sorry to say you are mistaken and this community will keep emphasizing that point.  However, if this is a learning project to help you grow as a programmer, then I'd hope we'd all offer nothing but support an encouragement.

As a learning project for someone getting started in programming, there is a lot in this script that is worthy of praise and encouragement.  But as finished product, it really falls short.  And I think this thread could have taken a very different direction if this was not sent to "Community Contributions".  Perhaps we need another sub-forum, "Kiddy Pool" (though that would probably seem patronizing) - though arguably, this could be the purpose of the "Programming and Scripting" sub-forum.

In any case, if you want to learn and focus on that goal, I suspect you'll gain a lot from these forums.  But if you continue to present this as a viable competitor to other tools, I anticipate that it will just keep getting crapped on as above - and such exchanges are not useful and arguably not welcome on the forums.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#20 2024-07-23 23:46:39

seth
Member
Registered: 2012-09-03
Posts: 59,042

Re: i did make a system information

1. you're assuming locales in the output of processes
2. you're (at times) assuming the presence of anything (package manager binary) as indicator for the system, https://archlinux.org/packages/extra/x86_64/dpkg/
3. indentions, comments etc. are all over the place
4. you're single-quoting variables
5. you're assigning variables through subshell calls, multiple times for the same source, one variable at a time. "man read"
6. you're assuming gnome in your  theme stuff
7. There's a distinct 'center_text "$(color_text ' pattern that gets used A LOT - you can tidy that
8. massive cat abuse

Offline

#21 2024-07-24 01:25:26

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

cryptearth wrote:
zdislavo wrote:

also do you know how to make a PKGBUILD because i don't

https://wiki.archlinux.org/title/PKGBUILD
sorry not sorry for shouting this out loud - but if you not able to use your prefered search engine to find the archwiki and use its search function to find the pkgbuild page - you shouldn't try to convince others to run your code which copies some arbitrary script into some system-wide location for which another install script requires elevated permissions - or how I often call this: "If you don't know how to USE that black-magic box we call a computer - you better not try to TELL that thing WHAT to do!" - as you obviously lack one of the most basic skills: use a search engine to find answers to already asked questions

to get you a more wider story of it: for quite some time every once in a while I look at the beginners section of the coderanch java forums - and I read the same questions over and over and over again - most of them are explained in pretty much any beginners book since I first learned java about 20 years ago - and the internet grew A LOT since
if you are not able to utilize available information and leverage the power of the internet and its mighty search engines - you're far from the required skills to even think about starting coding as you better should first read A LOT and learn about what a computer is, how it works and why it does what a programmer tells to do - and you should learn to use search engines and search functions in forums you find to search for existing questions - READ THEM! - try to understand them and compare them if they and thier answers match your question and try what's given 10 years ago - as most of it is still valid
if all you got so far is to use the big G just to find a forum to place your question - you're doomed to fail - and in the not so far future I can guarantee you from personal experience you will come up with some code that will either kill your own system or those of others who blindly trust your code and run it

why I'm so sure?
well - look no further than valve and thier bad implementation of steam for linux: at some point there was a fatal flaw which ended up in the famous "rm -rf /" and destroyed many systems of many people - and as we all practice bad habits out of convenience instead of having proper backups offline not connected to the running system this simple mistake also wiped a lot of "backups" and lost many people so many personal data and memories: https://www.theregister.com/2015/01/17/ … linux_pcs/
THAT is the real risk of putting strangers systems in danger ...

the problem is my English reading skills are bad and there is not a lot documented in czech language

Offline

#22 2024-07-24 11:12:53

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,426
Website

Re: i did make a system information

Mod note: Moving to Programming and Scripting


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#23 2024-07-26 20:20:45

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

somthing like this

# Maintainer: Your Name <your.email@example.com>
pkgname=sysi
pkgver=1.0
pkgrel=1
pkgdesc="A simple script to display system information"
arch=('any')
url="https://github.com/stuffbymax/sysi"
license=('MIT')
depends=()
source=("$pkgname-$pkgver.tar.gz::https://github.com/stuffbymax/sysi/archive/refs/heads/main.tar.gz")
sha256sums=('SKIP')

package() {
    cd "$srcdir/$pkgname-main"
    install -Dm755 sysi.sh "$pkgdir/usr/bin/sysi"
}

# Optional: If there are additional files like README or LICENSE, you can install them too
install_files() {
    cd "$srcdir/$pkgname-main"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package() {
    cd "$srcdir/$pkgname-main"
    install -Dm755 sysi "$pkgdir/usr/bin/sysi"
    install_files
}

Last edited by zdislavo (2024-07-27 13:49:45)

Offline

#24 2024-07-26 21:59:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: i did make a system information

That's a good start.  But please edit your post to include bbcode tags around the PKGBUILD content.

There's no reason for "install_files" to be a separate function - just put the install commands in the package function: that's where they belong.

Also you seem to have a placeholder for dependencies.  If a variable is truly empty, you should leave it out entirely.  But your script certainly has dependencies; list them.

Then read the makepkg man page or the wiki page to learn how to generate the checksum so you can include that rather than 'SKIP'.

EDIT: bigger than the above: you wrote the PKGBUILD for a versioned release but you're pulling from git head.  Either tag a release or follow the VCS PKGBUILD wiki page to make a sysi-git package.

Last edited by Trilby (2024-07-26 22:01:35)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#25 2024-07-27 14:17:13

zdislavo
Member
From: uk halifax
Registered: 2024-05-13
Posts: 43
Website

Re: i did make a system information

Trilby wrote:

That's a good start.  But please edit your post to include bbcode tags around the PKGBUILD content.

There's no reason for "install_files" to be a separate function - just put the install commands in the package function: that's where they belong.

Also you seem to have a placeholder for dependencies.  If a variable is truly empty, you should leave it out entirely.  But your script certainly has dependencies; list them.

Then read the makepkg man page or the wiki page to learn how to generate the checksum so you can include that rather than 'SKIP'.

EDIT: bigger than the above: you wrote the PKGBUILD for a versioned release but you're pulling from git head.  Either tag a release or follow the VCS PKGBUILD wiki page to make a sysi-git package.


thanks for feed back

non git version

# Maintainer: Your Name <martinp6282@gmail.com>
pkgname=sysi
pkgver=1.0.1
pkgrel=1
pkgdesc="A simple script to display system information"
arch=('any')
url="https://github.com/stuffbymax/sysi"
license=('MIT')
depends=('lm_sensors')
source=("$pkgname-$pkgver.tar.gz::https://github.com/stuffbymax/sysi/archive/refs/tags/1.0.1.tar.gz")
sha256sums=('95932b3b14a8f59449c0897703a2b37e13f056dc94a361ed4d488453dad0c6e1')

package() {
    cd "$srcdir/$pkgname-$pkgver"
    install -Dm755 sysi "$pkgdir/usr/bin/sysi"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

git version example 

 
# Maintainer: Your Name <martinp6282@gmail.com>
pkgname=sysi-git
pkgver=1.0.1.9.ga947e75
pkgrel=1
pkgdesc="A simple script to display system information"
arch=('any')
url="https://github.com/stuffbymax/sysi"
license=('MIT')
depends=('lm_sensors')
makedepends=('git')
source=("git+https://github.com/stuffbymax/sysi.git")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/sysi"
    git describe --long --tags --always | sed 's/^v//;s/-/./g'
}

package() {
    cd "$srcdir/sysi"
    install -Dm755 sysi "$pkgdir/usr/bin/sysi"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Offline

Board footer

Powered by FluxBB