Battlefield 6 Requires Windows Secure Boot
I’ve been dual booting Linux and Windows for years now, and this is the first true roadblock that I’ve run into. Battlefield 6 is requiring my Secure Boot option to be set to “Windows” instead of “Other OS” in BIOS or else the game won’t launch due to the Anti-Cheat.
While no, this doesn’t mean Linux won’t boot, it does mean that the graphics drivers do not work. It stretches the image and makes it practically unusable.
I assume I’m not the first to ever experience this, so how do other people combat anti-cheat on Windows restricting their dual booting needs? If there was a way I could just use the Windows secure boot option with correct video drivers for Ubuntu, I would be covered.
https://redd.it/1msehr8
@r_linux
I’ve been dual booting Linux and Windows for years now, and this is the first true roadblock that I’ve run into. Battlefield 6 is requiring my Secure Boot option to be set to “Windows” instead of “Other OS” in BIOS or else the game won’t launch due to the Anti-Cheat.
While no, this doesn’t mean Linux won’t boot, it does mean that the graphics drivers do not work. It stretches the image and makes it practically unusable.
I assume I’m not the first to ever experience this, so how do other people combat anti-cheat on Windows restricting their dual booting needs? If there was a way I could just use the Windows secure boot option with correct video drivers for Ubuntu, I would be covered.
https://redd.it/1msehr8
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
Are there any fortune-mod addons or implementations that give arbitrary tips about git, grep, awk and sed?
Pretty much like games do on loading screens, but with fortune-mod with Unix general development/management tools. It would be a great use-case to learn more about these tools in a daily basis and experiment new things.
https://redd.it/1msf0g8
@r_linux
Pretty much like games do on loading screens, but with fortune-mod with Unix general development/management tools. It would be a great use-case to learn more about these tools in a daily basis and experiment new things.
https://redd.it/1msf0g8
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
Why are some distros better than others at handling nvidia drivers?
I hope being brave enough to post this here, instead of r/linux4noobs was not the wrong decision. Be kind linux gigachads, I have been using linux personally and for work for a few years now, so felt confident to post here.
I am kind of a distro hopper (I see/reminisce about a different distro than the one I am currently on, I will bkp my data and do a fresh install), but trying my best to stop doing this.
So, over the course of the last 10 days, I have tried 3-4 different distros on the same set of hardware (an HP Omen Laptop with AMD CPU and Nvidia GPU (1660Ti) ). And I had quite the different set of experiences when it came to getting my dGPU working across them.
First up was Cachy OS (back home, using it right now and mostly stick to this), pretty smooth sailing. No issues with the installer, it loaded up without any special flags/changes to GRUB. Installed the drivers on its own. I could login to a desktop and use applications on the GPU directly after install.
Next was Linux Mint, though it didn't install nvidia proprietary or the new nvidia-open ones (not noveau)...still worked, installer used my integrated GPU. And installing post install on linux mint has always been nice and easy for me. just go to their driver manager and it tells you which one is reccomended amongst the various proprietary drivers and you just install that. After install, everything works as expected.
Then MX Linux, given their focus on accessibility/ease-of-use with their MxTools, it was pretty easy there too.......to cut the story short...lets fast forward a bit
Then I wanted to give openSUSE another shot after I had heard zypper got parallel downloads. And boy was that a mistake.....when I launch the installer without modifying nomodeset in GRUB, it will not load the installer for me (I checked all ttys with ctrl+alt+f2-f7)...and if do launch installer by setting nomodeset it starts up and installls.......BUT!!!! directly after installing the OS I get 1280x768 something resolution which is wrong! (my display is 1080p). Also btw, everytime after installing openSUSE, zypper repo list was broken for me, it was referencing a repo from my boot USB or something so I had to remove it. Then I followed the automated install steps on https://en.opensuse.org/SDB:NVIDIA\_drivers \--> add the NVIDIA repo, refresh zypper, then the automated install steps (which btw it says, tested on TUMBLEWEED !!!!!) and lo and behold zypper does install something. Since I had secure boot disabled both before install and (set it to disabled in the OS installer) I didn't have to go through the MOK process (it never appeared after reboot)....and it still didn't fucking work!!!
So the main thing I wanted to discuss is why? why is it like this? that some arch-based distro can support a GPU driver out of the box, an LTS debian distro can support the computer out of the box and then post install you can install proprietary drivers pretty straightforward way but these rpm based distros always make it so complicated ! (unless you go for ublue or some other containerized version)
The thing with opensuse is, there wasn't even noveau bundled in and even though it was using my integrated GPU it was the completely wrong res when other distros like mint allow me to run at the right res even with my integrated gpu. And I completely opted out of the SE Linux/App-armor thing during install.....
so tell me, what kind of sane person who has nvidia GPUs would use openSUSE? since it seems to be so unreliable? (ik RHEL is even worse, have to use it at work) why would someone with say a server with one or more nvidia GPUs use something like openSUSE or RHEL or any rpm based distro (Fedora has also been a bit all over the place with regards to the drivers in the past for me) ?
and why can't they just do it like debian based distros seem to do it? or arch-based distros do it? or bundle something either noveau or the new nvidia-open ones in their initial install
I hope being brave enough to post this here, instead of r/linux4noobs was not the wrong decision. Be kind linux gigachads, I have been using linux personally and for work for a few years now, so felt confident to post here.
I am kind of a distro hopper (I see/reminisce about a different distro than the one I am currently on, I will bkp my data and do a fresh install), but trying my best to stop doing this.
So, over the course of the last 10 days, I have tried 3-4 different distros on the same set of hardware (an HP Omen Laptop with AMD CPU and Nvidia GPU (1660Ti) ). And I had quite the different set of experiences when it came to getting my dGPU working across them.
First up was Cachy OS (back home, using it right now and mostly stick to this), pretty smooth sailing. No issues with the installer, it loaded up without any special flags/changes to GRUB. Installed the drivers on its own. I could login to a desktop and use applications on the GPU directly after install.
Next was Linux Mint, though it didn't install nvidia proprietary or the new nvidia-open ones (not noveau)...still worked, installer used my integrated GPU. And installing post install on linux mint has always been nice and easy for me. just go to their driver manager and it tells you which one is reccomended amongst the various proprietary drivers and you just install that. After install, everything works as expected.
Then MX Linux, given their focus on accessibility/ease-of-use with their MxTools, it was pretty easy there too.......to cut the story short...lets fast forward a bit
Then I wanted to give openSUSE another shot after I had heard zypper got parallel downloads. And boy was that a mistake.....when I launch the installer without modifying nomodeset in GRUB, it will not load the installer for me (I checked all ttys with ctrl+alt+f2-f7)...and if do launch installer by setting nomodeset it starts up and installls.......BUT!!!! directly after installing the OS I get 1280x768 something resolution which is wrong! (my display is 1080p). Also btw, everytime after installing openSUSE, zypper repo list was broken for me, it was referencing a repo from my boot USB or something so I had to remove it. Then I followed the automated install steps on https://en.opensuse.org/SDB:NVIDIA\_drivers \--> add the NVIDIA repo, refresh zypper, then the automated install steps (which btw it says, tested on TUMBLEWEED !!!!!) and lo and behold zypper does install something. Since I had secure boot disabled both before install and (set it to disabled in the OS installer) I didn't have to go through the MOK process (it never appeared after reboot)....and it still didn't fucking work!!!
So the main thing I wanted to discuss is why? why is it like this? that some arch-based distro can support a GPU driver out of the box, an LTS debian distro can support the computer out of the box and then post install you can install proprietary drivers pretty straightforward way but these rpm based distros always make it so complicated ! (unless you go for ublue or some other containerized version)
The thing with opensuse is, there wasn't even noveau bundled in and even though it was using my integrated GPU it was the completely wrong res when other distros like mint allow me to run at the right res even with my integrated gpu. And I completely opted out of the SE Linux/App-armor thing during install.....
so tell me, what kind of sane person who has nvidia GPUs would use openSUSE? since it seems to be so unreliable? (ik RHEL is even worse, have to use it at work) why would someone with say a server with one or more nvidia GPUs use something like openSUSE or RHEL or any rpm based distro (Fedora has also been a bit all over the place with regards to the drivers in the past for me) ?
and why can't they just do it like debian based distros seem to do it? or arch-based distros do it? or bundle something either noveau or the new nvidia-open ones in their initial install
One shot book to learn Linux and Operating System
Hey, I just read a book on Computer Networks (Computer Networking: A Top-Down Approach). Now I am thinking about reading a book on Linux that also explains OS terms.
Does something like this exist? If so, can you please guide me? I want to be a backend engineer, and it will really help me in this journey.
https://redd.it/1msd9p1
@r_linux
Hey, I just read a book on Computer Networks (Computer Networking: A Top-Down Approach). Now I am thinking about reading a book on Linux that also explains OS terms.
Does something like this exist? If so, can you please guide me? I want to be a backend engineer, and it will really help me in this journey.
https://redd.it/1msd9p1
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
GDPR meant nothing: chat control ends privacy for the EU
https://www.reddit.com/r/Romania/comments/1msjxqp/gdpr_meant_nothing_chat_control_ends_privacy_for/
https://redd.it/1msltp3
@r_linux
https://www.reddit.com/r/Romania/comments/1msjxqp/gdpr_meant_nothing_chat_control_ends_privacy_for/
https://redd.it/1msltp3
@r_linux
Reddit
From the Romania community on Reddit: GDPR meant nothing: chat control ends privacy for the EU
Explore this post and more from the Romania community
How much % CPU does your mouse use on Linux desktop?
Here's something odd that we found out during a Linux LAN event this weekend. This is not a tech support question, but a peculiar behavior denoscription that got people into quite a heated exchange during the event, and was seen as something unexpected.
1. Close all programs so your Linux system is idle and no windows are open.
2. Open a terminal and run
3. Vigorously move your mouse in circles or back and forth over the desktop for several seconds, while observing output from
Surprising result: on three tested systems (Linux Mint 22 Cinnamon, Debian 13, Fedora 42 KDE), CPU usage spikes up to 20%, 50% and even up to 100% on one system, just from moving the mouse.
All these systems have desktop GPUs used for playing games - not integrated graphics.
Someone said that they would have expected moving the mouse to not even register in
Does Linux design dedicate a CPU core for processing the mouse?
I thought it would be interesting to poll: how much CPU overhead does moving the mouse result in on your Linux desktop system? Is e.g. 20%-100% CPU usage from moving the mouse nominal/expected on Linux? Does some Linux distro/desktop environment get 0% for mouse?
https://redd.it/1msmuyv
@r_linux
Here's something odd that we found out during a Linux LAN event this weekend. This is not a tech support question, but a peculiar behavior denoscription that got people into quite a heated exchange during the event, and was seen as something unexpected.
1. Close all programs so your Linux system is idle and no windows are open.
2. Open a terminal and run
top.3. Vigorously move your mouse in circles or back and forth over the desktop for several seconds, while observing output from
top.Surprising result: on three tested systems (Linux Mint 22 Cinnamon, Debian 13, Fedora 42 KDE), CPU usage spikes up to 20%, 50% and even up to 100% on one system, just from moving the mouse.
All these systems have desktop GPUs used for playing games - not integrated graphics.
Someone said that they would have expected moving the mouse to not even register in
top, i.e. some 0-1% CPU overhead, and that is what would happen on Windows and on macOS. That got me thinking that surely that couldn't be possible, since the CPU must do some work at least to process the mouse.Does Linux design dedicate a CPU core for processing the mouse?
I thought it would be interesting to poll: how much CPU overhead does moving the mouse result in on your Linux desktop system? Is e.g. 20%-100% CPU usage from moving the mouse nominal/expected on Linux? Does some Linux distro/desktop environment get 0% for mouse?
https://redd.it/1msmuyv
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
I was recently given these manuals and decided to give them a try. I hope I'm up to date.
https://redd.it/1msxhj7
@r_linux
https://redd.it/1msxhj7
@r_linux
Humble Bundle; any of them good?
Humble Bundle currently has a bundle of Linux and Unix related books. I was looking at picking it up. Is this bundle worth picking up? Any books in it specifically a great read or a skip book?
https://www.humblebundle.com/books/linux-complete-pearson-books
https://redd.it/1msxmy4
@r_linux
Humble Bundle currently has a bundle of Linux and Unix related books. I was looking at picking it up. Is this bundle worth picking up? Any books in it specifically a great read or a skip book?
https://www.humblebundle.com/books/linux-complete-pearson-books
https://redd.it/1msxmy4
@r_linux
Humble Bundle
Humble Tech Book Bundle: Linux Complete by Pearson
Unleash your machine’s potential with our latest Humble Tech Book Bundle: Linux Complete—customize, design, and help support The BINC Foundation today!
I installed Linux Mint on my grandmother's brand new laptop (she asked me to)
My grandma recently bought a new laptop and when I was helping her set it up, I ran into a problem. Since Windows 11 likes to force you to make a Microsoft account nowadays, I had her give me an email address and password she wanted to use to make her account. The problem arose when I put her email address in and it got rejected. She uses a local ISP email address and it's been fine for everything else she uses. Microsoft wouldn't allow it in this case however and suggested creating a new email. Well of course she doesn't want to do that. I explained the options to her: I could override this and make a local account with some fiddling, we could make a new email, or I could install Linux.
My grandmother, who is in her 70's asked me to just install Linux. I've put Linux Mint on an older laptop of hers to squeeze some extra life out of it before and I guess she really enjoyed using it. So today I installed Linux Mint on her brand new laptop before even finishing the first boot of Windows 11. I just thought this was kind of amusing and wanted to share, I never thought I'd see the day where she'd actually choose Linux over Windows.
https://redd.it/1mtcb4p
@r_linux
My grandma recently bought a new laptop and when I was helping her set it up, I ran into a problem. Since Windows 11 likes to force you to make a Microsoft account nowadays, I had her give me an email address and password she wanted to use to make her account. The problem arose when I put her email address in and it got rejected. She uses a local ISP email address and it's been fine for everything else she uses. Microsoft wouldn't allow it in this case however and suggested creating a new email. Well of course she doesn't want to do that. I explained the options to her: I could override this and make a local account with some fiddling, we could make a new email, or I could install Linux.
My grandmother, who is in her 70's asked me to just install Linux. I've put Linux Mint on an older laptop of hers to squeeze some extra life out of it before and I guess she really enjoyed using it. So today I installed Linux Mint on her brand new laptop before even finishing the first boot of Windows 11. I just thought this was kind of amusing and wanted to share, I never thought I'd see the day where she'd actually choose Linux over Windows.
https://redd.it/1mtcb4p
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
Linux security policy
Hey,
I'm working on a Linux Security Policy for our company, which sets distro-agnostic requirements on the configuration and procedures that must be followed for employees wishing to use Linux on their work computers. Do you have any input?
("secure password" is defined elsewhere)
# Linux Security Policy draft
# Storage
The system MUST be secured with full-disk encryption using LUKS and a secure password or hardware key.
Suspend-to-disk (hibernation) MUST be encrypted or disabled.
Swap partitions MUST be encrypted or disabled.
# User setup
The user account MUST have a secure password.
Measures MUST be in place to protect against brute-force attacks. E.g. lock for 10 minutes after 3 failed login attempts.
# System configuration
Microcode MUST be applied to mitigate CPU/architecture vulnerabilities.
The system MUST NOT have SSH server running, unless explicitly required.
If used,
The root account MUST be disabled for direct login, or secured with a strong password if enabled.
A firewall (e.g.
A Mandatory Access Control (MAC) (e.g. AppArmor or SELinux) system SHOULD be enabled and in enforcing mode.
Secure Boot SHOULD be enabled.
\> Unsure about this. Secure boot is as i understand more or less useless in Linux unless you own the whole trust chain yourself, which is kinda risky to set up, and a pretty big ask for a basic security requirement.
Sandboxed package formats like Snap, Flatpak, or AppImage SHOULD be used for untrusted or third-party GUI applications...
# Procedures
Installed packages MUST be updated at least monthly
CVE scanning tools (e.g. arch-audit, debian-security-support) SHOULD be run periodically.
If CVE scanning is used, critical vulnerabilities MUST be reviewed in:
Externally exposed (e.g. browsers, dev servers)
Handling untrusted content (e.g. document viewers, email clients)
Actions on CVEs MAY include upgrading, sandboxing, disabling features, or temporary avoidance.
\> I'm partial to remove any mentions of CVEs, as I often find it hard to gain anything useful from the output (e.g. arch-audit currently reports several high-risk vulnerabilities in libxml2, which is used in a ton of applications, but hopefully/probably not in a way that exposes the vulnerabilities)
https://redd.it/1mtfgrc
@r_linux
Hey,
I'm working on a Linux Security Policy for our company, which sets distro-agnostic requirements on the configuration and procedures that must be followed for employees wishing to use Linux on their work computers. Do you have any input?
("secure password" is defined elsewhere)
# Linux Security Policy draft
# Storage
The system MUST be secured with full-disk encryption using LUKS and a secure password or hardware key.
Suspend-to-disk (hibernation) MUST be encrypted or disabled.
Swap partitions MUST be encrypted or disabled.
# User setup
The user account MUST have a secure password.
Measures MUST be in place to protect against brute-force attacks. E.g. lock for 10 minutes after 3 failed login attempts.
# System configuration
Microcode MUST be applied to mitigate CPU/architecture vulnerabilities.
The system MUST NOT have SSH server running, unless explicitly required.
If used,
root login MUST be prohibited, and SSH keys MUST be used instead of passwords.The root account MUST be disabled for direct login, or secured with a strong password if enabled.
A firewall (e.g.
ufw) MUST be configured with default deny inbound rules, except where explicity needed (e.g. mDNS on UDP 5353 for local printer discovery or similar services).A Mandatory Access Control (MAC) (e.g. AppArmor or SELinux) system SHOULD be enabled and in enforcing mode.
Secure Boot SHOULD be enabled.
\> Unsure about this. Secure boot is as i understand more or less useless in Linux unless you own the whole trust chain yourself, which is kinda risky to set up, and a pretty big ask for a basic security requirement.
Sandboxed package formats like Snap, Flatpak, or AppImage SHOULD be used for untrusted or third-party GUI applications...
# Procedures
sudo SHOULD be used over suInstalled packages MUST be updated at least monthly
CVE scanning tools (e.g. arch-audit, debian-security-support) SHOULD be run periodically.
If CVE scanning is used, critical vulnerabilities MUST be reviewed in:
Externally exposed (e.g. browsers, dev servers)
Handling untrusted content (e.g. document viewers, email clients)
Actions on CVEs MAY include upgrading, sandboxing, disabling features, or temporary avoidance.
\> I'm partial to remove any mentions of CVEs, as I often find it hard to gain anything useful from the output (e.g. arch-audit currently reports several high-risk vulnerabilities in libxml2, which is used in a ton of applications, but hopefully/probably not in a way that exposes the vulnerabilities)
https://redd.it/1mtfgrc
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
It feels like majority of people, tech literate or not, are still stuck at 2010 if it comes to how they perceive Linux
Because every single time Linux comes up people keep shitting on it with "yeah but you have to code a million lines just to get your printer running" or "yeah but it will break after every update" and other vastly outdated cliches. I mean, sure, it still isnt Windows level in compatibility, but since switching to Fedora I can do literally everything I could do on Windows. And ironically enough, most games run legit better now. And I barely had to do anything. It just worked out of the box. While you still have to learn quite a few things (where most of it comes naturally with time just like on any OS) to use Linux efficiently it still isnt NEARLY as bad as it was 5 - 10 years ago. Sadly it seems like most peoples knowledge about Linux is still stuck on that time and they arent aware how far Linux came since then and just keep repeating this outdated shit, making Linux seem much worse than it actually it. Sadly enough it also affected me in my decision to give it a chance on my main PC and I kept delaying installing it. Thats also what made me think about this topic. If uninformed people wouldnt spout this outdated info everytime Linux comes up it wouldnt suprise me if more people would give that OS a fair chance.
https://redd.it/1mtltjf
@r_linux
Because every single time Linux comes up people keep shitting on it with "yeah but you have to code a million lines just to get your printer running" or "yeah but it will break after every update" and other vastly outdated cliches. I mean, sure, it still isnt Windows level in compatibility, but since switching to Fedora I can do literally everything I could do on Windows. And ironically enough, most games run legit better now. And I barely had to do anything. It just worked out of the box. While you still have to learn quite a few things (where most of it comes naturally with time just like on any OS) to use Linux efficiently it still isnt NEARLY as bad as it was 5 - 10 years ago. Sadly it seems like most peoples knowledge about Linux is still stuck on that time and they arent aware how far Linux came since then and just keep repeating this outdated shit, making Linux seem much worse than it actually it. Sadly enough it also affected me in my decision to give it a chance on my main PC and I kept delaying installing it. Thats also what made me think about this topic. If uninformed people wouldnt spout this outdated info everytime Linux comes up it wouldnt suprise me if more people would give that OS a fair chance.
https://redd.it/1mtltjf
@r_linux
Reddit
From the linux community on Reddit
Explore this post and more from the linux community
Kdenlive 25.08 released with over 300 commits of bug fixes and polishing
https://kdenlive.org/news/releases/25.08.0/
https://redd.it/1mtpflw
@r_linux
https://kdenlive.org/news/releases/25.08.0/
https://redd.it/1mtpflw
@r_linux
Reddit
From the linux community on Reddit: Kdenlive 25.08 released with over 300 commits of bug fixes and polishing
Posted by f_r_d - 13 votes and 0 comments
Czkawka / Krokiet 10.0: Cleaning duplicates, ARM Linux builds, removed appimage support and availability in Debian 13 repositories
After a little less than six months, I’m releasing a new version of my three distinct (yet similar) duplicate-finding programs today.
https://preview.redd.it/wsw3ai9gnsjf1.png?width=2880&format=png&auto=webp&s=4b5ad81c4f2e4de036f00b847c634f78b10b1508
The list of fixes and new features may seem random, and in fact it is, because I tackled them in the order in which ideas for their solutions came to mind. I know that the list of reported issues on GitHub is quite long, and for each user their own problem seems the most important, but with limited time I can only address a small portion of them, and I don’t necessarily pick the most urgent ones.
Interestingly, this version is the largest so far (at least if you count the number of lines changed). Krokiet now contains almost all the features I used in the GTK version, so it looks like I myself will soon switch to it completely, setting an example for other undecided users (as a reminder, the GTK version is already in maintenance mode, and I focus there exclusively on bug fixes, not adding new features).
As usual, the binaries for all three projects (czkawka\_cli, krokiet, and czkawka\_gui), along with a short legend explaining what the individual names refer to and where these files can be used, can be found in the releases section on GitHub — [https://github.com/qarmin/czkawka/releases](https://github.com/qarmin/czkawka/releases)
# Adding memory usage limits when loading the cache
One of the random errors that sometimes occurred due to the user, sometimes my fault, and sometimes — for example — because a power outage shut down the computer during operation, was a mysterious crash at the start of scanning, which printed the following information to the terminal:
memory allocation of 201863446528 bytes failed
Cache files that were corrupted by the user (or due to random events) would crash when loaded by the bincode library. Another situation, producing an error that looked identical, occurred when I tried to remove cache entries for non-existent or unavailable files using an incorrect struct for reading the data (in this case, the fix was simply changing the struct type into which I wanted to decode the data).
This was a rather unpleasant situation, because the application would crash for the user during scanning or when pressing the appropriate button, leaving them unsure of what to do next. Bincode provides the possibility of adding a memory limit for data decoding. The fix required only a few lines of code, and that could have been the end of it. However, during testing it turned out to be an unexpected breaking change—data saved with a memory-limited configuration cannot be read with a standard configuration, and vice versa.
use std::collections::BTreeMap;
use bincode::{serialize_into, Options};
const MEMORY_LIMIT: u64 = 1024 * 1024 * 1024; // 1 GB
fn main() {
let rands: Vec<u32> = (0..1).map(|_| rand::random::<u32>()).collect();
let btreemap: BTreeMap<u32, Vec<u32>> =
rands
.iter()
.map(|&x| (x % 10, rands.clone()))
.collect();
let options = bincode::DefaultOptions::new().with_limit(MEMORY_LIMIT);
let mut serialized: Vec<_> = Vec::new();
options.serialize_into(&mut serialized, &btreemap).unwrap();
println!("{:?}", serialized);
let mut serialized2: Vec<_> = Vec::new();
serialize_into(&mut serialized2, &btreemap).unwrap();
println!("{:?}", serialized2);
}
[1, 1, 1, 252, 53, 7, 34, 7]
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 53, 7, 34, 7]
The above code, when serializing data with and without the limit, produces two different results, which was very surprising to me because I thought that the limiting option applied only to the decoding code, and not to the file itself (it seems to me that most data encoding libraries write only the raw data to
After a little less than six months, I’m releasing a new version of my three distinct (yet similar) duplicate-finding programs today.
https://preview.redd.it/wsw3ai9gnsjf1.png?width=2880&format=png&auto=webp&s=4b5ad81c4f2e4de036f00b847c634f78b10b1508
The list of fixes and new features may seem random, and in fact it is, because I tackled them in the order in which ideas for their solutions came to mind. I know that the list of reported issues on GitHub is quite long, and for each user their own problem seems the most important, but with limited time I can only address a small portion of them, and I don’t necessarily pick the most urgent ones.
Interestingly, this version is the largest so far (at least if you count the number of lines changed). Krokiet now contains almost all the features I used in the GTK version, so it looks like I myself will soon switch to it completely, setting an example for other undecided users (as a reminder, the GTK version is already in maintenance mode, and I focus there exclusively on bug fixes, not adding new features).
As usual, the binaries for all three projects (czkawka\_cli, krokiet, and czkawka\_gui), along with a short legend explaining what the individual names refer to and where these files can be used, can be found in the releases section on GitHub — [https://github.com/qarmin/czkawka/releases](https://github.com/qarmin/czkawka/releases)
# Adding memory usage limits when loading the cache
One of the random errors that sometimes occurred due to the user, sometimes my fault, and sometimes — for example — because a power outage shut down the computer during operation, was a mysterious crash at the start of scanning, which printed the following information to the terminal:
memory allocation of 201863446528 bytes failed
Cache files that were corrupted by the user (or due to random events) would crash when loaded by the bincode library. Another situation, producing an error that looked identical, occurred when I tried to remove cache entries for non-existent or unavailable files using an incorrect struct for reading the data (in this case, the fix was simply changing the struct type into which I wanted to decode the data).
This was a rather unpleasant situation, because the application would crash for the user during scanning or when pressing the appropriate button, leaving them unsure of what to do next. Bincode provides the possibility of adding a memory limit for data decoding. The fix required only a few lines of code, and that could have been the end of it. However, during testing it turned out to be an unexpected breaking change—data saved with a memory-limited configuration cannot be read with a standard configuration, and vice versa.
use std::collections::BTreeMap;
use bincode::{serialize_into, Options};
const MEMORY_LIMIT: u64 = 1024 * 1024 * 1024; // 1 GB
fn main() {
let rands: Vec<u32> = (0..1).map(|_| rand::random::<u32>()).collect();
let btreemap: BTreeMap<u32, Vec<u32>> =
rands
.iter()
.map(|&x| (x % 10, rands.clone()))
.collect();
let options = bincode::DefaultOptions::new().with_limit(MEMORY_LIMIT);
let mut serialized: Vec<_> = Vec::new();
options.serialize_into(&mut serialized, &btreemap).unwrap();
println!("{:?}", serialized);
let mut serialized2: Vec<_> = Vec::new();
serialize_into(&mut serialized2, &btreemap).unwrap();
println!("{:?}", serialized2);
}
[1, 1, 1, 252, 53, 7, 34, 7]
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 53, 7, 34, 7]
The above code, when serializing data with and without the limit, produces two different results, which was very surprising to me because I thought that the limiting option applied only to the decoding code, and not to the file itself (it seems to me that most data encoding libraries write only the raw data to
the file).
So, like it or not, this version (following the path of its predecessors) has a cache that is incompatible with previous versions. This was one of the reasons I didn’t implement it earlier — I had tried adding limits only when reading the file, not when writing it (where I considered it unnecessary), and it didn’t work, so I didn’t continue trying to add this functionality.
I know that for some users it’s probably inconvenient that in almost every new version they have to rebuild the cache from scratch, because due to changed structures or data calculation methods, it’s not possible to simply read old files. So in future versions, I’ll try not to tamper too much with the cache unless necessary (although, admittedly, I’m tempted to add a few extra parameters to video files in the next version, which would force the use of the new cache).
An alternative would be to create a built-in tool for migrating cache files. However, reading arbitrary external data without memory limits in place would make such a tool useless and prone to frequent crashes. Such a tool is only feasible from the current version onward, and it may be implemented in the future.
# Translations in Krokiet
To match the feature set currently available in Czkawka, I decided to try to implement the missing translations, which make it harder for some users, less proficient in English, to use the application.
One might think that since Slint itself is written in Rust, using the Fluent library inside it, which is also written in Rust, would be an obvious and natural choice. However, for various reasons, the authors decided that it’s better to use probably the most popular translation tool instead — gettext, which, however, complicates compilation and almost makes cross-compilation impossible (the issue aims to change this situation — [https://github.com/slint-ui/slint/issues/3715](https://github.com/slint-ui/slint/issues/3715)).
Without built-in translation support in Slint, what seemed like a fairly simple functionality turned into a tricky puzzle of how to implement it best. My goal was to allow changing the language at runtime, without needing to restart the entire application.
Ultimately, I decided that the best approach would be to create a singleton containing all the translation texts, in a style like this:
export global Translations {
in-out property <string> ok_button_text: "Ok";
in-out property <string> cancel_button_text: "Cancel";
...
}
…and use it as
export component PopupBase inherits PopupWindow {
in-out property <string> ok_text <=> Translations.ok_button_text;
...
}
then, when changing the language or launching the application, all these attributes are updated in such a way:
app.global::<Callabler>().on_changed_language(move || {
let app = a.upgrade().unwrap();
let translation = app.global::<Translations>();
translation.set_ok_button_text(flk!("ok_button").into());
translation.set_cancel_button_text(flk!("cancel_button").into());
...
});
With over 200 texts to translate, it’s very easy to make a mistake or leave some translations unlinked, which is why I rely on Python helper noscripts that verify everything is being used.
This adds more code than if built-in support for fluent-rs existed and could be used directly, similar to how gettext translations currently work. I hope that something like this will be implemented for Fluent soon:
export component PopupBase inherits PopupWindow {
in-out property <string> ok_text: u/tr("ok_button");
...
}
Regarding the translations themselves, they are hosted and updated on Crowdin — [https://crowdin.com/project/czkawka](https://crowdin.com/project/czkawka) — and synchronized with GitHub from time to time. For each release, several dozen phrases are updated, so I’m forced to use machine translation for some languages. Not all texts may be fully translated or look as they should, so feel free to correct them if you come across any mistakes.
# Improving
So, like it or not, this version (following the path of its predecessors) has a cache that is incompatible with previous versions. This was one of the reasons I didn’t implement it earlier — I had tried adding limits only when reading the file, not when writing it (where I considered it unnecessary), and it didn’t work, so I didn’t continue trying to add this functionality.
I know that for some users it’s probably inconvenient that in almost every new version they have to rebuild the cache from scratch, because due to changed structures or data calculation methods, it’s not possible to simply read old files. So in future versions, I’ll try not to tamper too much with the cache unless necessary (although, admittedly, I’m tempted to add a few extra parameters to video files in the next version, which would force the use of the new cache).
An alternative would be to create a built-in tool for migrating cache files. However, reading arbitrary external data without memory limits in place would make such a tool useless and prone to frequent crashes. Such a tool is only feasible from the current version onward, and it may be implemented in the future.
# Translations in Krokiet
To match the feature set currently available in Czkawka, I decided to try to implement the missing translations, which make it harder for some users, less proficient in English, to use the application.
One might think that since Slint itself is written in Rust, using the Fluent library inside it, which is also written in Rust, would be an obvious and natural choice. However, for various reasons, the authors decided that it’s better to use probably the most popular translation tool instead — gettext, which, however, complicates compilation and almost makes cross-compilation impossible (the issue aims to change this situation — [https://github.com/slint-ui/slint/issues/3715](https://github.com/slint-ui/slint/issues/3715)).
Without built-in translation support in Slint, what seemed like a fairly simple functionality turned into a tricky puzzle of how to implement it best. My goal was to allow changing the language at runtime, without needing to restart the entire application.
Ultimately, I decided that the best approach would be to create a singleton containing all the translation texts, in a style like this:
export global Translations {
in-out property <string> ok_button_text: "Ok";
in-out property <string> cancel_button_text: "Cancel";
...
}
…and use it as
export component PopupBase inherits PopupWindow {
in-out property <string> ok_text <=> Translations.ok_button_text;
...
}
then, when changing the language or launching the application, all these attributes are updated in such a way:
app.global::<Callabler>().on_changed_language(move || {
let app = a.upgrade().unwrap();
let translation = app.global::<Translations>();
translation.set_ok_button_text(flk!("ok_button").into());
translation.set_cancel_button_text(flk!("cancel_button").into());
...
});
With over 200 texts to translate, it’s very easy to make a mistake or leave some translations unlinked, which is why I rely on Python helper noscripts that verify everything is being used.
This adds more code than if built-in support for fluent-rs existed and could be used directly, similar to how gettext translations currently work. I hope that something like this will be implemented for Fluent soon:
export component PopupBase inherits PopupWindow {
in-out property <string> ok_text: u/tr("ok_button");
...
}
Regarding the translations themselves, they are hosted and updated on Crowdin — [https://crowdin.com/project/czkawka](https://crowdin.com/project/czkawka) — and synchronized with GitHub from time to time. For each release, several dozen phrases are updated, so I’m forced to use machine translation for some languages. Not all texts may be fully translated or look as they should, so feel free to correct them if you come across any mistakes.
# Improving
GitHub
Add support for translations without gettext · Issue #3715 · slint-ui/slint
We need to support user changing translations through the interface, as well as translation on platform that do not have gettext (MCU) The idea would be somehow to have API to provide a translator....