Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)DO
Posts
16
Comments
155
Joined
2 yr. ago
Zed @programming.dev
Doods @infosec.pub

Hiding the title bar, I did it.

I hardcoded size and position values in Sway to hide it outside the screen.

Here they are for 1366x768:

 undefined
    
for_window [app_id="dev.zed.Zed"] floating enable, \
                                    resize set width 1387 px, \
                                    resize set height 830 px, \
                                    move position -15 -75


bindsym $mod+2 workspace number 2, \
    for_window [app_id="dev.zed.Zed"] floating enable, \
                                        resize set width 1387 px, \
                                        resize set height 810 px, \
                                        move position -8 -60

  

This won't work unless I keep Zed in workspace 2 though.

If I don't re-run the command when switching workspaces Zed changes position and breaks my hack. There should be a better solution to the workspace problem.

Edit: I know I input different values in both cases, but it doesn't work otherwise.

Rust @programming.dev
Doods @infosec.pub

Auto debloat unused pub items from dependencies.

I shaved off 10 MiB from my binary in 2 hours!

I made a program using Macroquad, then I built it in release mode, the binary was 63 MiB in size.

So I used cargo vendor to have a better look at Macroquad and one of its dependencies, glam.

I then started to delete code, like, lots and lots of code(about 30_000 lines of code); none of it affected my main project, some of it became 'dead_code' just by removing the pub keyword.

The result is that my project was unaffected and the binary went down to 52 MiB.

Is there a way to automate removal of unneeded elements from dependencies? This is potentially huge.

EDIT: I FIGURED IT OUT!!!

My mistake was measuring the size of "target/release", I discovered that that folder contains many "unnecessary" files, like "deps", which greatly bloat the folder'r size, the actual size of my binary is 864K.

I am so relieved.

Pop!_OS (Linux) @lemmy.world
Doods @infosec.pub

24.04 repos on 22.04?

How safe it is to upgrade to Pop!_OS 24.04 by manually editing /etc/apt/sources.list (or whatever it was).

I tried doing it and running sudo apt update, and nothing suspicious seemed to appear. I used the Ubuntu 24.04 repos.

It is worth nothing that I have ran sudo apt remove with the --allow-remove-essential flag; I did it long ago to remove some "bloat".

I want to upgrade; 22.04 is so old Debian stable is more up-to-date. There are also bugs with Sway and Mangohud that I am interested in getting rid of.

I am uninterested in the Rust desktop.

  • If you only need it for the interface, a shit workaround would be to prefix all text with an RLM (RIGHT-TO-LEFT Mark).

    Unfortunately no, I expect users to enter Arabic text as well.

    Fast iteration is already fixed by using cranelift in your release-dev profile (or whatever you want to call it), and mold as a linker.

    Maybe, I didn't try that before, but I don't expect Cranelift to match the speeds gtk-rs is currently giving me; Cranelift also doesn't solve the problem of rust-analyzer acting crazy.

    Okay, something helpful instead: Did you try asking in the rust:gnome.org matrix room mentioned in the project page?

    No, I prefer public posts to prevent effort duplication, so much so that my mind started filtering out such things on project pages, but thanks for reminding me.

  • Before anyone suggests another library:

    • Iced and Egui both can't handle Arabic, which is a deal breaker.
    • Iced takes forever to compile and iterate, maybe that'll be fixed with dynamic linking.
    • Relm: I didn't know it existed before I started this project.
    • Qt bindings: IDK I forgot Qt existed, I was always more of GNOME* guy.
    • I am already pretty deep into this project, and don't want to learn something else for now.

    GNU Network Object something Environment

  • Rust @programming.dev
    Doods @infosec.pub

    gtk-rs change widget appearance at runtime.

    It might be lack of sleep, but I can't figure this out.

    I have a Label, and I want its text to be red when it represents an error, and I want it be green when it represent "good to go".

    I found search result for C and maybe a solution for Python, but nothing for Rust.

    I tried manually setting the css-classes property and running queue_draw(); it didn't work.

    I can have a gtk::Box or a Frame that I place where the Label should go, then declare two Labels, and use set_child() to switch between them, but that seems like an ugly solution.

    Do you have a solution?

    SOLVED:

    I have to add a "." before declaring a CSS "thing" for it to be considered a class.

    Ex:

     undefined
        
    .overlay {
            background: rgba(60, 60, 60, 1);
            font-size: 25px;
    }
    
    
      

    instead of:

     undefined
        
    overlay {
            background: rgba(60, 60, 60, 1);
            font-size: 25px;)
    }
    
      

    Just use label.add_css_class(), label.remove_css_class() or label.set_css_classes() and make sure to properly load your

    Rust @programming.dev
    Doods @infosec.pub

    rust_analyzer takes forever to load; cargo check is instant.

    I was using Iced as a dependency, but wanted to tweak its source code for some reason, so I jumped into the folder where cargo downloads dependencies, and went into iced_wgpu 13.5 (I think that's the version).

    I could make a change, then run

    cargo clean -p iced_wgpu && cargo check

    in my other project for instant feedback, yet it took rust_analyzer at least 5 whole minutes to stop hallucinating.

    Can I disable some functionality of rust_analyzer? I only use it for jump-to-definition, linting and syntax highlighting; I don't even use autocomplete.

    Setup:

    • Desktop that thermally throttles only when both the IGPU and the CPU are under full load, and is cool otherwise.
    • CPU: Intel I5-7500
    • RAM: 8 GiB DDR-4
    • Editor: NVIM v0.11.0-dev | Build type: RelWithDebInfo | LuaJIT 2.1.0-beta3 (I had the same issue with other versions as well).

    TLDR

    What can I disable in rust_analyzer to boost performance while maintaining jump-to-definition, linting and syntax-highlighti

  • Oh no don't get me wrong, a year back I upgraded to an I5-7500 prebuilt, and it's a beast for all my tasks. (maybe compiling is quick because I split modules a little too much?)

    Your advice is good for not knowing what I'm making. If I was making something multi threaded with much state I would fear UB more.

    may be much rarer in Debug because of speed difference

    Thanks, then I will remember to recreate bugs with opt-level = 3.

    Wait no, this doesn't make sense if I don't have access to the user's machine, maybe I should send him a log-heavy version of some sort? How should I even what I am supposed to log? I should think about this some more before release.

  • Do you have any sources about this “unfitness” of Rust for gamedev? From my experience many people have problems with the borrow checker due to habits they obtained coding in other languages.

    I can't say anything for sure, but I read this article, in conjunction with this article, before I made this post, so you might consider looking at it, and how it influenced me.

    Edit: wait, I'll extend this reply even more.

    Edit 2: Done:

    So I’d be interested what special behavior occurs in gamedev that makes coding in Rust more difficult than for other software.

    Maybe it's because the gaming industry is historically among the slowest industries, they stuck with DOS until there was literally no drivers on it for the latest GPUs, only then did they upgrade. There's a video explaining how a recent AAA game could run on the steam deck, but not on Linux, it turns out the game was using a Windows XP library that's too old for wine to support, so how did it work on the deck? they effectively added this to their code:

     undefined
        
    if platform_name == "steamdeck" { use_modern_library() }
    
      

    , which explains why it only ran on the deck, but notice how they still stuck to the ~2003 library as the default even though the modern one works, that's how much they hate change.

    Considering the above, suggesting they change the particular way of their forefathers wouldn't be fruitful, unless extremely obvious B I G gains are to be found. Notice how Jonathan Blow's game development language is literally 'C++ but better', and how it mimics C++ in everything but the universally hated parts, and adds none but the universally wanted features. (as universal as an industry can agree on anything, that is)

    That may be because games are a dangerous business, you pool all your resources in one project, and you get basically no income for up to four years, then you release and possibly succeed.

    I also speculate that games aren't really maintained, most of the best games I know only received 3 patches at most (version 1.3). I think the priority isn't: "How am I gonna remember how this works in 3 months from now and deal with technical dept", it's more like: "How can I implement this in a way that the only thing faster than the implementation time is the feature itself?", so there is no fear of possibly breaking something that the checker can save you from down the road.

    The last sentence kinda doesn't make sense since the first 3 years are more that enough technical dept for Rust to start doing its thing, but IDK how they think.

    Bonus: look for Jonathan Blow's opinions on Rust on Youtube, he is an example of a studio owner fearing the risk of the possible "friction" that the Borrow checker could possibly cause.

  • Hello Pers,

    I made a mistake when writing the post, it reads like I am against the borrow checker, which I am not, I love the checker, and didn't encounter any - major - problems with it.

    I meant that even if we used unsafe everywhere it would still be a good language, which is an attempt at arguing with those saying that Rust isn't fit for gamedev because the of the checker. Which I failed at due to lack of experience, as this is my first time making a game, and Rust is my first language*.

    Regarding: "If it doesn't panic in Debug, it won't act weird on Release", even if I got reported a really weird bug related to UB, I should (I am not experienced enough to make a claim) be able to know it's UB since the game's gonna crash when I try to recreate the bug in Debug.

    Some would say that shipping the game with runtime checks won't have an effect on performance, which is probably true, since it's so simple the list of entities is an array (not a vector), and the game state is - effectively - global (everything is impl CombatContext { fn x(&mut self) {} }), and some (most? too early in development to tell) of the game is locked at 5fps (maybe I'll bump it up a bit)***.

    I am so concerned about performance because I had to daily drive a computer that most people on this website - and especially on Reddit - would consider garbage E-waste, for 4 years, and was trying hard to play games on it, which was further amplified by my GPU not supporting Vulkan (nor Dx9 for some time), which meant I couldn't use Proton, which taught me some hacks that are... let's not talk about them.

    So I find huge pain in leaving any possible performance optimizations, especially that some people I know are stuck on - arguably - worse machines****; accessibility is a big priority.

    It also makes me angry to see pixel games come with 70Mib binaries and require Vulkan because:

    1 - internet costs money

    2 - they claim in the system requirements that their game "Should run on anything".

    Memes like: "Oh my game could run on a potato" infuriate me (good thing I don't use social media), NO, your game can't run a potato, DooM can, it was actually optimized properly, your 2D pixels can't even render on a machine a 100x more powerful, you should feel ashamed*(5).

    *: I was messing around with C# + Godot not super long ago, nothing serious.

    **: I have been refactoring my code lately to limit the scope of most functions, in a way inspired by ECSs, but significantly more primitive.

    ***: the game has both a 3D and a 2D part, the 2D part has locked FPS, the 3D part can run at any framerate.

    ****: Macroquad supporting OpenGL only down to 2.0ES would be a problem, if I wasn't intending on forking it anyway to reduce the binary size (grim is an extremely bloated dependency, I managed to shove off 10 Mib in a few hours), and unless using 1.x is as hard people on the internet claim it is, which is probably false, as these people are mostly weak and say the same things about using a custom engine.

    *(5): this might sound toxic, but that's how people get better.

  • Rust @programming.dev
    Doods @infosec.pub

    Debug-time enforcement of borrowing rules, and safety in general.

    Another crazy idea I share with this website.

    I was developing a game and an engine in Rust, so I was reading many articles, most of which criticize the 'borrow checker'.

    I know that Rust is a big agenda language, and the extreme 'borrow checker' shows that, but if it weren't for the checker, Rust would be a straight-up better C++ for Game development, so I thought: "Why not just use unsafe?", but the truth is: unsafe is not ergonomic, and so is Refcell<T> so after thinking for a bit, I came up with this pattern:

     undefined
        
    let mut enemies = if cfg!(debug_assertions) {
        // We use `expect()` in debug mode as a layer of safety in order
        // to detect any possibility of undefined bahavior.
        enemies.expect("*message*");
        } else {
        // SAFETY: The `if` statement (if self.body.overlaps...) must
        // run only once, and it is the only thing that can make
        // `self.enemies == None`.
        unsafe { enemies.unwrap_uncheck
      
  • bad hygiene (for olodumarè’s sake, bathe daily, and if possible brush your teeth at least twice a day).

    I know this is popular in this thread, but how to achieve that? I shower 0-3 a day, with 0 being in days waiting for the washing machine for I have showered too much, and have no clothes remaining.

    It seems no matter what I do, someone thinks I accidentally opened a shower on myself by how sweaty wet my underwear is, then proceeds to tell me I smell awful and banishes me from society back to my computer, which is what I would be doing anyway, also that person is the only one that complains and they (singular) can't handle heat at all.

    I just checked and the temperature goes up to 42*, I don't know how hot that is, since I never look at weather, if it's hot I bear with it, if it's cold I get sick for 3 days bear with it.

    Also I only wear winter-y jackets for some reason (A joke that went too far that's been lasting for 3 years?), people underestimate how good they are at shading, and they come with a built-in hat, and protect your body better than any T-shirt ever could.

    Wait did I just answer my own question?

  • It's hard to answer your request because, you see, your statement is like saying: "Everything is just atoms, so everything is basically the same", it is "reductionist" of higher values, which even atheists have, but the statement itself cannot be denied, nor replaced with an alternative.

    Edit: I read your other replies, and you seem to not need this one, to ignore it.

  • Pop!_OS (Linux) @lemmy.world
    Doods @infosec.pub

    My libcosmic calculator is now an MVP.

    I have written a calculator in Rust and libcosmic, the design is copied from gnome-calculator; I discovered 2 things:

    1. I don't like working on UIs.
    2. I have no idea how to transform

    cosmic::widget::button::Builder

    to

    cosmic::widget::Button;

    this code would be so much cleaner if I could return a button::standard() from a function.

    The source code.

    Linux @lemmy.ml
    Doods @infosec.pub

    Linux kernel Rust coding guidelines are heretic.

    Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

    I am in love with this awsome document; I love its guidelines, and coding conventions.

    However, when Rust was introduced into the kernel, they butchered these beautiful guidelines, I know it's hard to look at such heretic actions, but you have to see this:

    The default settings of rustfmt are used. This means the idiomatic Rust style is followed. For instance, 4 spaces are used for indentation rather than tabs.

    How can this even relate to the ideology of the first document? I am deeply saddened by these new rules.

    I know this is "The Rust experiment", but this must be fixed before it's too late! This has to reach someone.

    A counter-a

    Programmer Humor @lemmy.ml
    Doods @infosec.pub

    I pulled this from a shop.

    MineClone2 @lemmy.world
    Doods @infosec.pub

    A Mineclone 2 texture pack ripped from Minecraft.

    This texture pack, called Minecraftclone, is the best MC texture pack for MCL out there, because the only competition is NS-textures and this one which doesn't have a download link.

    All the textures are taken from Minecraft 1.20 except for:

    • Horses, taken from 1.12
    • Bells*
    • Any feature not present in vanilla MC*

    *: They are taken from mods with varying levels of editing done by me.

    This pack supports the following mods:

    • MineClone2 Emerald Stuff
    • More Ores*
    • Technic*

    *: Partial support

    This pack is a work-in-progress, and lacks:

    • Most trims.
    • Lectern.
    • Brewing Stand.
    • Sun & Moon

    https://mega.nz/file/mcI1BIoI#jSB-T5RsZXzNpue4OEr_LQwZcEAbh-e_MOqbsFVT7SU

    Keywords for search engines to increase visibilty:

    • Minecraft textures for Mineclone
    • MC textures for MCL
    • Minecraft texture pack for Mineclone

    I am also planning promote the pack on r/Minetest if this post fails t

    Linux Gaming @lemmy.world
    Doods @infosec.pub

    Running double-clicked EXEs with wine-GE instead of wine?

    I have a huge library of game EXEs on my computer, but they run at a 4:3 aspect ratio as they're old, Proton/Proton-GE/WINE-GE keep the aspect ratio and place black bars left and right, which is desireble, unlike wine who stocks them to the left side of the screen.

    Do It Yourself @beehaw.org
    Doods @infosec.pub

    Update, the Joysticks now work with a much needed cable length improvement.

    I might clean under a non-functioning button after this.

    I used an old charging cable with a broken micro USB port.

    Do It Yourself @beehaw.org
    Doods @infosec.pub

    Is this fixable?

    My 9yr old sister felt something is preventing her leg from moving, so she used violence.

    A joystick USB cable.

    *Without buying - or ripping off - another USB head of course.

    Gaming @beehaw.org
    Doods @infosec.pub

    Pirating games you own?

    This might seem stupid, but hear me out.

    Fallout 3 on Epic is 39 GiB, the reason for that huge size is you're forced to download all the language packs, same story for Tomb Raider and FFXIII.

    As someone with a monthly data limit of 140 Gib, and who has to share it with a family, these - unnecessary - download sizes are unacceptable and make me want - and plan - to pirate the game -which even though I didn't play for I still legally own*- and only having to download 7 GiB.

    I would've complained about disk space but you can just remove the extra languages conveniently located in saperate folders**.

    This also applies to single player games with privacy-invasive DRM and usability-hurting DRM***, and for people who hate the idea of DRM in general.

    *Own as a service and a using license.

    **Unless you are tight on disk space and cannot fully download the game before removing the files.

    **DOOM 2016 didn't work on Linux duo to the DRM being incompatible with proton.

    Linux Gaming @lemmy.world
    Doods @infosec.pub

    Games take forever to load in heroic

    I made a git hub issue, but I want to ask here as well in hope of finding success

    After running heroic in the terminal, the following thing catchs my eye: The terminal hangs at either

    [Backend]: Running Wine command: wineboot --init or [Legendary]: Using cached install info or ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 -and 2 &amp; 3- times!

    sometimes I get a notification to install mono when switching WINE versions (WINE-GE).

    Somewhere along the loading process a "wineboot.exe" blank windows appears depending on the wine version (heppens with proton) and stays for a while. I am using Wine-GE

    Things I tried:

    -Deleting the "Games" folder in my home folder - Only heroic used it anyway.

    -Adding the game to steam through Heroic's "Add to steam" button.

    -Reinstalling heroic and all of its dependencies.

    -Manually adding the game's EXE to

    Linux @lemmy.ml
    Doods @infosec.pub

    Compact view in Nautilus (Gnome's file manager)

    Is there a way to achieve compact view in Nautilus?

    I have always used Nemo (Cinnamon's file manager) on Gnome to achieve said functionality, but it looks alien compared to the rest of the Desktop and therefore I want to use Nautilus.

    (Picture: compact view in Nemo, I found said picture online)