• 4 Posts
  • 54 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle






  • Just go ahead and write a very basic working kernel in rust.

    I don’t get this stance, really. If I want to write a driver in Rust I should start by creating a completely new Kernel and see if it gains momentum? The idea of allowing Rust in kernel drivers is to attract new blood to the project, not to intentionally divert it to a dummy project.

    Rust is sufficiently different that you cannot expect C developers to learn rust to the level they have mastered C

    If you watch the video, no one asked anything from the C developers other than documentation. They just want to know how to correctly make the Rust bindings.

    Note that Rust is not replacing C code in the Kernel, just an added option to writing drivers.









  • My system:

    My waybar dotfiles. You can create/edit these files with whatever text editor you like, you don’t need the terminal. Please note that for some reason Lemmy screws up the “&” when pasting code… Please replace all “&” with “&”.

    ~/.config/waybar/config (note: remove custom/gpu-util if you don’t have a nvidia video card, or change the command to whatever is the AMD equivalent)

    {
        "layer": "top",
        "position": "top",
        "modules-left": [
            "hyprland/workspaces"
        ],
        "modules-center": [
            "hyprland/window"
        ],
        "modules-right": [
            "cpu",
            "custom/gpu-util",
            "network#wifi",
            "pulseaudio",
            "clock",
            "tray",
            "custom/notification"
        ],
        "hyprland/workspaces": {
            "format": "{id}",
            "on-click": "activate",
            "sort-by": "number",
            "persistent-workspaces": {
                "*": 3
            },
            "all-outputs": false
        },
        "clock": {
            "format": "{:<span></span> %I:%M %p, %a %d}",
            "format-alt": "{:📅 %B %d, %Y}",
            "actions": {
                "on-click": "mode"
            },
            "tooltip": false
        },
        "cpu": {
            "interval": 5,
            "format": "<span>󰍛</span> {usage:2}%",
            "tooltip": false
        },
        "custom/gpu-util": {
            "exec": "echo $(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits)",
            "format": "<span>󰘚</span> {}%",
            "interval": 5,
            "tooltip": false
        },
        "network#wifi": {
            "interval": 1,
            "interface": "wlan0",
            "format-icons": [
                "󰤯",
                "󰤟",
                "󰤢",
                "󰤥",
                "󰤨"
            ],
            "format-wifi": "<span>{icon}</span> {signalStrength}%",
            "format-ethernet": "󰈀",
            "format-disconnected": "<span>󰤮 </span>",
            "tooltip": true,
            "tooltip-format-wifi": "<span>{icon}</span> {essid} ({signalStrength}%)"
        },
        "tray": {
            "spacing": 12
        },
        "pulseaudio": {
            "format": "<span>{icon}</span> {volume}%  {format_source}",
            "format-bluetooth": "<span>{icon}</span> {volume}%  {format_source}",
            "format-bluetooth-muted": "<span>󰖁</span>  {format_source}",
            "format-muted": "<span>󰖁</span>  {format_source}",
            "format-source": "<span></span> {volume}%",
            "format-source-muted": "<span></span>",
            "format-icons": {
                "headphone": "",
                "phone": "",
                "portable": "",
                "default": [
                    "",
                    "",
                    ""
                ]
            },
            "on-click": "pavucontrol",
            "input": true
        },
        "custom/notification": {
            "tooltip": false,
            "format": "{icon} {}",
            "format-icons": {
                "notification": "<span></span><span><sup></sup></span>",
                "none": "",
                "dnd-notification": "<span></span><span><sup></sup></span>",
                "dnd-none": "",
                "inhibited-notification": "<span></span><span><sup></sup></span>",
                "inhibited-none": "",
                "dnd-inhibited-notification": "<span></span><span><sup></sup></span>",
                "dnd-inhibited-none": ""
            },
            "return-type": "json",
            "exec-if": "which swaync-client",
            "exec": "swaync-client -swb",
            "on-click": "sleep 0.1 &amp;&amp; swaync-client -t -sw",
            "escape": true
        },
        "hyprland/window": {
            "separate-outputs": true,
            "max-length": 100
        }
    }
    

    ~/.config/waybar/style.css

    /**
     * Global Colors
     */
    @define-color bg #434C5E;
    @define-color bg_lighter #546484;
    @define-color fg #D8DEE9;
    @define-color red_warn #BF616A;
    
    
    /**
     * Global style
     */
    * {
    	font-size: 14px;
    	font-family: JetBrains Mono Nerd Font, Font Awesome, sans-serif;
        font-weight: bold;
        border-radius: 5px;
        color: @fg;
        border: 0px;
    }
    
    
    /**
     *  Bar
     */
    #waybar {
    	background-color: rgba(46, 52, 64, 0.6);
        border-radius: 0;
    }
    
    /**
     * Default module styles
     */
    #window,
    #custom-packages,
    #memory,
    #clock,
    #custom-gpu-util,
    #cpu,
    #gpu-util
    #disk,
    #battery,
    #network,
    #tray,
    #pulseaudio,
    #custom-notification {
        background: @bg;
        margin: 5px;
        padding: 2px 10px;
    }
    
    
    /**
     * WORKSPACES module specific style
     */
    #workspaces {
    	background: @bg;
        margin: 5px 3px 5px 12px;
        padding: 0px 2px;
        font-style: normal;
    }
    
    #workspaces button {
        padding: 0px 8px;
        margin: 4px;
        background-color: @bg_lighter;
        opacity: 0.7;
        transition: all 0.3s ease-in-out;
    }
    
    #workspaces button.active {
        background: @red_warn;
        min-width: 40px;
        transition: all 0.3s ease-in-out;
        opacity: 1.0;
    }
    
    #workspaces button:hover {
        background: @red_warn;
        opacity: 1.0;
    }
    
    
    /**
     * Tooltip style
     */
    tooltip {
      background: @bg;
      border: 1px solid @bg_lighter;
      opacity: 0.9;
    }
    
    tooltip label {
      color: @fg;
    }
    

  • From my personal experience, Tiling WM managers are a lot of work to setup. It’s not difficult to configure them, but they just come with REALLY barebones and honestly unusable defaults. There’s a lot to configure, which means a lot of documentation to learn. It doesn’t “just works”, you have to spend several hours to find out what works for you and figure how to make it work. That said, I had never tried a tiling WM before and managed to make it work just fine. It’s not hard, it’s just work.

    The easiest and fastest way to do this is start with someone else’s configuration. I started with Zaney’s dotfiles as they provided some good and USABLE defaults.

    Packages that I’m using:

    • Hyprland - my WM of choice, mostly because it’s pretty and very easy to configure

    • Waybar - You mentioned “like waybar”, I’m not sure you have anything against it or not. I really like waybar because configuration is a basic json file and styling is a basic CSS file. It’s very easy to work with, very easy to create your own customization. A few waybar “modules” that I recommend

      • nm_applet - A “system tray” network applet which integrates very easily and nicely to waybar. It allows you to configure your wi-fi/network without the command line.

      • swaync - Hyprland does not have a notification system, you need to install one. swaync is very nice and integrates perfectly into waybar

    • For a KRunner like tool, I use Tofi. Zaney recommended it, I don’t know many alternatives. Like many of these applications, the default aesthetics are really bad. Tofi in particular has atrocious defaults. Absolutely awful. The software itself runs quite well, it’s fast and can have a lot more useful applications than just running tools. Not sure why they don’t have a decent theme out of the box, it’s not that hard.

    • I have wl-clipboard installed. Not really a clipboard manager but sometimes I have troubles where some xwayland apps don’t have access to my clipboard. It’s weird. wl-paste | xclip -selection clipboard solves it.

    • For managing wallpapers I use swww. I don’t look at my wallpaper all that much, so I don’t have anything too fancy. I don’t change them often, this tool is more than enough for me. An overkill for my use-case.

    • I suggest you use nerd-fonts, whatever one you like. Personally I really like the JetBrains Mono Nerd Font.