PhoenicisOrg / phoenicis

Phoenicis PlayOnLinux and PlayOnMac 5 repository
https://phoenicis.org/
GNU Lesser General Public License v3.0
680 stars 73 forks source link

Questions about PlayOnLinux #1996

Closed Ahmed-E-86 closed 5 years ago

Ahmed-E-86 commented 5 years ago

I have been learning about programming, so I need to ask some questions if you don't mind.

1- What did you use to build the graphical interface of POL 4?

2- Why did you move from Python to JavaScript?

3- Can Python run Bash or command line scripts that require sudo privileges? And what is the best way to do it?

Kreyren commented 5 years ago

2- Why did you move from Python to JavaScript?

POL moved from python to java. Javascript is beeing used for scripts only, because they are insane and too incompetent to learn rust

3- Can Python run Bash or command line scripts that require sudo privileges? And what is the best way to do it?

This functionality is also used in portage.

Referencing:

$ python3 --version
Python 3.5.2
$ python3
>>> import subprocess
>>> subprocess.run(['echo', 'Hello World'])
Hello World
CompletedProcess(args=['echo', 'Hello World'], returncode=0)

codeblocks relevant to bash in portage: https://github.com/gentoo/portage/search?l=Python&q=bash

Ping original creator - @qparis

Ahmed-E-86 commented 5 years ago

I heard about subprocess before, but I don't know if it can be used with sudo or not.

Thanks for your input @Kreyren

plata commented 5 years ago

@Kreyren stop scaring away people who are interested in Phoenicis with useless comments like

because they are insane and too incompetent to learn rust

I'll say this only once so consider yourself warned. If we we something like this again, we will be forced to take appropriate measures.

plata commented 5 years ago

@ahmed-elsayed2017 I'm sorry. This is not the warm welcome we would like to provide to anybody.

Let me try to answer your questions:

1- What did you use to build the graphical interface of POL 4?

The default graphical interface is built in JavaFX.

2- Why did you move from Python to JavaScript?

Actually we didn't move from Python to JavaScript. In PoL4, the scripts used to be bash. Now they are in Javascript. The software used to be Python and is now Java. I would like to link an article by @qparis regarding that decision but I'm currently unable to find it. @qparis do you have the link?

3- Can Python run Bash or command line scripts that require sudo privileges? And what is the best way to do it?

Do you have an example what exactly you try to do?

Ahmed-E-86 commented 5 years ago

Do you have an example what exactly you try to do?

Thanks for your reply. I want to use commands like:

sudo cp sudo rm sudo dpkg -i sudo apt update sudo apt install sudo add-apt-repository

any command that can open any configuration system file to be able to add text at certain point then save it.

qparis commented 5 years ago

@ahmed-elsayed2017 (and @plata). In a nutshell, legacy scripts where written in bash. While it was a great language to engage people creating scripts, we faced a major problem of code factorisation.

Because shell lacks a lot of basic programming structures (Object oriented aspect, easy manipulation of strings and arrays, modularity), we faced a point where the maintenance was very hard. This is why we wanted to try with JS.

image

As you can see, the factorisation is easier.

Concerning Java, the choice was harder. Clearly, there are a now a lot of small, lightweight wine front-end focused on gaming that do things very well (namely lutris). We wanted to reach other peoples (not only Linux gamers), sometimes with more pro/industrial needs, and also people on other operating systems (linux, mac, freebsd, later android & rpi, ...). We have therefore chosen frameworks according to that trajectory.

Hope it answers your question

Concerning your needs, in general, we avoid sudo commands inside scripts for security reasons. For example, dpkg -i is not portable so we need to find another solution in general :) What are you trying to do exactly?

Ahmed-E-86 commented 5 years ago

Concerning your needs, in general, we avoid sudo commands inside scripts for security reasons. For example, dpkg -i is not portable so we need to find another solution in general :) What are you trying to do exactly?

Thanks for your explanation.

I just want to make 1 click installers for Ubuntu, especially for the applications that don't exist in the package manager, so it pops an input box for sudo password, then start to install the application in the background, and show succeeded message box at the end.

I don't want the application to store the sudo password. I just want to show message box everytime it needs sudo password.

qparis commented 5 years ago

Yep, but we do not really want this in a POL script, because it will only work for your distribution

Kreyren commented 5 years ago

I just want to make 1 click installers for Ubuntu, especially for the applications that don't exist in the package manager

So you want to make wineapps available in ubuntu's store?


Yep, but we do not really want this in a POL script, because it will only work for your distribution

He can make his own repository for this though, but there is probably better way to do this


https://github.com/PhoenicisOrg/phoenicis/issues/1996#issuecomment-501380205

That's my bias (since i hate java) opinion and i still don't understand why is using javascript over bash better assuming that POL4 syntax for bash is terrible and could be written much better assuming same is sufficient to manage whole distribution like gentoo/exherbo it should have no problem handling phoenicis scripts -> I suspect you wrote unusable and confusing functions in bash for POL4 and then decided that it's better to use javascript instead or that i'm dumb and don't see the benefits :thinking:

it could be even something like:

# Install steamapp
steam(<APPID_HERE>)

# Install steamapp + workarounds
corefonts(Y/N)
steam(<APPID_HERE>)

# Install online apps using phoenicis wine
corefonts(Y)
wget <URL> -O $TEMPORARY_POL_DIR/game.exe
env WINEPREFIX="$GAMEDIR" pwine(LATEST) $TEMPORARY_POL_DIR/game.exe || die "Unable to install game.exe"
make_shortcut($GAMEDIR/path/to/executable /path/to/miniature)

but that is not to be discussed here

Ahmed-E-86 commented 5 years ago

No, I don't want to miss with anyone's project. I just want to make my own project that can run scripts for Ubuntu that beginners can find it easy to use, and I will keep update these scripts. That is why I chose Python + Bash.

Kreyren commented 5 years ago

No, I don't want to miss with anyone's project. I just want to make my own project that can run scripts for Ubuntu that beginners can find it easy to use, and I will keep update these scripts. That is why I chose Python + Bash.

You seem to describe winepak (https://github.com/winepak) it might be more effective for you to contribute there since the project was abadoned and the concept seems effective for this usecase.

Current issues: https://github.com/winepak/applications/pull/161

or you can contrib scripts to POL4, but i have issues submiting installers there since they are not approved anymore.. Would be cool if anyone added functionality to source them from git repo.

btw. ping me when you have a proof of concept of your own, willing to contrib ^^

Ahmed-E-86 commented 5 years ago

No, I mean that I want to install up-to-date applications for Ubuntu like Wine, and Mesa.... etc.

There is a new project like the project that you mentioned, but he added general scripts to build portable wine applications, but he has not added any specific scripts, you might able to help with that https://github.com/Kron4ek/wine_scripts

Kreyren commented 5 years ago

I mean that I want to install up-to-date applications for Ubuntu like Wine, and Mesa.... etc.

Ubuntu is really slow on updates for that it's more sane to use debian buster based on my experience.

if it has to be on ubuntu you can probably maintain sources for apt that can be used by users that has more up-to-date packages.

alternatively you can provide them in something like flatpak so that they can be exported without ubuntu conflicts.

or if it's just for your own use, use can use real distro, willing to teach you


There is a new project like the project that you mentioned, but he added general scripts to build portable wine applications, but he has not added any specific scripts, you might able to help with that https://github.com/Kron4ek/wine_scripts

The project that you provided seems to me as cheaper version of winetricks with precompiled wine. The way the project is written seems as very uneffective to me..

Different approaches:

it's abstract is to provide small bash script which game configuration is beeing sourced from remote repository to install apps in https://github.com/RXT067/Scripts/tree/master/KUWAC/CONFIGURATION Simmilar for wine.


You can probably just contribute to winetricks to provide this functionality and update game configuration there since wine provides precompiled wine on https://dl.winehq.org/wine/source/ :thinking:

Ahmed-E-86 commented 5 years ago

I used Debian Unstable, Manjaro, Opensuse Tumbleweed, Solus, and Fedora, and they always break sooner or later, and I always go back to Linux Mint / Ubuntu, because it is a solid system that don't break easily, and I always recommend it for beginners, but it needs some improvements that no one wants to make.

Kreyren commented 5 years ago

Debian Unstable is made to break it's made for very insane users and debian developers..

Manjaro from my point of view needs more time of development, it's isos are not even sanitized and so it can be easily compromised.

OpenSUSE Tumbleweed was unusable for me, it has lots of functionality not configured correctly and devs doesn't care much to fix them, referencing: https://bugzilla.suse.com/show_bug.cgi?id=1124910 https://bugzilla.suse.com/show_bug.cgi?id=1125376

Solus dunno

Fedora depends since they make lots of questionable changes and it's developers and usually close-minded based on my own experience.

Nothing on ubuntu is close to solid system since they prefer stability which is futile on linux since linux has to be updated frequently to keep it stable for security updates and app versions + it's community is unedicated resulting in corrupting linux. (my opinion)

I can recommend you gentoo if you know how to optimize and configure it and it won't ever break + it ships all updates.. Or exherbo which i describe as gentoo on steroids if you are a skilled developer and linux user since based on available info regular users are not welcomed there.

Ahmed-E-86 commented 5 years ago

Linux Mint / Ubuntu gets security updates constantly, but it gets fully updated every 6 months, after enough time of testing from advanced users, and developers. I didn't like this idea at first, but it is quite stable, and that is what I need from a Linux OS to be stable, and secure.

Kreyren commented 5 years ago

@ahmed-elsayed2017 Ubuntu gets security updates constantly, because there is lots of updates every day to linux, but critical fixes are distributed very very slow on linux terms.. Such updates should be pushed the same day (after few hours from release actually since those updates might prevent someone from compromising your system, etc..) and not after few days, weeks, months or never "because it breaks compatibility/stability". + whole ubuntu is just a garbage code that likes to break based on my experience. (systemd is beeing constantly confused about random changes done by system which usually causes halting and simmilar)

referencing https://www.cvedetails.com/vulnerability-list/vendor_id-4781/product_id-20550/year-2019/Canonical-Ubuntu-Linux.html

Ahmed-E-86 commented 5 years ago

Do you have an example what exactly you try to do?

Thanks for your reply. I want to use commands like:

sudo cp sudo rm sudo dpkg -i sudo apt update sudo apt install sudo add-apt-repository

any command that can open any configuration system file to be able to add text at certain point then save it.

I am waiting for your input in this matter based on your experience dealing with Python and Bash.

plata commented 5 years ago

@ahmed-elsayed2017 correct me if I'm wrong but your use case doesn't seem to be related to Phoenicis (PoL) at all.

Ahmed-E-86 commented 5 years ago

@ahmed-elsayed2017 correct me if I'm wrong but your use case doesn't seem to be related to Phoenicis (PoL) at all.

You are right. Thanks any way.

Kreyren commented 5 years ago

@ahmed-elsayed2017 correct me if I'm wrong but your use case doesn't seem to be related to Phoenicis (PoL) at all.

@plata stop being an ass and help the guy :p

qparis commented 5 years ago

@kreyren, as far as I can see, the exchange with @ahmed-elsayed2017 was positive and we answered his question regarding to our skills. @ahmed-elsayed2017, please tell us if you are not confortable with our support, so that we can improve :-)

@kreyren however your behavior is totally unacceptable.

You are insulting the team personally ; you are scaring contributors, using disproportioned words (like “ass”, “your code is garbage”, “xxx is shit”) and on top of that, your contributions are very weak (not to say inexistant) : more words than actions.

You have been warned many times before and explicitly by @plata no sooner than yesterday. I am afraid that we will have no choice to react in consequence.

@ahmed-elsayed2017 Please accept on the behalf of the team our sincere apologizes about these events. We would be happy to discuss about your problems and suggestions in another issue.