Forum › Forums › New users › New Users and General Questions › Prevent Workspaces from being saved after shutdown/logout
- This topic has 10 replies, 4 voices, and was last updated Apr 23-7:21 am by Xunzi_23.
-
AuthorPosts
-
April 20, 2023 at 6:20 pm #105111Member
antixcat
Hello,
I am using IceWM and I’m trying to find a way to prevent windows which are open at shutdown/logout from reopening in their previous state in the next session. This can be convenient at times, but most of the time (for me) I’m annoyed when I simply want to open a file in a text editor, and all of the previous windows and tabs from the last session open as well. I’ve looked through all of the IceWM preferences and theme preferences and found nothing relating to this.
On the same topic, is there any way to universally prevent Connman from auto-connecting and/or remembering a network? I understand you can prevent auto-connect in the configuration for each network that is a “favorite”, but is there a way to prevent auto-connect for every network at every boot, or prevent networks from being favorited at all? I couldn’t find any way to do this in the GUI, and adding the following to “/var/lib/connman/settings” did not work either:
[Wired] AutoConnect=false [WiFi] AutoConnect=falseOne other thing I tried was adding these lines to either “~/.icewm/startup” or “~/.desktop-session/startup”:
sudo ip link set dev eth0 down sudo ip link set dev wlan0 downBut this seems like a dirty fix, and requires me to edit my “/etc/sudoers” file to allow those lines to be run without a password.
April 20, 2023 at 7:06 pm #105114Member
iznit
::a way to prevent windows which are open at shutdown/logout from reopening in their previous state in the next session
icewm (or jwm or fluxbox) is probably immaterial to the current behavior of the program windows. The individual programs are likely responsible for remembering and restoring their previous state. You would need to tweak the config file (((if available))) of each program to override that behavior. You can at least attempt to use icesh to force the preferred window geometry for various programs https://www.antixforum.com/forums/topic/hotkey-to-remember-window-size-and-position-for-icewm/ + https://ice-wm.org/man/icesh but each individual program’s config or, possibly, arguments passed via command line when launching, control the window opening state (((contents))).
April 20, 2023 at 8:57 pm #105120Memberantixcat
::The programs that are reopening windows from the previous session are Firefox, Sublime text, and zzzFM.
In firefox, I have unchecked “Open previous windows and tabs”
In Sublime text, I have this in my preferences:
"hot_exit": "disabled", "remember_layout": false, "remember_workspace": false,And for zzzFM I haven’t been able to find any preferences relating to this.
- This reply was modified 2 weeks, 4 days ago by antixcat. Reason: format
April 20, 2023 at 10:11 pm #105122Moderator
caprea
::For zzzfm you can go on top to the left to “File” and under File there’s the option “Save Tabs”, which is activated by default.
April 21, 2023 at 8:10 am #105134MemberXunzi_23
::For firefox in about:config set browser.sessionstore.resume_from_crash to false
That will prevent resume and logins being preserved over sessions even if you do
not close the browser correctly. Which is notm a good idea as you might if you were
on some sites end up with headless browser starting and running without warning.For Libreoffice you can add –norestore to startparameter that is minus minus in
case mangled by forum.April 21, 2023 at 5:34 pm #105166Memberantixcat
::@caprea
Thank you, I hadn’t seen this option. I was at times racking up 10+ tabs in zzzfm! Now it always opens to a single tab at my home directory. This is great because I can rely on muscle memory to navigate.@Xunzi_23
It seems like the issue might be that these programs do not fully close when shutting down or logging out? I considered adding the following to “~/.desktop-session/shutdown” (after enabling “LOAD_SHUTDOWN_FILE=”true” in “desktop-session.conf”):#! /bin/bash pkill -TERM -f sublime & pkill -TERM -f zzzfm & pkill -TERM -f firefox &But closing the programs this way gives me the same problem. However, if I manually close each program before shutting down/logging out (using Alt-F4), the windows don’t reopen in the next session, so I wonder if there is a way to use the CLI to get the same behavior as Alt-F4? In any case, I can always just take the extra steps to manually close programs before shutting down, but it would be nice if this happened automatically.
April 21, 2023 at 5:50 pm #105169MemberXunzi_23
::Hi antixcat, firefox and libreoffice have convenience built in. LO writes a file containing
restore information position and window size.Common Firefox exploit is to trick it in to headless mode then utilize the hidden screenshot extension.
I always remove it along with form autofill etc.
Hidden extensions are in
/usr/lib/firefox-esr/browser/features
They can be deleted without issue. At same time rename crash reporter as it generates memory dumps.
minidump-analyzer who needs it and
pingsender as it is a mozilla tracking/telemetry vector and hard to quieten from config..Better still install LibreWolf.
April 21, 2023 at 8:03 pm #105174Memberantixcat
::@Xunzi_23
I’m a bit confused by your last post. I just uninstalled Firefox and installed Librewolf instead.It seems that a whole host of applications attempt to save their state in some form or another if they are open at shutdown/logout.
For Librewolf, I set “browser.sessionstore.resume_from_crash” to false. This works, but I worry if it ever actually crashes I will lose whatever I’m working on.
For Sublime text, I found that “~/.config/sublime-text/Local/” contains the files that help restore a session. I tried deleting the files, but this is giving me other problems. I’ll have to do more research.
zzzFM works great now that I have “Save Tabs” option turned off.
For LibreOffice suite, I copied all of the .desktop files from “/usr/share/applications/” to “~/.local/share/applications/” and added to the “Exec=” line “–norestore” as you mentioned. This works.
Even an OpenVPN connection attempts to save itself after logging out.
This is all workable, but it seems like it’d be much better if I could just find a way to automatically close every program properly at every shutdown/logout, rather than trying to hack each one on a case-by-case basis.
April 22, 2023 at 5:34 am #105203MemberXunzi_23
::Yes, convenience for user is convenience for anyone who can access a machine, and often a nuisance.
For Librewolf, I set “browser.sessionstore.resume_from_crash” to false. This works,
but I worry if it ever actually crashes I will lose whatever I’m working on.Unfortunately a choice we have to make, up to now though Librewolf has been very stable predictable
and site compatible for me.Please make sure you have latest version of Librewolf,
https://gitlab.com/api/v4/projects/24386000/packages/generic/librewolf/112.0.1-2/LibreWolf.x86_64.AppImage
is the one I use. Debian version has on occasion been somewhat outdated.Neither Browsers nor many other applications have true autosave, that includes LibreOffice which
relies on auto restore, that has failed me several times so I got very used to tapping Ctrl S
frequently. I also moved the close window entry to bottom of menu in LO as the close closes all LO
windows, not just the current one.Maybe you could please explain what confused in my last post.
Some extensions are not visible to users. One the screenshot tool is remotely executable under many
circumstances. Info came from Moz developer documents and depends on about config settings, problem is
config names often change, keeping up is as mozilla intends tiring so moved to Librewolf and UngoogledChromium.Often an extension called experiments can be found, that allows Moz devs, probably others to change user settings
remove user added extensions remotely or add further hidden extensions.
And reportedly renew the user profile silently, that negates userjs and userjs override changes as well as chrome
css. Userchrome CSS only works correctly in ESR as delivered by Mozilla. In Librewolf compile flags make it work on
latest too.April 22, 2023 at 6:02 pm #105229Memberantixcat
::@Xunzi_23
I appreciate the help! I am only confused because I think I’m not so familiar with how browsers work (headless mode, userchrome CSS, hidden extensions). I haven’t had any issues with Librewolf yet, but I just started using it. If a need arises I will take your advice and try Ungoogled Chromium, but probably stay away from Firefox now. I expect that a browser like Chrome would have hidden extensions and telemetry, but not Firefox. I guess that is the purpose of Librewolf, so you don’t have to worry about these things.
I have been using the default repos for everything (besides occasionally installing a .deb package from a website, or in one case, I installed Flatpak because I couldn’t find anything else). This is the “Debian Stable” or “bullseye” repos. As of now the AppImage Librewolf you linked in your post and the debian Librewolf are the same version: 112.0.1-2, but I have read that Debian Stable tends to have older versions of programs, so I will keep an eye on this, although I do like that Librewolf is part of the package manager (one less thing to think about).
April 23, 2023 at 7:21 am #105275MemberXunzi_23
::Hi antixcat, browsers are complex monsters these days and probably the most common exploit vector.
Librewwolf is a good choice, many security experts have vetted it.
UngoogledChromium is not better, just different. I use both, general browsing Ungoogled and for some
sites Librewolf.We must accept sometimes an attacker can be succesful, any signs of that I reinstall from backup or clone
a (I hope) clean USB live antiX.Big advantage of antiX, make an ISO as personal backup from your installed system is really easy.
-
AuthorPosts
- You must be logged in to reply to this topic.