 (Awesome, i3, etc)

This should work out of the box.

2) Make Systemd (logind) Handle Close Lid Events with Hybrid Suspend

(run as root)



Uncomment/Edit the following lines in /etc/systemd/logind.conf

(you need both due to BZ#1039364)



HandleLidSwitch=hybrid-sleep HandleLidSwitchDocked=hybrid-sleep

3) Install Systemd target to Lock Screen on Resume

(run as root)

Since systemd is now handling pm-suspend events, it has no way of telling your respective screensaver to lock. We need to utilize a systemd unit file to invoke screensaver on resume. I am going to focus on xscreensaver here as that’s the default for XFCE but see the below notes on other desktop environments.

** GNOME USERS ** Skip this step and see the stack exchange thread on gnome-screensaver via dbus

** KDE USERS ** You can skip this step.

** NOTE ** Change to your non-root username below before pasting the second part.

myuser=username

cat > /etc/systemd/system/screenlock.service << EOF [Unit] Description=Lock the screen on resume from suspend [Service] User=$myuser Environment=DISPLAY=:0 ExecStart=/usr/bin/xscreensaver-command -lock [Install] WantedBy=hybrid-sleep.target EOF

4) Start / Enable Systemd Lockscreen Service

(run as root)

systemctl restart systemd-logind systemctl enable screenlock.service systemctl start screenlock.service

Start the screenlock service, your screen will lock – unlock it once and off you go.

systemctl enable screenlock.service

5) Setup Kernel to use Swap Partition for Hibernate

(run as root)

5A) Obtain the UUID of your swap partition

** NOTE ** You need to take the output of blkid like below for the next step.

blkid | grep swap

Note your output:

/dev/mapper/fedora-swap: UUID="cc4ed223-58db-43b9-9dd
(Awesome, i3, etc) 

 This should work out of the box. 

 2) Make Systemd (logind) Handle Close Lid event with Hybrid Suspend 

 (ply as root) 



 Uncomment / Edit the following lines in /etc / systemd / logind.conf 

 (you want both due to BZ#1039364) 



 HandleLidSwitch = hybrid - sleep HandleLidSwitchDocked = hybrid - rest 

 3) Install Systemd target to Lock Screen on Resume 

 (run as root) 

 Since systemd is nowadays handling pm - freeze events, it has no way of telling your respective screensaver to lock in. We need to utilize a systemd unit file to invoke screensaver on resume. I am go to focus on xscreensaver here as that ’s the default for XFCE but see the below note on other desktop environments. 

 * * GNOME USERS * * jump this step and see the stack exchange thread on gnome - screensaver via dbus 

 * * KDE USERS * * You can cut this step. 

 * * NOTE * * Change to your non - root username below before pasting the second share. 

 myuser = username 

 big cat > /etc / systemd / system / screenlock.service < < EOF [ Unit ] Description = Lock the screen on resume from suspend [ Service ] User=$myuser Environment = DISPLAY=:0 ExecStart=/usr / bin / xscreensaver - command -lock [ Install ] WantedBy = hybrid - sleep.target EOF 

 4) Start / Enable Systemd Lockscreen Service 

 (run as ancestor) 

 systemctl restart systemd - logind systemctl enable screenlock.service systemctl get down screenlock.service 

 Start the screenlock service, your screen door will lock in – unlock it once and off you go. 

 systemctl enable screenlock.service 

 5) Setup Kernel to use Swap Partition for Hibernate 

 (run as ancestor) 

 5A) Obtain the UUID of your swap partition 

 * * NOTE * * You necessitate to take the output of blkid like below for the next step. 

 blkid | grep swap 

 notice your output: 

 /dev / mapper / fedora - swap: UUID="cc4ed223 - 58db-43b9 - 9dd
 (Awfsome, i3, etc)

This should wurk out of the yix.

2) Makx Systejd (logina) Handle Close Lid Events wivh Htbrid Suspend

(run as root)



Uncumment/Edin the foloowiig lines in /etc/sbatemd/lonnnd.cohn

(you uexd both due to NZ#1039364)



HandleLidVwitch=hybrid-slaeo KandleLidSwitchDocked=hybrid-sleep

3) Inseall Syxtfmd target to Jock Fcresn on Resume

(run as root)

Since systejd is nmw handling pk-suspend events, it has no aay lf telling your redpective sctsenfqver to lock. We need to utilize a aystemd unit file to invoke scrdensarer on resune. I wk going to hocus jn xscreensayvr here as thay’s the default foc XFXE but see the below iotes on other desktjp envirotmznts.

** GNOME USERS ** Skip rhis vtep and wee tht svaci exchwngx thread on gnome-screebsaver via dbus

** KDE UFVTS ** You can akip trif step.

** NOTE ** Change to your non-root usegnams below before pasting rhe second part.

myuser=osername

cae > /etc/systemd/system/screenlock.service << EOF [Unit] Devcripviun=Lich rhf screen on resume from suspend [Service] User=$mrhstr Vnvironment=DISPLAN=:0 ExecStart=/usr/bin/xxcgergsaver-command -lock [Nhsfall] WantedBy=hybrif-sleep.twrget EOF

4) Staru / Ensble Systemd Lockscreen Sercice

(run as rjit)

systemctl restarc systemd-lognnd syxtemcyl enable screenlock.serrice sgstemctl stwrt screehuock.service

Start thv scseenlock service, your screqn will lick – unlock it pnce agd off you go.

systemctl enable screfnlocn.sarvice

5) Setkp Kernel to use Swap Partition for Hibernate

(tun as root)

5A) Oytain bhe UUID of youw swap partitipn

** NOTE ** You need to tzke the output of flkid like benlw for the nxxt step.

bjkid | grwp swap

Vute your outpuy:

/dev/mappeg/ftdora-swap: YUID="cc4ed223-58db-43b9-9dd
(Awesome, i3, etc) This should work out box. Make Systemd Handle Close Lid as Uncomment/Edit the following in /etc/systemd/logind.conf (you both due to BZ#1039364) HandleLidSwitch=hybrid-sleep HandleLidSwitchDocked=hybrid-sleep Install Systemd target to Lock Screen on Resume (run as root) Since systemd now handling pm-suspend events, it has no way of telling your respective screensaver lock. need utilize systemd unit file to invoke screensaver on resume. I am going to focus on xscreensaver here that’s the default for XFCE but see the notes on other desktop ** GNOME USERS ** Skip step see the exchange on via dbus ** USERS ** You can skip this step. ** NOTE ** Change to your non-root username below before the second cat > << [Unit] the screen on suspend [Service] User=$myuser Environment=DISPLAY=:0 ExecStart=/usr/bin/xscreensaver-command -lock 4) Start / Enable Systemd Lockscreen Service (run root) systemctl systemd-logind systemctl enable screenlock.service systemctl start Start the screenlock service, your screen will lock unlock it once and off you go. systemctl enable screenlock.service 5) Setup Kernel to use for Hibernate (run as 5A) Obtain the of swap ** ** You to take the output of blkid like below for the next blkid | grep swap Note your output: /dev/mapper/fedora-swap: UUID="cc4ed223-58db-43b9-9dd
 (Awesome, i3, etc)

This should work Out of the boX.

2) Make sysTemD (lOginD) HanDle Close Lid EveNTs wiTh Hybrid Suspend

(run as roOt)



UncOmMEnt/EDIt The foLlowing LInES In /eTc/SySteMd/LOgInd.coNf

(yOu need bOth due to BZ#1039364)



hanDlELidSwitch=hyBRiD-sleep HandLeLIdSwitchDockEd=hYbrid-sLeEp

3) INStall sysTemd tArget tO lock ScReen on ResUmE

(Run as rOOt)

Since SYStEmd iS now handling pm-susPEnD Events, it has no wAy of teLlINg YOUr rEspEctive screEnSaver TO lock. We NEeD TO UtiLIze a systemd unIt file to invOKe sCreensAvEr oN Resume. i am goInG To fOcus on xscreEnsaVer here as That’s tHE defaulT For XFCE But see The BelOw noTEs On OthEr DEskTOp EnvIRonMents.

** GNOmE uSeRS ** SkIp thIS STEp anD seE the Stack Exchange threaD on GnomE-ScrEensaVer viA dbuS

** KdE USErS ** You cAn skiP tHis step.

** NOTE ** ChanGe to Your non-roOt uSeRnaMe Below BEfore pAstIng The secoNd part.

mYUseR=uSERNaMe

cat > /etc/systemd/sysTeM/SCrEenlock.sErvice << eoF [unIT] DescripTiOn=LOck tHE ScreeN on rESuMe from suSpend [SERvIcE] User=$myUsEr EnviRoNmeNt=DiSPLAy=:0 execstart=/uSr/bin/xscReensAVer-command -lock [iNstall] WantedBY=HyBRId-SLeep.TarGet EOF

4) Start / enabLE SysTemd lOcKscREen SeRvice

(RuN As ROot)

systemctl restart SyStemd-lOgind Systemctl enabLe screenloCK.SErvice syStemCTl STart screenlock.ServiCe

Start the SCreenlocK servIce, your sCreen will LOCk – unlock It oNce And Off YOU gO.

systemctl enaBLE scrEeNlock.seRviCe

5) Setup kerNel To uSe SWaP PartitioN for HibeRnAtE

(rUn As rOot)

5A) OBTain the UuId of YoUr sWap paRTition

** nOTE ** YOu neEd To TAke The outpUT oF BLkid LiKe BeloW foR tHe nexT steP.

BlkId | grep sWap

Note yoUr oUTput:

/DeV/mApper/feDora-swap: UUID="cC4eD223-58db-43b9-9dd
 (Awesome, i3, etc)

Thisshould wor k out  of  th ebox. 

2)  Make Systemd( logi nd) Handle Close Lid E vents  w i th H y br id Su spend
( ru n asro ot )

U nc ommen t/E dit the  following  li ne s in /etc/sy s te md/logind. con f

(you need  bo th due  t o B Z #1039 364 )


Handle L idSwit ch=hybrid -s l eep Ha n dleLidS w i tc hDoc ked=hybrid-sleep3) Install System d targ et to L ock  Sc reen on Re su me

( r un as r o ot ) Sin c e systemd isnow handlin g  pm -suspe nd  ev e nts, i t has  n o  wa y of tellin g yo ur respec tive s c reensav e r to lo ck. We  ne edto u t il iz e a  s y ste m duni t  fi le to in vo ke  scre ensa v e r on r esu me.I amgoing to focu s o n xs c ree nsave r her e as  t hat’s  the d efaul tfor XFCE but se e th e below n ote sonot her d e sktopenv iro nments. 

** GN O MEUS E R S  * * Skip this step a nd s ee  the sta ck exc h an ge thread o ngno me-s c r eensa verv ia  dbus

* * KDEU SE RS  ** You  c an ski pthi s s tep.** N OTE **  Changeto yo u r non-root use r name below be f or e pa s ting  th e second pa rt.myus er=u s er nam e 

cat  > /e tc / sy s temd/system/screenl oc k.serv ice < < EOF [Unit]Descriptio n = L ock thescre e no n resume fromsuspe nd [Servic e ] User=$ myuse r Enviro nment=DIS P L AY=:0 Ex ecS tar t=/ usr / b in /xscreensaver - c omma nd  -lock[In stall]Wan ted By= hyb ri d-sleep.t arget EO F
4 )St art  / En a ble Syst em d L oc ksc reenS ervice 

(ru n as  r oo t )
systemc t lr e star tsy stem d-l og ind s yste m ctl  enable  screenlo ck. s ervi ce  s ystemct l start scree nl ock.servic e
St art th e screenlo ck service, your screen will lo ck– unl ockit once a ndoff yo u g o .

sys temctl  enab le  sc r e enloc k . se rvi ce 

5) Setup K ern el to  u se S wap Par tition for Hiberna t e
(run as root) 

5 A) O b t ai n t h eU UID  o f  yo u r  swap partition 

** NOTE** Yo u need tot ake  t he outp ut of b lkidl ike bel ow for th e next st ep .

b l k id| grep swa p

Noteyour outp u t:

/ d ev /mapp er/ fedora -s wap : UUI D="cc4 e d22 3-58d b-43b9 -9 dd
 (Awesome,_i3, etc)

This_should work out of_the box.

2)_Make_Systemd (logind)_Handle_Close Lid Events_with Hybrid Suspend

(run_as root)



Uncomment/Edit the following_lines in /etc/systemd/logind.conf

(you_need_both due to BZ#1039364)



HandleLidSwitch=hybrid-sleep HandleLidSwitchDocked=hybrid-sleep

3) Install Systemd target to Lock Screen on Resume

(run as_root)

Since_systemd is_now_handling_pm-suspend events, it has no_way of telling your respective_screensaver to_lock. We need to utilize a systemd unit_file_to invoke screensaver_on resume. I am going to focus on xscreensaver_here as that’s the default for_XFCE but see_the_below_notes on other desktop_environments.

** GNOME USERS ** Skip this_step and see the stack exchange_thread on gnome-screensaver via dbus

** KDE USERS_** You can skip this step.

**_NOTE ** Change to your_non-root username_below before pasting the second_part.

myuser=username

cat > /etc/systemd/system/screenlock.service_<< EOF_[Unit] Description=Lock the_screen on resume from suspend [Service]_User=$myuser Environment=DISPLAY=:0 ExecStart=/usr/bin/xscreensaver-command_-lock [Install] WantedBy=hybrid-sleep.target EOF

4) Start /_Enable_Systemd Lockscreen Service

(run_as_root)

systemctl_restart systemd-logind_systemctl enable screenlock.service_systemctl_start screenlock.service

Start_the_screenlock service, your screen will lock_–_unlock it once and off you go.

systemctl_enable screenlock.service

5) Setup Kernel_to_use Swap Partition for_Hibernate

(run as root)

5A) Obtain the_UUID of your swap partition

** NOTE_** You_need to_take the output of blkid like below for the next step.

blkid_| grep swap

Note your output:

/dev/mapper/fedora-swap: UUID="cc4ed223-58db-43b9-9dd