@@ -37,6 +37,7 @@ GeneralConf::GeneralConf(QWidget* parent)
3737 initAutoCloseIdleDaemon ();
3838#endif
3939 initShowTrayIcon ();
40+ initUseGrimAdapter ();
4041 initShowDesktopNotification ();
4142 initShowAbortNotification ();
4243#if !defined(DISABLE_UPDATE_CHECKER)
@@ -117,6 +118,10 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
117118#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
118119 m_showTray->setChecked (!config.disabledTrayIcon ());
119120#endif
121+
122+ #if defined(Q_OS_LINUX)
123+ m_useGrimAdapter->setChecked (config.useGrimAdapter ());
124+ #endif
120125}
121126
122127void GeneralConf::updateComponents ()
@@ -149,6 +154,11 @@ void GeneralConf::showAbortNotificationChanged(bool checked)
149154 ConfigHandler ().setShowAbortNotification (checked);
150155}
151156
157+ void GeneralConf::useGrimAdapter (bool checked)
158+ {
159+ ConfigHandler ().useGrimAdapter (checked);
160+ }
161+
152162#if !defined(DISABLE_UPDATE_CHECKER)
153163void GeneralConf::checkForUpdatesChanged (bool checked)
154164{
@@ -326,6 +336,24 @@ void GeneralConf::initShowTrayIcon()
326336#endif
327337}
328338
339+ void GeneralConf::initUseGrimAdapter ()
340+ {
341+ #if defined(Q_OS_LINUX)
342+ m_useGrimAdapter =
343+ new QCheckBox (tr (" Use grim to capture screenshots" ), this );
344+ m_useGrimAdapter->setToolTip (
345+ tr (" Grim is a wayland only utility to capture screens based on the "
346+ " screencopy protocol. Generally only enable on minimal wayland window "
347+ " managers like sway, hyprland, etc." ));
348+ m_scrollAreaLayout->addWidget (m_useGrimAdapter);
349+
350+ connect (m_useGrimAdapter,
351+ &QCheckBox::clicked,
352+ this ,
353+ &GeneralConf::useGrimAdapter);
354+ #endif
355+ }
356+
329357void GeneralConf::initHistoryConfirmationToDelete ()
330358{
331359 m_historyConfirmationToDelete = new QCheckBox (
0 commit comments