Alphenex53

joined 1 week ago
[–] Alphenex53@programming.dev 4 points 6 days ago* (last edited 6 days ago)

I use Helix + Markdown + Zettelkasten + Git + Codeberg for notes. I just wrote a script whenever I type ns to the terminal I go to the Notes directory and it creates a process that git pulls in the background. I also add a half a second delay to opening Helix so HOPEFULLY by the time I write to the notes they are updated. As for backups, I was using Timeshift but it just uses too much space so I just got rid of it. I am just being careful when deleting files and directories.

 

This is just for discovering new software. I created mine so I don't forget the programs I use when setting up a new machine. You can skip the obvious ones. Here, I'll start:

# System
Distro: Arch Linux
Window Manager: i3
Shell: Zsh (OMZ)
Terminal: Kitty
Terminal Multiplexer: Tmux
Application Launcher: Rofi
Notification: Dunst
Compositor: Picom
Panel: Polybar
Audio: Pipewire

# The Web
Web Browser: Librewolf, Helium
Chat: Discord, Element
Mesh VPN: Zerotier
DPI Bypass: B4

# File Management
File Browser: Thunar, Yazi
File Sharing: LocalSend
Torrent: qBitTorrent
Git CLI: Lazygit

# File Creation/Modification
Text Editor: Micro
Code Editor: Helix, Zed
LaTeX Editor: Gummi
Image Editor: GIMP, Krita
Video Editor: Kdenlive, Blender
Audio Editor: Audacity
Modelling: Blender
Document Editor: LibreOffice, Xournal++
Image Upscaler: Upscayl

# File Viewing
Music Player: Strawberry
Media Player: MPV
Image Viewer: Ristretto
Document Viewer: Papers

# Utility
Screenshotter: Flameshot
Pipewire Graph: QPWGraph
Video Recorder: OBS
Color Picker: XColor
Default Apps: Selectdefaultapplication
Clipboard History: greenclip
Dotfile Manager: yadm
Network TUI: impala, nmtui
Bluetooth TUI: bluetui
Volume TUI: wiremix
Disk Analyzer: ncdu
Wallpaper: xwallpaper
Chooser: choose
Markdown Renderer: glow

# Gaming
Game Launcher: Steam, Faugus, Prism, Sober
Proton Manager: ProtonUp-QT

# Productivity
Flashcard: Anki
Whiteboard: Drawy
[–] Alphenex53@programming.dev 2 points 6 days ago* (last edited 6 days ago)

Not a problem directly with the distro itself but; Void Linux. The community can be really hostile over small things, when you are following along the road they laid they are very friendly. However, as soon as you mention someone they dislike, criticize the distro and request for something that doesn't align with them you get a lot of backlash. I remember asking them to create official Void Linux Discord server on Reddit because Reddit was the platform devs were using. I got attacked because apparently Matrix is FOSS and it was ridiculous for suggesting that bla bla bla. Another one was, I shared my Void Linux rice and it was nice at first then somebody noticed the based.cooking bookmark on my browser and then my post got deleted. I don't even follow Luke Smith I just found the website on one of his videos while learning about Linux. Besides all that, there are very little packages and they intentionally won't add some packages due to political reasons, why the fuck would I want your political stance to affect my experience. If I wanted oppression in my OS I would rather use Windows or Mac, at least I would have more programs there. Sorry for the wall of text, just puking fair dislike ^^

[–] Alphenex53@programming.dev 2 points 1 week ago (1 children)

You can try this I kinda half-arsed it though. I personally could not see the issue in your code other than the fact that you are writing bad/ugly code. I don't mean it in a rude way, you should read other people's code and understand the conventions. Besides that, I think the issue is with the delays.

// This is a lot more understandable now
#define ENTRY_FINISH_PIN 8
#define ENTRY_NUMBER_PIN 9
#define ENTRY_REPORT_PIN 13

#define ENTRY_DELAY_MS 500
#define ENTRY_REPORT_SHOW_MS 500
#define ENTRY_REPORT_WAIT_MS 100

int GetNumber()
{
    // loop until ENTRY_FINISH_PIN is HIGH
    // if ENTRY_NUMBER_PIN is HIGH, add to the iterant and turn on the LED
    // after that wait a bit and turn off LED
    
    int iterant = 0;
    while (digitalRead(ENTRY_FINISH_PIN) != HIGH) {
        if (digitalRead(ENTRY_NUMBER_PIN == HIGH)) {
            iterant++;

            digitalWrite(ENTRY_REPORT_PIN, HIGH);
        }

        delay(ENTRY_DELAY_MS);
        digitalWrite(ENTRY_REPORT_PIN, LOW);
    }
    
    return iterant;
}

void setup()
{
    pinMode(ENTRY_FINISH_PIN, INPUT);
    pinMode(ENTRY_NUMBER_PIN, INPUT);
    pinMode(ENTRY_REPORT_PIN, OUTPUT);
}

void loop()
{
    int sum = GetNumber() + GetNumber();

    for (int i = 0; i < sum; i++) {
        digitalWrite(ENTRY_REPORT_PIN, HIGH);
        delay(ENTRY_REPORT_SHOW_MS);
        digitalWrite(ENTRY_REPORT_PIN, LOW);
        delay(ENTRY_REPORT_WAIT_MS); // waiting a bit more makes sense imo
    }
}

I wish u luck with your Arduino adventure ^^

[–] Alphenex53@programming.dev 2 points 1 week ago (10 children)

Genuine question, why would I need a terminal multiplexer when I am using a tiling window manager? I saw a lot of people using them in normal desktop environments which makes sense but why in a tiling window manager?

[–] Alphenex53@programming.dev 1 points 1 week ago

It is just preference and consistency with other APIs imo. However, personally when I see LEDEnable or LEDDisable I feel like a teeny tiny bit more will happen inside the function meanwhile LEDState is like only changing a variable or something. Also I would like LED_Set(bool enabled) or if there are more LED_SetEnabled(bool b) better.

[–] Alphenex53@programming.dev 2 points 1 week ago (1 children)

I wish that is how the world worked. They are either gonna think I am a paranoid weirdo and not do it or reluctantly install it ONLY for me.

[–] Alphenex53@programming.dev 2 points 1 week ago* (last edited 1 week ago)

TBF it is not complicated but it does use the simplest form of pointer arithmetic and order of operation of (++var) or (*var++). Considering OP couldn't write a basic version of this I did not want to put pressure on him. If you can understand it as a beginner good for you! You must remember that a lot of developers struggle to learn pointers in the first place for some reason. I blame AI.

EDIT: Also I did not say this is advanced, just not beginner friendly

[–] Alphenex53@programming.dev 2 points 1 week ago (3 children)

I think you are forgetting that in a lot of countries overwhelming majority of the population uses Whatsapp for communication and you can't do anything about it.

[–] Alphenex53@programming.dev 2 points 1 week ago* (last edited 1 week ago) (2 children)

It is not beginner friendly but it is optimized. It doesn't allocate memory or whatever. I don't expect you to understand all this but I did it for fun anyway.

int print_file(const char* buffer)
{
    // Validate the buffer
    if (!buffer || *buffer == '\0') return 1;

    // Prepare the first line prefix
    unsigned int line = 1;
    printf("%4d\t", line); // You could pre-format it if u want

    const char* cursor = buffer; // The pointer that points to the first char
    const char* linestart = cursor; // The start of the line
    char ch; // Character register

    while (true) {
        ch = *cursor++; // Read character THEN advance the cursor.

        // Check if the character is null or is newline or windows thing

        if (ch == '\0') {
            int linelength = cursor - linestart - 1; // Minus the null terminator
            printf("%.*s\n", linelength, linestart); // Print line using the length of string
            break;
        } else if (ch == '\n') {
            int linelength = cursor - linestart - 1; // Minus the newline
            printf("%.*s\n", linelength, linestart); // Print line using the length of string
            linestart = cursor;

            printf("%4d\t", ++line); // Print next line prefix
        } else if (ch == '\r') {
            continue; // Ignore the Windows thing
        }
    }
    
    return 0;
}