From 5c5b3dcf6053eb3dedcae89e7c5f1a48dda08504 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 27 May 2022 09:45:15 -0500 Subject: [PATCH] tweaking some settings --- LightlyShaders/default.nix | 30 ++--- LightlyShaders/result | 2 +- README.org | 11 ++ espanso/default.yml | 4 + qt5ct.patch | 195 +++++++++++++++++++++++++++++++ system/kaladin/configuration.nix | 11 ++ system/syl/configuration.nix | 11 ++ user/home.nix | 13 +++ 8 files changed, 263 insertions(+), 14 deletions(-) create mode 100644 qt5ct.patch diff --git a/LightlyShaders/default.nix b/LightlyShaders/default.nix index 9d68460..80e89c0 100644 --- a/LightlyShaders/default.nix +++ b/LightlyShaders/default.nix @@ -13,6 +13,7 @@ # kcoreaddons, # systemsettings, cmake, + qt5Full, extra-cmake-modules, wrapQtAppsHook, libepoxy, @@ -22,19 +23,20 @@ stdenv.mkDerivation rec { pname = "LightlyShaders"; - version = "0.0.4"; + version = "0.1.4"; src = fetchFromGitHub { owner = "a-parhom"; repo = "LightlyShaders"; rev = "0294499afece1620f47fa38fa74fa8604077347f"; - sha256 = "MJk2pXRmyZDZX7KeZBHNKi0WQcQwqTM1nZWTWSxnvfc="; + sha256 = "8EL1e4YKY63U7kvqBLfqSzYHdls1BD6OYh4X5+B7EcQ="; }; # dontWrapQtApps = true; buildInputs = [ qtbase + qt5Full # qtx11extras # qttools # kglobalaccel @@ -55,18 +57,20 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; + # preConfigure = '' + # # local modulepath=$(kf5-config --install module) + # # local datapath=$(kf5-config --install data) + # # local servicespath=$(kf5-config --install services) + # # substituteInPlace CMakeLists.txt \ + # # --replace "\''${MODULEPATH}" "$out/''${modulepath#/nix/store/*/}" \ + # # --replace "\''${DATAPATH}" "$out/''${datapath#/nix/store/*/}" + + # # substituteInPlace CMakeLists.txt \ + # # --replace "\''${MODULEPATH}" "$out/qt-5.15.3/plugins" \ + # # --replace "\''${DATAPATH}" "$out/share" + # ''; + postConfigure = '' - # local modulepath=$(kf5-config --install module) - # local datapath=$(kf5-config --install data) - # local servicespath=$(kf5-config --install services) - # substituteInPlace CMakeLists.txt \ - # --replace "\''${MODULEPATH}" "$out/''${modulepath#/nix/store/*/}" \ - # --replace "\''${DATAPATH}" "$out/''${datapath#/nix/store/*/}" - - # substituteInPlace CMakeLists.txt \ - # --replace "\''${MODULEPATH}" "$out/qt-5.15.3/plugins" \ - # --replace "\''${DATAPATH}" "$out/share" - substituteInPlace cmake_install.cmake \ --replace "${kdelibs4support}" "$out" diff --git a/LightlyShaders/result b/LightlyShaders/result index 1b8c76b..28d3281 120000 --- a/LightlyShaders/result +++ b/LightlyShaders/result @@ -1 +1 @@ -/nix/store/8v4a6zsgpal8vs6xrsqkzknxpajkbwbl-LightlyShaders-0.0.3 \ No newline at end of file +/nix/store/1fammczms41261rbb66pmrafpfqlsdjr-LightlyShaders-0.0.4 \ No newline at end of file diff --git a/README.org b/README.org index 6fcd4af..f3931f2 100644 --- a/README.org +++ b/README.org @@ -245,6 +245,7 @@ pfetch macchina gimp powertop +quickemu #+end_src Here are some dev tools that I often have on a few devices. @@ -302,6 +303,16 @@ For some reason the emacs overlay has a specific sha256. So I'll create it in ea }); } ) + +(self: super: + { + qt5ct = super.qt5ct.overrideAttrs (old: rec { + patches = (old.patches or []) ++ [ + ../../qt5ct.patch + ]; + }); + } +) #+end_src *** Emacs diff --git a/espanso/default.yml b/espanso/default.yml index 4933988..f955d2e 100644 --- a/espanso/default.yml +++ b/espanso/default.yml @@ -7,6 +7,7 @@ # disable search bar search_shortcut: OFF search_trigger: OFF +toggle_key: OFF # Matches are the substitution rules, when you type the "trigger" string # it gets replaced by the "replace" string. @@ -44,3 +45,6 @@ matches: - trigger: ":name" replace: "Chris Cochrun" + + - trigger: ":cn" + replace: "A Giant Gummy Lizard" diff --git a/qt5ct.patch b/qt5ct.patch new file mode 100644 index 0000000..61a1f1b --- /dev/null +++ b/qt5ct.patch @@ -0,0 +1,195 @@ +Index: qt5ct/CMakeLists.txt +=================================================================== +--- qt5ct/CMakeLists.txt (revision 622) ++++ qt5ct/CMakeLists.txt (working copy) +@@ -24,8 +24,11 @@ + + ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=0x050C00 -DUSE_WIDGETS) + +-find_package(Qt5 ${QT_MINIMUM_VERSION} COMPONENTS Widgets Concurrent LinguistTools DBus ThemeSupport REQUIRED) ++find_package(Qt5 ${QT_MINIMUM_VERSION} COMPONENTS Widgets Concurrent LinguistTools DBus QuickControls2 ThemeSupport REQUIRED) + find_package(Qt5Gui ${QT_MINIMUM_VERSION} CONFIG REQUIRED Private) ++find_package(KF5Config REQUIRED) ++find_package(KF5ConfigWidgets REQUIRED) ++find_package(KF5IconThemes REQUIRED) + + get_target_property(QT_LRELEASE_EXECUTABLE Qt5::lrelease IMPORTED_LOCATION) + +@@ -44,7 +47,9 @@ + message(FATAL_ERROR "Could NOT find qtpaths executable") + endif() + +-execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE) ++if(NOT PLUGINDIR) ++ execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE) ++endif() + message(STATUS "Plugin path: " ${PLUGINDIR}) + + message(STATUS "Generating translations ...") +Index: qt5ct/src/qt5ct/appearancepage.cpp +=================================================================== +--- qt5ct/src/qt5ct/appearancepage.cpp (revision 622) ++++ qt5ct/src/qt5ct/appearancepage.cpp (working copy) +@@ -86,6 +86,8 @@ + #else + keys = QPlatformThemeFactory::keys(); + m_ui->dialogComboBox->addItem(tr("Default"), "default"); ++ if(keys.contains("xdgdesktopportal")) ++ m_ui->dialogComboBox->addItem("XDG Desktop Portal", "xdgdesktopportal"); + if(keys.contains("gtk2") || keys.contains("qt5gtk2")) + m_ui->dialogComboBox->addItem("GTK2", "gtk2"); + else if(keys.contains("gtk3") || keys.contains("qt5gtk3")) +@@ -390,7 +392,7 @@ + { + QDir dir(path); + dir.setFilter(QDir::Files); +- dir.setNameFilters(QStringList() << "*.conf"); ++ dir.setNameFilters(QStringList() << "*.conf" << "*.colors"); + + for(QFileInfo info : dir.entryInfoList()) + { +Index: qt5ct/src/qt5ct/qt5ct.cpp +=================================================================== +--- qt5ct/src/qt5ct/qt5ct.cpp (revision 622) ++++ qt5ct/src/qt5ct/qt5ct.cpp (working copy) +@@ -111,6 +111,7 @@ + for(const QString &p : QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) + { + paths << (p + QLatin1String("/qt5ct/colors")); ++ paths << (p + QLatin1String("/color-schemes")); + } + paths << QLatin1String(QT5CT_DATADIR"/qt5ct/colors"); + paths.removeDuplicates(); +Index: qt5ct/src/qt5ct-qtplugin/CMakeLists.txt +=================================================================== +--- qt5ct/src/qt5ct-qtplugin/CMakeLists.txt (revision 622) ++++ qt5ct/src/qt5ct-qtplugin/CMakeLists.txt (working copy) +@@ -10,5 +10,5 @@ + + add_library(qt5ct-qtplugin MODULE ${app_SRCS}) + set_target_properties(qt5ct-qtplugin PROPERTIES OUTPUT_NAME qt5ct) +-target_link_libraries(qt5ct-qtplugin PRIVATE Qt5::Widgets Qt5::GuiPrivate Qt5::DBus Qt5::ThemeSupportPrivate) ++target_link_libraries(qt5ct-qtplugin PRIVATE Qt5::Widgets Qt5::GuiPrivate Qt5::DBus Qt5::QuickControls2 Qt5::ThemeSupportPrivate KF5::ConfigCore KF5::ConfigWidgets KF5::IconThemes) + install(TARGETS qt5ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes) +Index: qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp +=================================================================== +--- qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp (revision 622) ++++ qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp (working copy) +@@ -45,6 +45,7 @@ + #endif + #include + #include ++#include + + #include + #include "qt5ctplatformtheme.h" +@@ -60,6 +61,11 @@ + #include + #endif + ++#include ++#include ++#include ++#include ++ + Q_LOGGING_CATEGORY(lqt5ct, "qt5ct", QtWarningMsg) + + //QT_QPA_PLATFORMTHEME=qt5ct +@@ -75,6 +81,10 @@ + QMetaObject::invokeMethod(this, "createFSWatcher", Qt::QueuedConnection); + #endif + QGuiApplication::setFont(m_generalFont); ++ //if the user has explicitly set something else, don't meddle ++ if (QQuickStyle::name().isEmpty()) { ++ QQuickStyle::setStyle(QLatin1String("org.kde.desktop")); ++ } + } + qCDebug(lqt5ct) << "using qt5ct plugin"; + #ifdef QT_WIDGETS_LIB +@@ -81,6 +91,7 @@ + if(!QStyleFactory::keys().contains("qt5ct-style")) + qCCritical(lqt5ct) << "unable to find qt5ct proxy style"; + #endif ++ QCoreApplication::instance()->installEventFilter(this); + } + + Qt5CTPlatformTheme::~Qt5CTPlatformTheme() +@@ -195,6 +206,11 @@ + } + #endif + ++QIconEngine *Qt5CTPlatformTheme::createIconEngine(const QString &iconName) const ++{ ++ return new KIconEngine(iconName, KIconLoader::global()); ++} ++ + void Qt5CTPlatformTheme::applySettings() + { + if(!QGuiApplication::desktopSettingsAware() || m_isIgnored) +@@ -313,7 +329,15 @@ + if(!schemePath.isEmpty() && settings.value("custom_palette", false).toBool()) + { + schemePath = Qt5CT::resolvePath(schemePath); //replace environment variables +- m_palette = new QPalette(loadColorScheme(schemePath)); ++ if(schemePath.endsWith(".colors")) ++ { ++ m_palette = new QPalette(KColorScheme::createApplicationPalette(KSharedConfig::openConfig(schemePath))); ++ qApp->setProperty("KDE_COLOR_SCHEME_PATH", schemePath); ++ } ++ else ++ { ++ m_palette = new QPalette(loadColorScheme(schemePath)); ++ } + } + m_iconTheme = settings.value("icon_theme").toString(); + //load dialogs +@@ -480,3 +504,30 @@ + + return customPalette; + } ++ ++bool Qt5CTPlatformTheme::eventFilter(QObject *obj, QEvent *e) ++{ ++ if(obj == qApp && e->type() == QEvent::DynamicPropertyChange) ++ { ++ QDynamicPropertyChangeEvent *ee = static_cast(e); ++ if(ee->propertyName() == "KDE_COLOR_SCHEME_PATH") ++ { ++ if(qApp->property("KDE_COLOR_SCHEME_PATH").isNull()) ++ { ++ QSettings settings(Qt5CT::configFile(), QSettings::IniFormat); ++ settings.beginGroup("Appearance"); ++ QString schemePath = settings.value("color_scheme_path").toString(); ++ if(!schemePath.isEmpty() && settings.value("custom_palette", false).toBool()) ++ { ++ schemePath = Qt5CT::resolvePath(schemePath); //replace environment variables ++ if(schemePath.endsWith(".colors")) ++ { ++ qApp->setProperty("KDE_COLOR_SCHEME_PATH", schemePath); ++ applySettings(); ++ } ++ } ++ } ++ } ++ } ++ return QObject::eventFilter(obj, e); ++} +Index: qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.h +=================================================================== +--- qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.h (revision 622) ++++ qt5ct/src/qt5ct-qtplugin/qt5ctplatformtheme.h (working copy) +@@ -91,10 +91,13 @@ + //virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, + // QPlatformTheme::IconOptions iconOptions = 0) const; + +- //virtual QIconEngine *createIconEngine(const QString &iconName) const; ++ virtual QIconEngine *createIconEngine(const QString &iconName) const; + //virtual QList keyBindings(QKeySequence::StandardKey key) const; + //virtual QString standardButtonText(int button) const; + ++protected: ++ bool eventFilter(QObject *obj, QEvent *e) override; ++ + private slots: + void applySettings(); + #ifdef QT_WIDGETS_LIB \ No newline at end of file diff --git a/system/kaladin/configuration.nix b/system/kaladin/configuration.nix index a99ddf3..f080040 100644 --- a/system/kaladin/configuration.nix +++ b/system/kaladin/configuration.nix @@ -215,6 +215,7 @@ macchina gimp powertop + quickemu blender neofetch # Dev tools @@ -262,6 +263,16 @@ }); } ) + + (self: super: + { + qt5ct = super.qt5ct.overrideAttrs (old: rec { + patches = (old.patches or []) ++ [ + ../../qt5ct.patch + ]; + }); + } + ) ]; services.emacs = { diff --git a/system/syl/configuration.nix b/system/syl/configuration.nix index dd4f7b0..d0db4d8 100644 --- a/system/syl/configuration.nix +++ b/system/syl/configuration.nix @@ -244,6 +244,7 @@ macchina gimp powertop + quickemu neofetch afetch yafetch @@ -297,6 +298,16 @@ }); } ) + + (self: super: + { + qt5ct = super.qt5ct.overrideAttrs (old: rec { + patches = (old.patches or []) ++ [ + ../../qt5ct.patch + ]; + }); + } + ) ]; services.emacs = { diff --git a/user/home.nix b/user/home.nix index d314881..7a183de 100644 --- a/user/home.nix +++ b/user/home.nix @@ -246,6 +246,7 @@ enable = true; settings = { + toggle_key = "RIGHT_CTRL"; matches = [ { # dates trigger = ":date"; @@ -282,6 +283,10 @@ trigger = ":name"; replace = "Chris Cochrun"; } + { + trigger = ":cn"; + replace = "A Giant Gummy Lizard"; + } ]; }; }; @@ -420,6 +425,14 @@ categories = [ "Application" ]; mimeType = [ "audio/ogg" "audio/mpeg" "audio/opus" "audio/x-opus+ogg" "audio/x-wav" ]; }; + imv-rifle = { + name = "IMV"; + genericName = "Show images in current directory in IMV"; + exec = "/home/chris/bin/rifle-imv %U"; + terminal = false; + categories = [ "Application" ]; + mimeType = [ "image/gif" "image/jpeg" "image/png" "image/heif" ]; + }; }; systemd.user.services = {