Hyprland (Wayland)

It’s me again… anyone have hyprland dotfiles they are proud of and willing to share? Yep, I’m on a Wayland journey/ adventure. TIA

@manyroads, are you blacklisted from search engine sites?

1 Like

My Hyprland configuration

Install grim, slurp, and cliphist.

Enabled blur, drop shadow, opacity, animations with bouncing effect and it is optimized to minimum system resource usage .

hyprland.conf
########################################################################################
AUTOGENERATED HYPR CONFIG.
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
########################################################################################

#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
#autogenerated = 1 # remove this line to remove the warning

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto


# See https://wiki.hyprland.org/Configuring/Keywords/ for more

### Execute your favorite apps at launch
# exec-once = conky  
# exec-once = hyprpaper
# exec-once = pkill swaybg | sleep 0.5 && swaybg -o "HDMI-A-2" -m fill -i ~/Pictures/wallpapers/$(ls ~/Pictures/wallpapers|shuf -n 1)
# exec-once = pkill swaybg | sleep 0.5 && swaybg -i ~/Pictures/wallpapers/$(ls ~/Pictures/wallpapers|shuf -n 1) -m fill
# exec-once = /home/qtiler/scripts/autoswitch.sh 
 exec-once = /home/qtiler/scripts/random_background.sh
 exec-once = waybar & dunst & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
 exec-once = /home/qtiler/scripts/conky_start.sh
 exec-once = nm-applet
 exec-once = wl-copy --type text --watch cliphist store # clipboard store text data
 exec-once = wl-copy --type image --watch cliphist store # clipboard store image data
 exec-once = wl-paste --type text --watch cliphist store # clipboard store text data
 exec-once = wl-paste --type image --watch cliphist store # clipboard store image data


### Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf

# Some default env vars.
env = XCURSOR_SIZE,24
env = GTK_THEME,Sweet-Dark-v40

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = no
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 12
    gaps_out = 24
    border_size = 2
    no_cursor_warps = true
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(FF0000ee) rgba(FFFF00ee) 45deg

    layout = master
}

misc {
    vfr = true
    vrr = 0
    focus_on_activate = true
    disable_hyprland_logo = true
    animate_manual_resizes = false
    animate_mouse_windowdragging = false
#    enable_swallow = true
#    swallow_regex=^(foot|kitty|gnome-terminal)$
}  

binds {
    workspace_back_and_forth = true
    allow_workspace_cycles = true
    pass_mouse_when_bound = false
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

###   round corner
    rounding = 10
    
###   opacity
#    active_opacity = 1.0
#    inactive_opacity = 0.80


###   blur   
    blur {
        enabled = true
        size = 8
        passes = 2
        new_optimizations = true

    }

    drop_shadow = yes
    shadow_range = 30
    shadow_render_power = 3
    col.shadow = 0x66000000
    

}

animations {
    enabled=true
    bezier=slow,0,0.85,0.3,1
    bezier=overshot,0.7,0.6,0.1,1.1
    bezier=bounce,1,1.6,0.1,0.85
    bezier=slingshot,1,-2,0.9,1.25
    bezier=nice,0,6.9,0.5,-4.20
    animation=windows,1,5,bounce,slide
#    animation = windowsOut, 1, 7, default, popin 80%
    animation=border,1,20,default
    animation=fade,1,10,default
    animation=workspaces,1,5,overshot,slide
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = true
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = off
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
    sensitivity = -0.5
}

# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more

######## Window rules ########
# Workspace
windowrulev2 = workspace 1, class:^(firefox)$
windowrulev2 = workspace 1, class:^(Opera)$
windowrulev2 = workspace 1, class:^(wf-osk)$
windowrulev2 = workspace 1, class:^(vivaldi-stable)$
windowrulev2 = workspace 2, class:^(org.gnome.Nautilus)$
windowrulev2 = workspace 2, class:^(org.manjaro.pamac.manager)$
windowrulev2 = workspace 3, class:^(kitty)$
windowrulev2 = workspace 3, class:^(gnome-terminal-server)$
windowrulev2 = workspace 4, class:^(gnome-system-monitor)$
windowrulev2 = workspace 4, class:^(org.gnome.Gnote)$
windowrulev2 = workspace 4, class:^(vlc)$
windowrulev2 = workspace 4, class:^(gnome-boxes)$
windowrulev2 = workspace 4, class:^(org.gnome.Meld)$
windowrulev2 = workspace 5, class:^(geany)$
windowrulev2 = workspace 5, class:^(gedit)$
windowrulev2 = workspace 6, class:^(gthumb)$
windowrulev2 = workspace 6, class:^(Gimp-2.10)$
windowrulev2 = workspace 7, class:^(terminal64.exe)$
windowrulev2 = workspace 8, class:^(metaeditor64.exe)$
#windowrulev2 = workspace 8, class:^(org.gnome.Calculator)$

#windowrule = workspace 7 silent,^(Opera)$





### Opacity
windowrulev2 = opacity 0.85 0.75,class:^(geany)$
windowrulev2 = opacity 0.85 0.75,class:^(gedit)$
windowrulev2 = opacity 0.85 0.75,class:^(kitty)$
windowrulev2 = opacity 0.85 0.75,class:^(org.gnome.Gnote)$
windowrulev2 = opacity 0.85 0.75,class:^(gnome.terminal.server)$
windowrulev2 = opacity 0.85 0.75,class:^(gnome.system.monitor)$
windowrulev2 = opacity 0.85 0.75,class:^(org.gnome.Nautilus)$


### Floating
windowrulev2 = float, class:^(rofi)$
windowrulev2 = float, class:^(nm-connection-editor)$
windowrulev2 = float, class:^(wlroots)$
windowrulev2 = float, class:^(pavucontrol)$
windowrulev2 = float, class:^(com.github.hluk.copyq)$
windowrulev2 = float, class:^(org.gnome.Calculator)$
windowrulev2 = float, title:^(Open Files)$
windowrulev2 = float, title:^(Bluetooth Devices)$
windowrulev2 = float, title:^(Picture in Picture)$
windowrulev2 = float, title:^(Authentication)$
windowrulev2 = float, title:^(Authenticate)$
windowrulev2 = float, title:^(All Files)$
windowrulev2 = float, title:^(Open Theme File)$
windowrulev2 = float, title:^(Select one or more files to open)$
windowrulev2 = float, title:^(Location)$


#windowrule conky
windowrule = noborder,Conky
#windowrule = noblur,Conky
windowrule = noshadow,Conky
windowrulev2 = float, class:^(Conky)$
windowrulev2 = move 14 49,class:^(Conky)$
windowrule = workspace 1 silent,^(Conky)$
windowrulev2 = pin,class:^(Conky)$


#windowrule Picture-in-Picture
windowrulev2 = float, title:^(Picture-in-Picture)$
windowrulev2 = size 800 450, title:(Picture-in-Picture)
windowrulev2 = pin, title:^(Picture-in-Picture)$
windowrulev2 = float, title:^(Firefox)$
windowrulev2 = size 800 450, title:(Firefox)
windowrulev2 = pin, title:^(Firefox)$

# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, kitty
bind = $mainMod, C, killactive, 
bind = $mainMod, M, exit, 
bind = $mainMod, E, exec, nautilus
bind = $mainMod, TAB,workspace,previous
bind = $mainMod, F, togglefloating
bind = $mainMod, R, exec, wofi --show drun,
bind = $mainMod, X, exec, jgmenu_run,
bind = $mainMod, Z, exec, rofi -combi-modi window,drun,ssh -icon-theme Papirus -show combi -hover-select -me-select-entry '' -me-accept-entry MousePrimary
#bind = $mainMod, S, pseudo, # dwindle
bind = $mainMod, S, movetoworkspacesilent, special
bind = $mainMod SHIFT, S, togglespecialworkspace
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, P, exec,  grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy # color-picker
bind = $mainMod, PRINT, exec, grim $(xdg-user-dir PICTURES)/$(date +'%Y%m%d-%H%M%S_grim.png') # screenshot
bind = $mainMod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy
bind = $mainMod, W, exec, killall -SIGUSR1 waybar
#bind = $mainMod, P, exec, /home/qtiler/scripts/wayland-color-picker # color-picker

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

Please edit the line “env = GTK_THEME,Sweet-Dark-v40” with your preferred theme.

For wallpaper :- Install hyprpaper

hyprpaper.conf
ipc = off
preload = /home/qtiler/Pictures/wallpapers/nI1u6Ihc.jpeg
#preload = /home/qtiler/Pictures/wallpapers/og94oqtbirga1.jpg
wallpaper = HDMI-A-2,/home/qtiler/Pictures/wallpapers/nI1u6Ihc.jpeg
#wallpaper = HDMI-A-2,/home/qtiler/Pictures/wallpapers/og94oqtbirga1.jpg

#hyprctl monitors | grep 'Monitor' | awk '{ print $2 }'    to get monitor name

For random wallpaper :- Install swaybg for random_background.sh

random_background.sh
#!/bin/sh
while true; do
    # Find image files and select one randomly
    image=$(find /home/qtiler/Pictures/wallpapers/. -type f | shuf -n1)
    
    # Check if an image was found
    if [ -n "$image" ]; then
        # Set the wallpaper
        swaybg -i "$image" -m fill &
        sleep 600
        
        # Kill the old swaybg process quietly
        pkill -f "swaybg"
        
        # Start a new process with a new image
        image=$(find /home/qtiler/Pictures/wallpapers/. -type f | shuf -n1)
        
        if [ -n "$image" ]; then
            # Set the new wallpaper
            swaybg -i "$image" -m fill &
            sleep 600
        # Kill the old swaybg process quietly
        pkill -f "swaybg"
        
        else
            echo "No image found for the next wallpaper."
        fi
    else
        echo "No image found for the wallpaper."
    fi
done

waybar

config
{
    "layer": "top", // Waybar at top layer
    // "position": "top", // Waybar position (top|bottom|left|right)
    "height": 30, // Waybar height (to be removed for auto height)
    // "width": 1280, // Waybar width
    "spacing": 6, // Gaps between modules (4px)
    // Choose the order of the modules
    "modules-left": ["custom/launcher", "custom/icon1", "custom/icon2", "custom/icon3", "custom/icon4", "custom/icon5", "custom/icon6", "custom/icon7", "custom/icon8", "custom/icon9", "custom/icon10", "custom/icon11", "custom/icon12", "custom/icon13", "custom/icon14", "hyprland/workspaces", "custom/media"],
    "modules-center": ["custom/icon15", "wlr/taskbar"],
    "modules-right": ["pulseaudio", "network", "disk", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "custom/weather", "custom/pacman", "custom/power", "tray"],
    // Modules configuration
        "hyprland/workspaces": {
        "disable-scroll": false,
        "active-only": false,
        "on-scroll-up": "hyprctl dispatch workspace +1",
        "on-scroll-doun": "hyprctl dispatch workspace -1",
        "show-special": true,
        "all-outputs": false,
        "on-click": "activate",
        //"format": "{icon}",
        "persistent_workspaces": {
            "1": ["HDMI-A-2"],
            "2": ["HDMI-A-2"],
            "3": ["HDMI-A-2"],
            "4": ["HDMI-A-2"],
            "5": ["HDMI-A-2"],
            "6": ["HDMI-A-2"],
            "7": [""],
            "8": [""],
            "9": [""]
        }
    },
    "keyboard-state": {
        "numlock": true,
        "capslock": true,
        "format": "{name} {icon}",
        "format-icons": {
            "locked": "",
            "unlocked": ""
        }
    },
    "sway/mode": {
        "format": "<span style=\"italic\">{}</span>"
    },
    "wlr/taskbar": {
    "format": "{icon} {app_id}",
    "markup": true,
    "icon-theme": "/usr/share/icons/Papirus-Dark",
    "icon-size": 13,
    "tooltip": true,
    "active-first": true,
    "on-click": "activate",
    "on-click-right": "close",
    "on-scroll-up": "hyprctl dispatch workspace e+1",
    "on-scroll-down": "hyprctl dispatch workspace e-1",
    "ignore-list": [
        "Conky"
    ],
    "app_ids-mapping": {
        "org.gnome.Nautilus": "Files",
        "org.gnome.Meld": "Meld",
        "org.gnome.Gnote": "gnote",
        "org.gnome.Calculator": "Calc",
        "terminal64.exe": "Mt5",
        "metaeditor64.exe": "Mt5edit",
        "vivaldi-stable": "vivaldi",
        "gnome-terminal-server": "Term",
        "gnome-system-monitor": "monitor",
        "org.manjaro.pamac.manager": "pamac",
        "Manjaro.manjaro-settings-manager": "settings"
        
    }
    },
    "sway/scratchpad": {
        "format": "{icon} {count}",
        "show-empty": false,
        "format-icons": ["", ""],
        "tooltip": true,
        "tooltip-format": "{app}: {title}"
    },
    "mpd": {
        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
        "format-disconnected": "Disconnected ",
        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
        "unknown-tag": "N/A",
        "interval": 2,
        "consume-icons": {
            "on": " "
        },
        "random-icons": {
            "off": "<span color=\"#f53c3c\"></span> ",
            "on": " "
        },
        "repeat-icons": {
            "on": " "
        },
        "single-icons": {
            "on": "1 "
        },
        "state-icons": {
            "paused": "",
            "playing": ""
        },
        "tooltip-format": "MPD (connected)",
        "tooltip-format-disconnected": "MPD (disconnected)"
    },
    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        }
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10
    },
    "clock": {
        // "timezone": "Asia/Kolkata",
        "interval": 1,
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        "format-alt": "{:%Y-%m-%d}",
        "format": "{:%e %a %b %I:%M:%S}"
    },
    "cpu": {
        "interval": 1,
        "format": "{usage}% ",
        "on-click": "gnome-system-monitor",
        "min-length": 8,
        "tooltip": false
    },
    "disk": {
        "format": "{used}",
        "format-alt": "󰋊 {used}/{total} GiB",
        "interval": 5,
        "path": "/"
    },
    "custom/launcher": {
        "format": "󰀻",
        "tooltip": false,
        "min-length": 4,
        "on-click": "rofi -combi-modi window,drun,ssh -icon-theme Papirus -show combi -hover-select -me-select-entry '' -me-accept-entry MousePrimary",
//    "on-click": "wofi --show drun -I -a -n -W 500 -H 376 -s ~/.config/wofi/themes/gruvbox.css",
        "on-click-middle": "wtype -k escape",
        "on-click-right": "jgmenu_run"  
    },
    "memory": {
        "on-click-right": "kitty -e bashtop",
        "interval":  2,   
        "format":  "{used:0.1f}G/{total:0.1f}G/{swapUsed:0.1f}G "
    },
    "temperature": {
        //"thermal-zone": 2,
        //"hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
        "hwmon-path-abs": "/sys/devices/platform/coretemp.0/hwmon",
        "input-filename": "temp1_input",
        "interval":  1,
        "critical-threshold": 55,
        // "format-critical": "{temperatureC}°C {icon}",
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "format-icons": ["", "", "", "", "", "", "", "", ""]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
        "bat": "BAT2"
    },
    "network": {
        // "interface": "wlp2*", // (Optional) To force the use of this interface
        "interval": 1,
        "format-wifi": "{essid} ({signalStrength}%) ",
        "format-ethernet": "{bandwidthDownBytes}/{bandwidthUpBytes} ",
        "tooltip-format": "{ifname} via {gwaddr} ",
        "format-linked": "{ifname} (No IP) ",
        "format-disconnected": "Disconnected ⚠",
        "min-length": 18,
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    },
    "custom/pacman": {
        "format": "{}  ",
        "min-length": 5,
        "tooltip": false,
        "interval": 3600,
        "exec": "checkupdates | wc -l",
        "exec-if": "exit 0",
        "on-click": "gnome-terminal -e 'sudo pacman -Syu'; pkill -SIGRTMIN+8 waybar",
        "signal": 8
    },
    "custom/weather": {
        "exec": "python ~/.config/waybar/weather.py",
        "return-type": "json",
        "format": "{}",
        "tooltip": true,
        "on-click": "xdg-open https://weather.com/en-IN/weather/today/l/6121c511144d639b3932fe2a28537be31b9be0d714e86f7ca41f69528423c3a8",
        "interval": 600
    },
    "custom/icon1": {
        "format": "{}  ",
        "tooltip": false,
        "on-click": "vivaldi-stable",
        "on-click-right": "opera"
    },
    "custom/icon2": {
        "format": "{} 󰉋 ",
        "tooltip": false,
        "on-click": "nautilus",
        "on-click-right": "kitty -e ranger"
    },
    "custom/icon3": {
        "format": "{} 󰨇 ",
        "tooltip": false,
        "on-click": "gnome-system-monitor",
        "on-click-right": "kitty -e bashtop"
    },
    "custom/icon4": {
        "format": "{}  ",
        "on-click": "gnome-calculator",
        "on-click-right": "kitty -e bc"
    },
    "custom/icon5": {
        "format": "{}  ",
        "tooltip": false,
        "on-click": "gnome-boxes"
    },
    "custom/icon6": {
        "format": "{} 󰕼 ",
        "on-click": "vlc",
        "on-click-right": "lollypop"
    },
    "custom/icon7": {
        "format": "{} 󰌌 ",
        "tooltip": false,
        "on-click": "wf-osk"
    },
    "custom/icon8": {
        "format": "{} 󰈹 ",
        "tooltip": false,
        "on-click": "firefox",
        "on-click-right": "qutebrowser"
    },
    "custom/icon9": {
        "format": "{}  ",
        "on-click": "kitty",
        "on-click-right": "gnome-terminal"
    },
    "custom/icon10": {
        "format": "{} 󰏔 ",
        "tooltip": false,
        "on-click": "pamac-manager",
        "on-click-right": "kitty -e sudo pacman -Scc"
    },
    "custom/icon11": {
        "format": "{}  ",
        "tooltip": false,
        "on-click": "gimp-2.10",
        "on-click-middle": "pkill swaybg | sleep 0.5 && swaybg -i ~/Pictures/wallpapers/$(ls ~/Pictures/wallpapers|shuf -n 1) -m fill",
        "on-click-right": "/home/qtiler/scripts/wayland-color-picker"
    },
    "custom/icon12": {
        "format": "{} 󰆒 ",
        "tooltip": false,
        "on-click": "cliphist list | rofi -dmenu -hover-select -me-select-entry '' -me-accept-entry MousePrimary | cliphist decode | wl-copy",
        "on-click-right": "wtype -k escape"
    },
    "custom/icon13": {
        "format": "{} 󰎚 ",
        "tooltip": false,
        "on-click": "gnote",
        "on-click-right": "kitty -e newsboat"
    },
    "custom/icon14": {
        "format": "{}  ",
        "tooltip": false,
        "on-click": "geany $HOME/.config/hypr/hyprland.conf",
        "on-click-middle": "geany $HOME/.config/waybar/style.css",
        "on-click-right": "geany $HOME/.config/waybar/config"
    },
    "custom/icon15": {
        "format": "{}  ",
        "tooltip": false,
        "on-click": "hyprctl dispatch movetoworkspace -1",
        "on-click-right": "hyprctl dispatch movetoworkspace +1"
    },
    "custom/power": {
        "format": "  ",
        "tooltip": false,
        "on-click": "killall -9 Hyprland",
        "on-click-middle": "systemctl reboot",
        "on-click-right": "systemctl -i poweroff"
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "on-click": "pavucontrol",
        "on-click-right": "amixer -q set Master toggle"
    },
//    "custom/media": {
//        "format": "{icon} {}",
//        "return-type": "json",
//        "max-length": 40,
//        "format-icons": {
//            "spotify": "",
//            "default": "🎜"
//        },
//        "escape": true,
//        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
//        // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
    }
}


style.css
* {
    /* `otf-font-awesome` is required to be installed for icons */
    font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
}

window#waybar {
    background-color: rgba(43, 48, 59, 0.6);
    border-bottom: 3px solid rgba(100, 114, 125, 0.5);
    color: #ffffff;
    transition-property: background-color;
    transition-duration: .5s;
}

window#waybar.hidden {
    opacity: 0.2;
}

/*
window#waybar.empty {
    background-color: transparent;
}
window#waybar.solo {
    background-color: #FFFFFF;
}
*/

window#waybar.termite {
    background-color: #3F3F3F;
}

window#waybar.chromium {
    background-color: #000000;
    border: none;
}

button {
    /* Use box-shadow instead of border so the text isn't offset */
    box-shadow: inset 0 -3px transparent;
    /* Avoid rounded borders under each button name */
    border: none;
    border-radius: 0;
}

/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
    background: inherit;
    box-shadow: inset 0 -3px #ffffff;
}

#workspaces button {
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.2);  
    color: #ffffff;
}

#workspaces button.persistent {
	background-color: transparent;
}

#workspaces button:hover {
    background: rgba(0, 0, 0, 0.3);
}

#workspaces button.active {
	background-color: #ff0088;
}

#workspaces button.focused {
    background-color: #64727D;
    box-shadow: inset 0 -3px #ffffff;
}

#workspaces button.urgent {
    background-color: #eb4d4b;
}

#mode {
    background-color: #64727D;
    border-bottom: 3px solid #ffffff;
}

#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-weather,
#custom-pacman,
#custom-icon,
#custom-power,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#taskbar {
    border-radius: 8px 8px 8px 8px;
    padding: 0 3px;
    margin: 0 0px;
    color: #ffffff;
    background-color: rgba(120,118,117,0.3);
}
#taskbar button {
    border-radius: 3px 3px 3px 3px;
    padding: 0 0 0 3px;
    margin: 3px;
    color: #ffffff;
    background-color: rgba(120,118,117,0.1);
}
#taskbar button.active {
    background-color: rgba(120,118,117,0.8);
}

#mpd {
    padding: 0 10px;
    color: #ffffff;
}

#window,
#workspaces {
    margin: 0 4px;
}

/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
    margin-left: 0;
}

/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
    margin-right: 0;
}

#clock {
    background-color: #FF6347;
}

#battery {
    background-color: #ffffff;
    color: #000000;
}

#battery.charging, #battery.plugged {
    color: #ffffff;
    background-color: #26A65B;
}

@keyframes blink {
    to {
        background-color: #ffffff;
        color: #000000;
    }
}

#battery.critical:not(.charging) {
    background-color: #f53c3c;
    color: #ffffff;
    animation-name: blink;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

label:focus {
    background-color: #000000;
}

#cpu {
    background-color: #FD3F92;
    color: #ffffff;
}

#memory {
    background-color: #0080FF;
}

#disk {
    background-color: #FFA500;
}

#backlight {
    background-color: #90b1b1;
}

#network {
    background-color: #008000;
}

#network.disconnected {
    background-color: #f53c3c;
}

#pulseaudio {
    background-color: #BD33A4;
    color: #ffffff;
}

#pulseaudio.muted {
    background-color: #90b1b1;
    color: #2a5c45;
}

#wireplumber {
    background-color: #fff0f5;
    color: #000000;
}

#wireplumber.muted {
    background-color: #f53c3c;
}

#custom-media {
    background-color: #66cc99;
    color: #2a5c45;
    min-width: 100px;
}

#custom-media.custom-spotify {
    background-color: #66cc99;
}

#custom-media.custom-vlc {
    background-color: #ffa000;
}

#temperature {
    background-color: #16A085;
}

#temperature.critical {
    background-color: #eb4d4b;
}

#tray {
    background-color: #2980b9;
}

#tray > .passive {
    -gtk-icon-effect: dim;
}

#tray > .needs-attention {
    -gtk-icon-effect: highlight;
    background-color: #eb4d4b;
}

#idle_inhibitor {
    background-color: #2d3436;
}

#idle_inhibitor.activated {
    background-color: #ecf0f1;
    color: #2d3436;
}

#mpd {
    background-color: #66cc99;
    color: #2a5c45;
}

#mpd.disconnected {
    background-color: #f53c3c;
}

#mpd.stopped {
    background-color: #90b1b1;
}

#mpd.paused {
    background-color: #51a37a;
}

#language {
    background: #00b093;
    color: #740864;
    padding: 0 5px;
    margin: 0 5px;
    min-width: 16px;
}

#keyboard-state {
    background: #97e1ad;
    color: #000000;
    padding: 0 0px;
    margin: 0 5px;
    min-width: 16px;
}

#keyboard-state > label {
    padding: 0 5px;
}

#keyboard-state > label.locked {
    background: rgba(0, 0, 0, 0.2);
}

#custom-weather{
    background-color: #9400D3;
}

#custom-pacman {
    background-color: #00CCCC;
}

#custom-icon {
    background-color: #FF6347;
}

#custom-power {
    background-color: #FF0000;
}

#scratchpad {
    background: rgba(0, 0, 0, 0.2);
}

#scratchpad.empty {
	background-color: transparent;
}

weather.py for waybar custom/weather widget which shows detailed weather data from weather.com
Install python-pyquery and json for weather.py

weather.py
#!/usr/bin/env python

import subprocess
from pyquery import PyQuery  # install using `pip install pyquery`
import json

# weather icons
weather_icons = {
    "sunnyDay": "🌤",
    "clearNight": "望",
    "cloudyFoggyDay": "",
    "cloudyFoggyNight": "",
    "rainyDay": "",
    "rainyNight": "",
    "snowyIcyDay": "",
    "snowyIcyNight": "",
    "severe": "",
    "default": "",
}

# get location_id
# to get your own location_id, go to https://weather.com & search your location.
# once you choose your location, you can see the location_id in the URL(64 chars long hex string)
# like this: https://weather.com/en-IN/weather/today/l/c3e96d6cc4965fc54f88296b54449571c4107c73b9638c16aafc83575b4ddf2e
location_id = "6121c511144d639b3932fe2a28537be31b9be0d714e86f7ca41f69528423c3a8"  # TODO
# location_id = "8139363e05edb302e2d8be35101e400084eadcecdfce5507e77d832ac0fa57ae"

# priv_env_cmd = 'cat $PRIV_ENV_FILE | grep weather_location | cut -d "=" -f 2'
# location_id = subprocess.run(
#     priv_env_cmd, shell=True, capture_output=True).stdout.decode('utf8').strip()

# get html page
url = "https://weather.com/en-IN/weather/today/l/" + location_id
html_data = PyQuery(url=url)

# current temperature
temp = html_data("span[data-testid='TemperatureValue']").eq(0).text()
# print(temp)

# current status phrase
status = html_data("div[data-testid='wxPhrase']").text()
status = f"{status[:16]}.." if len(status) > 17 else status
# print(status)

# status code
status_code = html_data("#regionHeader").attr("class").split(" ")[2].split("-")[2]
# print(status_code)

# status icon
icon = (
    weather_icons[status_code]
    if status_code in weather_icons
    else weather_icons["default"]
)
# print(icon)

# temperature feels like
temp_feel = html_data(
    "div[data-testid='FeelsLikeSection'] > span > span[data-testid='TemperatureValue']"
).text()
temp_feel_text = f"Feels like {temp_feel}c"
# print(temp_feel_text)

# min-max temperature
temp_min = (
    html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']")
    .eq(0)
    .text()
)
temp_max = (
    html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']")
    .eq(1)
    .text()
)
temp_min_max = f"  {temp_min}\t\t  {temp_max}"
# print(temp_min_max)

# wind speed
wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1]
wind_text = f"煮  {wind_speed}"
# print(wind_text)

# humidity
humidity = html_data("span[data-testid='PercentageValue']").text()
humidity_text = f"  {humidity}"
# print(humidity_text)

# visibility
visbility = html_data("span[data-testid='VisibilityValue']").text()
visbility_text = f"  {visbility}"
# print(visbility_text)

# air quality index
air_quality_index = html_data("text[data-testid='DonutChartValue']").text()
# print(air_quality_index)

# hourly rain prediction
prediction = html_data("section[aria-label='Hourly Forecast']")(
    "div[data-testid='SegmentPrecipPercentage'] > span"
).text()
prediction = prediction.replace("Chance of Rain", "")
prediction = f"\n\n    (hourly) {prediction}" if len(prediction) > 0 else prediction
# print(prediction)

# tooltip text
tooltip_text = str.format(
    "\t\t{}\t\t\n{}\n{}\n{}\n\n{}\n{}\n{}{}",
    f'<span size="xx-large">{temp}</span>',
    f"<big>{icon}</big>",
    f"<big>{status}</big>",
    f"<small>{temp_feel_text}</small>",
    f"<big>{temp_min_max}</big>",
    f"{wind_text}\t{humidity_text}",
    f"{visbility_text}\tAQI {air_quality_index}",
    f"<i>{prediction}</i>",
)

# add degree symbol
temp_with_degree_symbol = temp + "C"

# print waybar module data
out_data = {
    "text": f"{icon}   {temp_with_degree_symbol}",
    "alt": status,
    "tooltip": tooltip_text,
    "class": status_code,
}
print(json.dumps(out_data))

20231219-115144-grim

2 Likes

I admire the desktop wallpaper although I’d have to wear sunglasses… :sunglasses:

1 Like

OK. I made a Hyprland wallpaper with official mascot and branding logo (1920x1200)

Hyprchan