Want to listen to 30,000 radio stations? bonus install flatpak for a variety of other apps

Shortwave is a very good linux only radio station its a shame we cant easily run it on porteus. or can we?



its a great way to find new songs as it shows you what song is playing as well.
181.FM the rock! (hardrock) main station
CRnet Rock (128)
181.FM salsa
Rock Radio Beograd serbia
Radio rocket switzerland alternative, eclectic prog, rock
typically ill listen to a radio station and if it doesnt have a good song database i delete it.
CRnet Rock has some sweet songs
it also saves the last played songs as recordings so you can replay them
Download link flatpak for porteus
https://drive.google.com/file/d/1XAlRon ... sp=sharing <---flatpak 1.12.7 with all modules
if you want to build it yourself
appstream-1.0.4-x86_64-1cf.xzm
appstream-glib-0.8.1-x86_64-1alien.xzm
bubblewrap-0.8.0-x86_64-1alien.xzm
dconf-0.40.0-x86_64-1.xzm
flatpak-1.12.7-x86_64-2alien.xzm
glib-networking-2.70.1-x86_64-1.xzm
json-glib-1.6.6-x86_64-1.xzm
libostree-2023.5-x86_64-1alien.xzm
libyaml-0.2.5-x86_64-3.xzm
xdg-dbus-proxy-0.1.4-x86_64-1alien.xzm
** Note **
Flatpak uses gigabytes of storage so it is meant for a full install distro
Changes=
therefor it is recommended to have changes saved to an XFS or EXT4 drive with Changes= for real time saving. there is a workaround see below after how to use flatpak.
How to use flatpak
now since this is a buggy mess of a program.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak list
flatpak install shortwave
flatpak run de.haeckerfelix.Shortwave
the icons in the start menu will appear after you logout and log back in so you could drag those to the desktop as well.
logout and then log back in. the icons will be in the app start menu then you can drag the icons to desktop.
or see below to pull the icons from /var/lib/flatpak/exports/share
this is the method I use. I believe the desktop integration is broken anyway so this method is probably the best.
it does add the icons to your app menus.
the theory here is that flatpak will install the icons to the users path. now I believe the desktop integration is broken with flatpak. that is it doesnt create desktop icons on its own.
so you have to grab the icons from that path above.
Help it didnt work
if youre having problems remove the remote
flatpak remotes
flatpak remote-delete remoteid
then
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
to try again
sometimes it can be a problem with the repo
/home/guest/.local/share/flatpak/export/repo or something like that delete the repo folder
or
the repo folder in /var/lib/flatpak
flatpak creates these directories
/var/lib/flakpak/export/bin (usually)
or
/root/.local/share/flatpak/exports/bin/
or
/home/guest/.local/share/flatpak/exports/bin/
if you get some weird error try going to /var/lib/flatpak and delete the repo directory and try again
try to do it as su first
sudo su
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install shortwave
exit
export XDG_DATA_DIRS="/home/guest/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install shortwave
press 2 for user
Change:EXIT requirements (Saving your changes after installing your apps)
Only for Changes=EXIT:
Follow these steps after you have installed the flatpak apps youre going to use
After you have made the adjustments step 7 and 8 for regular saving or you can continue to use changes-commit (called on shutdown and restart)
Fix for Changes=EXIT: (After installing your apps if youre on Change= ignore this)
Note ** when saving changes on exit the save script errors out. (because flatpak uses too many files)
changes-commit will not save all your files (including other session files) due to long filenames and the symbolic links <-------------- and too long file names
as well as when you logout for saving changes. to fix this do this:
Making flatpak apps persistent
1. Follow How to use flatpak above then come back here
2. after you have installed the flatpak apps youre going to use proceed
3. We have to physically copy from aufs to our drive.
4. cp -ar /var/lib/flatpak /mnt/sda3/changes/var/lib/ (we are sending all the flatpak files to our drive)
this will copy the gigabytes of long filenames to your actual drive.
reboot or shutdown and ** press a key not to save changes (script will error out). **
then everything will be normal again.
/etc/changes-exit.conf
! var/lib/flatpak
! home/guest/.cache
5.
if you install a new flatpak app later and if youre on Changes=EXIT:
rsync -av /var/lib/flatpak/ /mnt/sda3/changes/var/lib/flatpak
#make a backup as well
cp -ar /var/lib/flatpak/ /mnt/sda/backup/
This should work. if it doesnt you have your backup boot into always fresh mode. remove /mnt/sda3/changes/var/lib/flatpak and copy the backup into there.
If you dont get this correctly the system wont be in true memory. hence below we !/var/lib/flatpak we dont want anything going into there at all
on subsequent use of the system.
6.
remember the changes-commit (also shuttingdown or rebooting) script errors on flatpak file names and we dont want to lose anything.
on shutdown or restart press a key to skip the saving as weve done that already.
you can still use changes-commit after you have made copied the flatpak folder and rebooted. skip saving on exit on first install.
These last two steps you only have to do once. If you dont change your apps you dont have to copy them.
if you experience problems
!/home/guest as the problem can be inside this folder (cache files and a bunch of app data)
reboot and skip saving changes (already done)
End of making flatpak apps persistent
Use scripts to automate saving
7. Automatically make a module of changes (leave in tmp/ram) update your drive and delete the module (or alter to keep a copy)
Note: these scripts save your session changes (not /var/lib/flatpak)
see steps 3-6. to setup the install. install all yours apps and copy it manually to your drive.
then we proceed to regular saving.
You should also go to your changes-commit config script and change
/etc/changes-exit.conf
! your /home/guest/.cache
!var/lib/flatpak
custom script for saving session making xzm then extracting it and syncing to your system
https://drive.google.com/file/d/1Ev-Z3_ ... sp=sharing
put in /opt/porteus-scripts/
chmod +x save-changeshdd
variables to change (2)
change target (your extramod or module folder) and changes (where your changes folder is)
save-changeshdd module with symbolic link you can save-changeshdd command from terminal
https://drive.google.com/file/d/1MuKpt_ ... sp=sharing
configure it and then make it a module.
This script is the one I use
updated script (creates a module mounts it and syncs it and then removes the module)
https://drive.google.com/file/d/12ulIFJ ... sp=sharing
put in /opt/porteus-scripts/
chmod +x save-changesnew
only one variable to change
change changes variable to where your changes folder is
save-changesnew module with symbolic link you can save-changesnew command from terminal
https://drive.google.com/file/d/1nOchXF ... sp=sharing
configure it and then make it a module.
icons for save script
https://drive.google.com/file/d/1kFt1M- ... sp=sharing

Commands: save-changeshdd
save-changesnew
make a terminal icon on desktop then go to properties. command type konsole -e /opt/porteus-scripts/scriptname then
when you click it will launch the script
then ! your /home/guest/.cache
!var/lib/flatpak
in changes-exit.conf
both save-changeshdd and new are the same. the first was my first design so I kept it as it kind of works on a simple level in the hdd.
the save-changesnew works in ram so its more efficient and leaves the .xzm in the tmp if you want it.
once changes-commit is updated can un ! in changes conf
I currently use changes-commit. After the flatpak apps have been manually saved as shown in step 3-6 above. restart and skip changes-commit for that instance. press a key on shutdown or restart. then everything is back to normal.
you now can use use changes-commit. or one of these scripts.
It should be noted these scripts are temporary until changes commit is updated. Then you should proceed to use changes-commit as its officially supported.
so for normal operation of everything
go to your changes-commit config script and change /etc/changes-exit.conf
! /var/lib/flatpak
! /home/guest/.cache
there may be more you want to add.
use the changes-commit or one of these scripts. if you forget the script changes commit will save all your changes on restart or shutdown.
or skip it if you used the scripts.
install a new flatpak app? go to step 3-6. and copy it to your drive. reboot skip saving changes. then all is normal again.
again use any script or changes commit will work after that.
Shortcuts
After you logout and back in there should be icons in the app launcher. you can grab those to the desktop
or
Go to shortcuts: these are links to the flatpak apps
/var/lib/flatpak/exports/bin/
pull those shortcuts to your desktop. drag to desktop select add icon. you can run an app by clicking those when you login. No more commandline

icon:
/var/lib/flatpak/exports/share/icons/hicolor/scalable/apps/
Some applications dont have scalable icons or they have different types go down one directory to find it if it is missing.
/var/lib/flatpak/exports/share/icons/hicolor/
Change your icons for your desktop shortcuts

Now we sped up our productivity. We dont have to even enter the command again to launch our apps.
but what if they are not there?
Lets make a script
flatpak list (to get names of installed programs)
now make a textfile and label it application (firefox, spotify, discord, ect whatever you application name is)
put it in /usr/local/bin
inside the text file
#!/bin/bash
flatpak run org.mozilla.firefox <----- this is what you manually type to run your application of firefox
then on desktop make a shortcut for konsole
edit properties - application - command - konsole -e /usr/local/bin/application <--- your script
make sure your script is executable in properties.
now change the icon and search firefox for the firefox icon or whatever app icon you need.
then now you can launch the flatpak apps from the desktop
with your own homemadelink
or the flatpak links if they are there /var/lib/flatpak/exports/bin/
What next
install warehouse and gimp
flatpak install warehouse
press 2 user
flatpak install gimp
press 2 user
select12 for 86_64 stable
while you have the /var/lib/flatpak/exports/bin/
pull warehouse and gimp short to desktop. drag to desktop select add icon.
right click change icon go here
Shortwave preferences: (to show new song play on popup)
Go to the three horizontal lines in the top middle
select play a notification when a new song plays on desktop
Debugging
How I came to the above version Below is all debugging and attempts at making the above link possible.
This is obselete left here for history of getting flatpack to work. See bottom posts for how I fixed it.
Lets try to use flatpak
flatpak-1.15.4-x86_64-1alien.txz third party
AppStream-0.15.2-x86_64-1dj.txz third party
bubblewrap-0.8.0-x86_64-1alien.txz third party
libostree-2023.5-x86_64-1alien third party
xdg-dbus-proxy-0.1.4-x86_64-1alien.xzm third party
libyaml-0.2.5-x86_64-3.txz Slackware 15
json-glib-1.6.6-x86_64-1.txz Slackware 15 official
dconf-0.40.0-x86_64-1.xzm Slackware 15 official
glib-networking-2.70.1-x86_64-1.txz Slackware 15 official
Note These modules have changed see below for the right ones
leaving here for history of attemps and what not to use
Debugging left here for historical purposes
/var/lib/flatpak/ <----- if this directory exists
sudo rm -r repo
export XDG_DATA_DIRS=$XDG_DATA_DIRS:"/home/guest/.local/share/" <-------- this is because flatpak installs here /home/guest/.local/share/
Not needed but gets rid of warnings. Put in your rc.local file to set the variable on startup
now log out and log back in
This is a buggy software that tries to interface with linux and if you make one wrong move you cant write to your filesystem with flatpak.
Lastly if you need any help let me know and I can help you. And the end result of this is a working install of flatpak where you can install a crap ton of apps.
My take on flatpak its pretty buggy. but it allowed me to install shortwave. so thats worth the pain especially since I couldnt compile shortwave from source with meson. Needs all sorts of gtk 4 and who knows what else.
So with this implementation of flatpak you can install a bunch of other apps spotify and discord probably.
probably take me a few days to figure out how to work flatpak but should be able to post what I find here. And I can put together a module as well. Check back and ill put it in here as a module
Ok so update. it works we got it to compile with flatpak and install thats all that matter. there is a bug where you can only run it once. I think it has to do with an environment variable or session or something. But it doesnt tell us what. Ill have a look at it tomorrow. but you login and you can run it and just dont close it. if you do close it you have to logout as user. log back in. then you can launch it again lol.
Also I think flatpak is simpler than a virtualbox to another linux distro to run an app. saves system resources and who wants to learn another linux distro
At the end of the day the key thing with software developing is take notes. These forums provide a great way to document how to get it to work and now you all can benefit with Shortwave. I will make a finalized module once I figure out how to deal with the session issue.
You will have your radio player on system start up. But if you close it you have to log out again. no big deal. If anyone knows how to fix this? its interfacing with dbus session im trying to trouble shoot this now. But Im down toONE last bug lol
Note this is debugging. Disregard all this.
Error:
"flatpak: symbol lookup error: flatpak: undefined symbol: g_string_free_and_steal"
so you have no idea what that error even means. but what it does mean is this is linked to the session. so once we figure out how to resolve that we can open and close flatpak without having to logout and log back in
dbus-run-session flatpak run de.haeckerfelix.Shortwave
Found the debug information:
dbus-daemon[12260]: [session uid=1000 pid=12260] Activating service name='org.gtk.vfs.Daemon' requested by ':1.0' (uid=1000 pid=12261 comm="flatpak run de.haeckerfelix.Shortwave ")
dbus-daemon[12260]: [session uid=1000 pid=12260] Successfully activated service 'org.gtk.vfs.Daemon'
fusermount3: failed to access mountpoint /run/user/1000/gvfs: Permission denied
dbus-daemon[12260]: [session uid=1000 pid=12260] Activating service name='org.freedesktop.Flatpak' requested by ':1.0' (uid=1000 pid=12261 comm="flatpak run de.haeckerfelix.Shortwave ")
dbus-daemon[12260]: [session uid=1000 pid=12260] Successfully activated service 'org.freedesktop.Flatpak'
flatpak: symbol lookup error: flatpak: undefined symbol: g_string_free_and_steal
A connection to the bus can't be made
so when you close flatpak this is what happens. Session closed and the new instance cant interface with the daemon
anyone know how to fix this