Remove sleep button

Sleep doesn´t work (on my machine). How do I remove the sleep button?

Operating System: Fedora Linux 44
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.1
Kernel Version: 7.1.10-200.fc44.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 16 GiB of RAM (15.6 GiB usable)
Graphics Processor: Quadro RTX 4000

The button is usually called the power-button.

See man logind.conf and the HandlePowerKey= option which I think is what you are after.

HandlePowerKey= controls what happens when you press the physical power button, it does not remove the Sleep / Suspend option from the UI.

Disable sleep in /etc/systemd/sleep.conf.d/disable-sleep.conf

[Sleep]
AllowSuspend=no
AllowHibernation=no

This should remove the sleep button from the UI.

Got this information from here Reddit

As the OP is asking about the button I’m not sure why you are talking about options in the GUI.

But I do agree disabling sleep means that the system will not accidentally attempt to sleep.

I also thought OP meant the button in the GUI - i.e. this one in the application launcher, and probably also those on the login screen and lockscreen.

image

the power button is ok. I talk specifically about the button with the label “sleep” .

Do I create the folder sleep.conf?

Oh that explains it. …

Do need. A version if sleep.conf exists in /usr

You can see all the paths that systemd checks in man systemd-sleep.conf.

Here’s the man page.

This was almost correct the file proper is /etc/systemd/sleep.conf

Btw

inxi -Fzxx

System:
Kernel: 7.1.10-200.fc44.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 16.2.1
Desktop: KDE Plasma v: 6.7.4 tk: Qt v: N/A wm: kwin_wayland dm: N/A
Distro: Fedora Linux 44 (KDE Plasma Desktop Edition)
Machine:
Type: Desktop System: Gigabyte product: Z170X-Gaming 7 v: N/A
serial:
Mobo: Gigabyte model: Z170X-Gaming 7 v: x.x serial:
Firmware: UEFI vendor: American Megatrends v: F22m date: 03/09/2018
Battery:
Device-1: hid-dc:2c:26:3e:c2:2b-battery-3 model: KEMOVE K61 serial: N/A
charge: N/A status: discharging
Device-2: hidpp_battery_0 model: Logitech Anywhere MX serial:
charge: 50% status: discharging
CPU:
Info: quad core model: Intel Core i7-7700K bits: 64 type: MT MCP
arch: Kaby Lake rev: 9 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
Speed (MHz): avg: 4200 min/max: 800/4200 cores: 1: 4200 2: 4200 3: 4200
4: 4200 5: 4200 6: 4200 7: 4200 8: 4200 bogomips: 67200
Flags-basic: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: NVIDIA TU104GL [Quadro RTX 4000] driver: nouveau v: kernel
arch: Turing pcie: speed: 8 GT/s lanes: 8 ports: active: DP-1,DP-4
empty: DP-2,DP-3 bus-ID: 01:00.0 chip-ID: 10de:1eb1
Device-2: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.1
speed: 5 Gb/s lanes: 1 bus-ID: 6-2:2 chip-ID: 046d:085e
Display: wayland server: Xwayland v: 24.1.13 compositor: kwin_wayland
driver: gpu: nouveau d-rect: 5360x2520 display-ID: 0
Monitor-1: DP-1 pos: top-right model: Samsung CF791 res: 3440x1440 hz: 100
dpi: 110 diag: 864mm (34")
Monitor-2: DP-4 pos: bottom-l model: Lenovo M14 res: 1920x1080 hz: 60
dpi: 157 diag: 358mm (14.1")
API: EGL v: 1.5 platforms: device: 0 drv: zink device: 1 drv: swrast gbm:
drv: zink surfaceless: drv: zink wayland: drv: zink x11: drv: zink
API: OpenGL v: 4.6 vendor: mesa v: 26.1.8 glx-v: 1.4 direct-render: yes
renderer: zink Vulkan 1.4(Quadro RTX 4000 (NVK TU104) (MESA_NVK))
device-ID: 10de:1eb1 display-ID: :0.0
API: Vulkan v: 1.4.341 surfaces: N/A device: 0 type: discrete-gpu
driver: mesa nvk device-ID: 10de:1eb1 device: 1 type: cpu
driver: mesa llvmpipe device-ID: 10005:0000
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor wl: wayland-info x11: xdriinfo,
xdpyinfo, xprop, xrandr
Audio:
Device-1: Intel 100/C230 Series Family HD Audio vendor: Gigabyte
driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a170
Device-2: NVIDIA TU104 HD Audio driver: snd_hda_intel v: kernel pcie:
speed: 8 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:10f8
Device-3: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.1
speed: 5 Gb/s lanes: 1 bus-ID: 6-2:2 chip-ID: 046d:085e
Device-4: RODE Microphones NT-USB driver: hid-generic,snd-usb-audio,usbhid
type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 bus-ID: 7-4:5 chip-ID: 19f7:0003
API: ALSA v: k7.1.10-200.fc44.x86_64 status: kernel-api
Server-1: PipeWire v: 1.6.8 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin
Network:
Device-1: Intel Ethernet I219-V vendor: Gigabyte driver: e1000e v: kernel
port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b8
IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac:
IF-ID-1: br-11d07a96bc87 state: down mac:
IF-ID-2: br-835f66dfd471 state: down mac:
IF-ID-3: br-b3704be1431b state: down mac:
IF-ID-4: br0 state: up speed: 1000 Mbps duplex: unknown mac:
IF-ID-5: docker0 state: down mac:
IF-ID-6: virbr0 state: down mac:
Bluetooth:
Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.1
speed: 12 Mb/s lanes: 1 bus-ID: 7-2.1:4 chip-ID: 0bda:a729
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: bt-v: 5.1
lmp-v: 10
Drives:
Local Storage: total: 499.31 GiB used: 84.45 GiB (16.9%)
ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 960 EVO 500GB
size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: temp: 50.9 C
ID-2: /dev/sda vendor: Goldendisk model: GDSAL-32MS size: 29.82 GiB
speed: 3.0 Gb/s serial:
ID-3: /dev/sdb model: USB DISK 2.0 size: 3.73 GiB type: USB rev: 2.0
spd: 480 Mb/s lanes: 1 serial:
Partition:
ID-1: / size: 335.17 GiB used: 83.56 GiB (24.9%) fs: btrfs
dev: /dev/nvme0n1p3
ID-2: /boot size: 1.9 GiB used: 814.3 MiB (41.8%) fs: ext4 dev: /dev/sda2
ID-3: /boot/efi size: 598.8 MiB used: 20 MiB (3.3%) fs: vfat
dev: /dev/sda1
ID-4: /home size: 335.17 GiB used: 83.56 GiB (24.9%) fs: btrfs
dev: /dev/nvme0n1p3
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 41.8 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Memory: total: 16 GiB available: 15.55 GiB used: 4.27 GiB (27.5%)
Processes: 358 Power: uptime: 1h 6m wakeups: 0 Init: systemd v: 259
default: graphical
Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 7
Compilers: N/A Shell: pk-command-not running-in: konsole inxi: 3.3.41

deepseek's take

chat.deepseek.com

Yes and no.

On fedora you do not edit a master conf file anymore or override it completely.
What you do is drop in a replacement piece into the xxx.conf.d folder.

The reason for this is that an upgrade can give you new features in the master conf fille but your targetted drop in keep working.