6

Hyprland and wlogout

 1 year ago
source link: https://www.lorenzobettini.it/2024/02/hyprland-and-wlogout/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Hyprland and wlogout

This is another post on the Hyprland series.

In a previous post, I showed how to create a custom button in the Waybar for wlogout: a wlogout is a logout menu for Wayland environments:

wlogout.png?resize=625%2C306&ssl=1

Remember that in Arch, this is available as an AUR package, e.g., you have to install it through an AUR helper like Yay:

yay -S wlogout

Of course, you can also test it by running that from the command line.

However, I hadn’t realized that when I click logout in wlogout, I always get a black screen: I don’t return to the SDDM menu.

However, that’s easy to fix, and you can also take the chance to customize its aspect.

First, you have to create its configuration layout file, e.g., by starting from the default one:

mkdir -p ~/.config/wlogout
cp /etc/wlogout/layout ~/.config/wlogout/

Then, we can edit the layout file we copied into “~/.config/wlogout/layout” and change this section

    "label" : "logout",
    "action" : "loginctl terminate-user $USER",
    "text" : "Logout",
    "keybind" : "e"
    "label" : "logout",
    "action" : "sleep 1; hyprctl dispatch exit",
    "text" : "Logout",
    "keybind" : "e"

Now, logout will work fine.

Let’s also configure “Swaylock” for screen locking, as I have already shown in this previous blog post.

If you still haven’t installed that:

sudo pacman -S swaylock

The default screen locking uses a bright screen. Let’s make it darker:

mkdir ~/.config/swaylock

And let’s create and edit its configuration file “~/.config/swaylock/config”; in this example, I’m going to make it “dark green”, so I’m specifying:

color=032205FF

By looking at its “man page”, we can see:

-c, –color <rrggbb[aa]>
Turn the screen into the given color instead of white. If -i is used, this sets the background of the image to the given color. Defaults to white (FFFFFF).

The “aa” in the previously present hex notation is the alpha value defining the color’s opacity. In the above example, I’m using no opacity.

This is my complete configuration file for swaylock:

daemonize
show-failed-attempts
color=032205FF

Again, the “man page” explains these values:

-F, –show-failed-attempts
Show the current count of failed authentication attempts.

-f, –daemonize
Detach from the controlling terminal after locking.

In my Hyprland configuration file, I also use “swayidle” (the Idle management daemon for Wayland)

# Screensaver and lock screen
# Swaylock configuration in ~/.config/swaylock/config
$lock = swaylock
exec-once = swayidle -w timeout 300 '$lock' timeout 300 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep '$lock'

In my waybar configuration, I have:

"modules-right": ["idle_inhibitor", "pulseaudio", "backlight", "battery", "clock", "keyboard-state", "tray", "custom/power"],
"custom/power": {
    "format": " ⏻ ",
    "tooltip": false,
    "on-click": "wlogout --protocol layer-shell"

Note that I’ve used a character using the installed Nerd font. Of course, you can choose anything you like. The “wlogout” menu will appear when you click on that module.

That’s all for this post ?

Like this:

Loading...

Related

</div


Recommend

  • 240
    • blog.frankel.ch 7 years ago
    • Cache

    Lambdas and Clean Code

    Lambdas and Clean Code As software developers, we behave like children. When we see shiny new things, we just have to play with them. That’s normal, accepted, and in general, even beneficial to our job…​ up to...

  • 215
    • www.thoughtsandprayers.io 7 years ago
    • Cache

    Thoughts and Prayers

    Thoughts and Prayers (Open Beta)Impact WallYour go-to ecosystem for doing good.Discover causes, donate crypto and get Wish reward tokens.

  • 6
    • www.lorenzobettini.it 2 years ago
    • Cache

    Hyprland and the Variety wallpaper manager

    Hyprland and the Variety wallpaper manager Leave a reply ...

  • 10
    • gist.github.com 2 years ago
    • Cache

    Screen sharing on Hyprland (Arch Linux)

    Screen sharing on Hyprland (Arch Linux) Table of contents Introduction This guide will go through the setup and troubleshooting steps required to get screen sharing working on OBS with the

  • 17
    • www.lorenzobettini.it 2 years ago
    • Cache

    Hyprland: getting started (part 1)

    Hyprland: getting started (part 1) 6 Replies In the pa...

  • 24
    • www.lorenzobettini.it 2 years ago
    • Cache

    Hyprland: getting started (part 2)

    This is the second blog post on getting started with Hyprland (see the first post here).

  • 6
    • drewdevault.com 1 year ago
    • Cache

    Hyprland is a toxic community

    Hyprland is a toxic community September 17, 2023 on Drew DeVault's blog Hyprland is a...

  • 21
    • www.lorenzobettini.it 1 year ago
    • Cache

    Hyprland and Waybar

    Hyprland and Waybar Leave a reply Up to now, I have shown how to ge...

  • 25
    • www.lorenzobettini.it 1 year ago
    • Cache

    Hyprland and ssh-agent

    Hyprland and ssh-agent Leave a reply In this post, I’d like to d...

  • 41
    • www.lorenzobettini.it 1 year ago
    • Cache

    Hyprland and notifications with mako

    Hyprland and notifications with mako Leave a reply

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK