Hotkey for suspend?

Hi, I was wondering if there is an option to hotkey the suspend feature for the xfce desktop version. I set it in the battery settings to suspend when I close the lid on my laptop but it is not doing that, and clicking 2 buttons to suspend is kinda annoying. I was wondering if I could hotkey suspend so that way its 1 fluid motion.

inxi -Faz

System:
  Kernel: 5.15.13-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=f81321f4-94d4-4ee9-b8dc-5fe9bec7a14d rw [email protected]
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
  Desktop: Xfce 4.16.0 tk: Gtk 3.24.29 info: xfce4-panel wm: xfwm 4.16.1
    vt: 7 dm: LightDM 1.30.0 Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Pavilion Gaming Laptop 15-dk0xxx
    v: Type1ProductConfigId serial: <superuser required> Chassis: type: 10
    serial: <superuser required>
  Mobo: HP model: 85FA v: 42.47 serial: <superuser required> UEFI: Insyde
    v: F.50 date: 08/18/2021
Battery:
  ID-1: BAT1 charge: 30.8 Wh (82.6%) condition: 37.3/52.5 Wh (71.0%)
    volts: 11.7 min: 11.6 model: Hewlett-Packard PABAS0241231 type: Li-ion
    serial: <filter> status: Discharging
CPU:
  Info: model: Intel Core i5-9300H bits: 64 type: MT MCP arch: Coffee Lake
    family: 6 model-id: 0x9E (158) stepping: 0xA (10) microcode: 0xEA
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 1657 high: 3143 min/max: 800/4100 scaling:
    driver: intel_pstate governor: powersave cores: 1: 2670 2: 800 3: 800
    4: 800 5: 800 6: 1287 7: 2960 8: 3143 bogomips: 38400
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional,
    IBRS_FW, STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Hewlett-Packard
    driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA GP107M [GeForce GTX 1050 3 GB Max-Q]
    vendor: Hewlett-Packard driver: nvidia v: 495.46
    alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:1c91
    class-ID: 0300
  Device-3: Lite-On HP Wide Vision HD Camera type: USB driver: uvcvideo
    bus-ID: 1-5:2 chip-ID: 04ca:707f class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org 1.21.1.3 compositor: xfwm4 v: 4.16.1 driver:
    loaded: modesetting,nvidia display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.0x11.3")
    s-diag: 583mm (23")
  Monitor-1: eDP-1-1 res: 1920x1080 hz: 60 dpi: 142
    size: 344x194mm (13.5x7.6") diag: 395mm (15.5")
  Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA GP107GL High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel bus-ID: 01:00.1 chip-ID: 10de:0fb9
    class-ID: 0403
  Sound Server-1: ALSA v: k5.15.13-zen1-1-zen running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: no
  Sound Server-4: PipeWire v: 0.3.43 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel port: 4000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter
    vendor: Hewlett-Packard driver: rtw_8822be v: N/A modules: rtw88_8822be
    port: 3000 bus-ID: 05:00.0 chip-ID: 10ec:b822 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek Realtek Bluetooth 4.2 Adapter type: USB driver: btusb
    v: 0.8 bus-ID: 1-14:3 chip-ID: 0bda:b00b class-ID: e001 serial: <filter>
  Report: bt-adapter ID: hci0 rfk-id: 3 state: down
    bt-service: enabled,running rfk-block: hardware: no software: yes
    address: <filter>
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 port: 6060 bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A
    class-ID: 0104
Drives:
  Local Storage: total: 238.47 GiB used: 18.58 GiB (7.8%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Toshiba model: N/A
    size: 238.47 GiB block-size: physical: 512 B logical: 512 B
    speed: 15.8 Gb/s lanes: 2 type: SSD serial: <filter> rev: ADHA0102
    temp: 32.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 18.58 GiB (7.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 18.58 GiB (7.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 18.58 GiB (7.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 18.58 GiB (7.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 7.61 GiB used: 209.2 MiB (2.7%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 29.8 C pch: 43.0 C mobo: 27.8 C gpu: nvidia
    temp: 37 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 305 Uptime: 1d 41m wakeups: 4 Memory: 7.61 GiB
  used: 3.4 GiB (44.8%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1384 lib: 372 Shell: Bash
  v: 5.1.16 running-in: xfce4-terminal inxi: 3.3.11

In Xfce, you can add keyboard shortcuts in the settings menu - keyboard - keyboard shortcuts. Simply assign the command systemctl suspend to whichever key combination you want.

5 Likes

Thank you!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.