Browse Source

Make keyboard shortcut defaults configurable

Aqua-sama 3 weeks ago
parent
commit
db58900d3d
Signed by: Aqua-sama <aqua@iserlohn-fortress.net> GPG Key ID: 5378B8349C1D5ADA
10 changed files with 299 additions and 210 deletions
  1. 0
    3
      .gitmodules
  2. 1
    20
      Kconfig
  3. 10
    23
      doc/Building.asciidoc
  4. 129
    0
      lib/configuration/Kconfig
  5. 30
    30
      lib/configuration/configuration.cpp
  6. 54
    19
      linux/.config
  7. 11
    8
      linux/makepkg/PKGBUILD
  8. 0
    1
      tools/Kconfiglib
  9. 11
    79
      tools/config.py
  10. 53
    27
      windows/.config

+ 0
- 3
.gitmodules View File

@@ -1,6 +1,3 @@
1 1
 [submodule "3rd-party/SingleApplication/SingleApplication.git"]
2 2
 	path = 3rd-party/SingleApplication/SingleApplication.git
3 3
 	url = https://github.com/itay-grudev/SingleApplication.git
4
-[submodule "tools/Kconfiglib"]
5
-	path = tools/Kconfiglib
6
-	url = https://github.com/ulfalizer/Kconfiglib.git

+ 1
- 20
Kconfig View File

@@ -7,26 +7,7 @@ menu "Application"
7 7
         default ":/icons/poi.svg"
8 8
 endmenu
9 9
 
10
-menu "Configuration defaults"
11
-    config PATH_CONFIG
12
-        string "Configuration location"
13
-        default "~/.config/smolbote/smolbote.cfg"
14
-    config PATH_FILTER
15
-        string "Host filter path"
16
-        default "~/.config/smolbote/hosts.d"
17
-    config PATH_PLUGINS
18
-        string "Plugin load location"
19
-        default "~/.config/smolbote/plugins.d"
20
-    config PATH_PROFILES
21
-        string "Profile load location"
22
-        default "~/.config/smolbote/profiles.d"
23
-    config PATH_BOOKMARKS
24
-        string "Bookmarks location"
25
-        default "~/.config/smolbote/bookmarks.xbel"
26
-    config PATH_DOWNLOADS
27
-        string "Downloads location"
28
-        default "~/Downloads"
29
-endmenu
10
+source lib/configuration/Kconfig
30 11
 
31 12
 config USEPLASMA
32 13
     bool "Enable KDE Frameworks integration"

+ 10
- 23
doc/Building.asciidoc View File

@@ -15,15 +15,11 @@
15 15
 
16 16
 | link:https://mesonbuild.com/[meson]
17 17
 | Version 0.48
18
-|
18
+| Requires python3 and ninja
19 19
 
20
-| ninja
21
-|
22
-| Requirement of meson
23
-
24
-| python3
25
-|
26
-| Requirement both of meson, and some scripts in tools/
20
+| link:https://github.com/ulfalizer/Kconfiglib[Kconfiglib]
21
+| Version 10.22.1
22
+| Available on PyPI with 'pip install kconfiglib'
27 23
 
28 24
 | A compiler
29 25
 | C++17 support
@@ -36,9 +32,6 @@
36 32
 |===
37 33
 
38 34
 == Building from source
39
-In short, the generic cmake build loop of 'cmake, make, make install' will
40
-generate a makefile, build the program and install it.
41
-
42 35
 [source, sh]
43 36
 ----
44 37
 # clone the repository
@@ -58,23 +51,17 @@ meson build
58 51
 ninja
59 52
 ----
60 53
 
54
+Run `meson configure` in the build directory to list available options.
55
+For more information on how to use meson, see the meson link:https://mesonbuild.com/Quick-guide.html[quick guide].
56
+
61 57
 === Configuring smolbote
62 58
 smolbote uses Kconfig to store and customize default application settings such
63
-as keyboard shortcuts and paths. You can edit these settings by running
64
-`tools/Kconfiglib/menuconfig.py` in the repository root.
59
+as keyboard shortcuts and paths. You can edit these settings using 'menuconfig'
60
+in the repository root.
65 61
 
66
-When building, tools/config.py is used to load `platform-name/.config` and
62
+When building, tools/config.py is used to load `$platform-name/.config` and
67 63
 generate a header file.
68 64
 
69
-=== Configuring meson
70
-Run `meson configure` in the build directory to list available options.
71
-
72
-Use `meson configure -Doption=value` change them. Ninja will regenerate its
73
-build file on next run.
74
-
75
-See the link:https://mesonbuild.com/Quick-guide.html[meson documentation] for
76
-more information on how to use meson.
77
-
78 65
 // Compiling on Windows
79 66
 include::Building/Windows.asciidoc[]
80 67
 

+ 129
- 0
lib/configuration/Kconfig View File

@@ -0,0 +1,129 @@
1
+
2
+menu "Configuration defaults"
3
+    config PATH_CONFIG
4
+        string "Configuration location"
5
+        default "~/.config/smolbote/smolbote.cfg"
6
+    config PATH_FILTER
7
+        string "Host filter path"
8
+        default "~/.config/smolbote/hosts.d"
9
+    config PATH_PLUGINS
10
+        string "Plugin load location"
11
+        default "~/.config/smolbote/plugins.d"
12
+    config PATH_PROFILES
13
+        string "Profile load location"
14
+        default "~/.config/smolbote/profiles.d"
15
+    config PATH_BOOKMARKS
16
+        string "Bookmarks location"
17
+        default "~/.config/smolbote/bookmarks.xbel"
18
+    config PATH_DOWNLOADS
19
+        string "Downloads location"
20
+        default "~/Downloads"
21
+endmenu
22
+
23
+menu "Keyboard shortcuts"
24
+    comment "Main Window shortcuts"
25
+    config SHORTCUT_WINDOW_NEWGROUP
26
+        string "New Group shortcut"
27
+        default "Ctrl+G"
28
+    config SHORTCUT_WINDOW_NEWWINDOW
29
+        string "New Window shortcut"
30
+        default "Ctrl+N"
31
+    config SHORTCUT_WINDOW_ABOUT
32
+        string "Show About Dialog"
33
+        default "Ctrl+H"
34
+    config SHORTCUT_WINDOW_QUIT
35
+        string "Quit shortcut"
36
+        default "Ctrl+Q"
37
+
38
+    config SHORTCUT_WINDOW_SEARCH
39
+        string "Show or hide search box"
40
+        default "F3"
41
+
42
+    config SHORTCUT_WINDOW_BOOKMARKS
43
+        string "Show bookmarks dialog in this window"
44
+        default "Ctrl+B"
45
+    config SHORTCUT_WINDOW_DOWNLOADS
46
+        string "Show downloads dialog in this window"
47
+        default "Ctrl+D"
48
+
49
+    comment "Navigation Bar shortcuts"
50
+    config SHORTCUT_NAVIGATION_BACK
51
+        string "Go back in history"
52
+        default "Ctrl+Left"
53
+    config SHORTCUT_NAVIGATION_BACKMENU
54
+        string "Show Back history menu"
55
+        default "Ctrl+Down"
56
+    config SHORTCUT_NAVIGATION_FORWARD
57
+        string "Go forward in history"
58
+        default "Ctrl+Right"
59
+    config SHORTCUT_NAVIGATION_FORWARDMENU
60
+        string "Show Forward history menu"
61
+        default "Ctrl+Up"
62
+    config SHORTCUT_NAVIGATION_REFRESH
63
+        string "Refresh the page"
64
+        default "F5"
65
+    config SHORTCUT_NAVIGATION_RELOAD
66
+        string "Reload the page"
67
+        default "Ctrl+F5"
68
+    config SHORTCUT_NAVIGATION_HOME
69
+        string "Load homepage"
70
+        default "Ctrl+Home"
71
+
72
+    comment "Address Bar shortcuts"
73
+    config SHORTCUT_ADDRESS_FOCUS
74
+        string "Focus the Address Bar"
75
+        default "F4"
76
+    config SHORTCUT_ADDRESS_MENU
77
+        string "Show Address Bar menu"
78
+        default "F2"
79
+
80
+    comment "Subwindow shortcuts"
81
+    config SHORTCUT_SUBWINDOW_MENU
82
+        string "Subwindow context menu"
83
+        default "F1"
84
+    config SHORTCUT_SUBWINDOW_TILE
85
+        string "Tile subwindows"
86
+        default "F9"
87
+    config SHORTCUT_SUBWINDOW_CASCADE
88
+        string "Cascade subwindow"
89
+        default "F10"
90
+    config SHORTCUT_SUBWINDOW_FULLSCREEN
91
+        string "Make current subwindow fullscreen"
92
+        default "F11"
93
+
94
+    config SHORTCUT_SUBWINDOW_NEWTAB
95
+        string "Create new tab"
96
+        default "Ctrl+T"
97
+    config SHORTCUT_SUBWINDOW_CLOSETAB
98
+        string "Close current tab"
99
+        default "Ctrl+X"
100
+    config SHORTCUT_SUBWINDOW_TABLEFT
101
+        string "Switch to the tab on the left"
102
+        default "Ctrl+O"
103
+    config SHORTCUT_SUBWINDOW_MOVETABLEFT
104
+        string "Move tab to the left"
105
+        default "Ctrl+Shift+O"
106
+    config SHORTCUT_SUBWINDOW_TABRIGHT
107
+        string "Switch to the tab on the right"
108
+        default "Ctrl+P"
109
+    config SHORTCUT_SUBWINDOW_MOVETABRIGHT
110
+        string "Move tab to the right"
111
+        default "Ctrl+Shift+P"
112
+
113
+endmenu
114
+
115
+menu "Profile defaults"
116
+    config PROFILE_DEFAULT
117
+        string "Default profile"
118
+        default ""
119
+    config PROFILE_DEFAULT_SEARCH
120
+        string "Search engine"
121
+        default "https://duckduckgo.com/?q=%1&ia=web"
122
+    config PROFILE_DEFAULT_HOMEPAGE
123
+        string "Homepage"
124
+        default "about:blank"
125
+    config PROFILE_DEFAULT_NEWTAB
126
+        string "New tab page"
127
+        default "about:blank"
128
+endmenu
129
+

+ 30
- 30
lib/configuration/configuration.cpp View File

@@ -67,39 +67,39 @@ Configuration::Configuration(QObject *parent)
67 67
         ("mainwindow.title", po::value<std::string>()->default_value(CONFIG_POI_NAME))
68 68
 
69 69
         // main window shortcuts
70
-        ("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value("Ctrl+G"))
71
-        ("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value("Ctrl+N"))
70
+        ("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_NEWGROUP))
71
+        ("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_NEWWINDOW))
72 72
 
73
-        ("mainwindow.shortcuts.about", po::value<std::string>()->default_value("Ctrl+H"))
74
-        ("mainwindow.shortcuts.quit", po::value<std::string>()->default_value("Ctrl+Q"))
73
+        ("mainwindow.shortcuts.about", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_ABOUT))
74
+        ("mainwindow.shortcuts.quit", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_QUIT))
75 75
 
76
-        ("mainwindow.shortcuts.search", po::value<std::string>()->default_value("F3"))
77
-        ("mainwindow.shortcuts.tileWindows", po::value<std::string>()->default_value("F9"))
78
-        ("mainwindow.shortcuts.cascadeWindows", po::value<std::string>()->default_value("F10"))
76
+        ("mainwindow.shortcuts.search", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_SEARCH))
77
+        ("mainwindow.shortcuts.tileWindows", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TILE))
78
+        ("mainwindow.shortcuts.cascadeWindows", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_CASCADE))
79 79
 
80 80
         // navigation
81 81
         ("navigation.movable", po::value<bool>()->default_value(false))
82
-        ("navigation.shortcuts.back", po::value<std::string>()->default_value("Ctrl+Left"))
83
-        ("navigation.shortcuts.backMenu", po::value<std::string>()->default_value("Ctrl+Down"))
84
-        ("navigation.shortcuts.forward", po::value<std::string>()->default_value("Ctrl+Right"))
85
-        ("navigation.shortcuts.forwardMenu", po::value<std::string>()->default_value("Ctrl+Up"))
86
-        ("navigation.shortcuts.refresh", po::value<std::string>()->default_value("F5"))
87
-        ("navigation.shortcuts.reload", po::value<std::string>()->default_value("Ctrl+F5"))
88
-        ("navigation.shortcuts.home", po::value<std::string>()->default_value("Ctrl+Home"))
82
+        ("navigation.shortcuts.back", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_BACK))
83
+        ("navigation.shortcuts.backMenu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_BACKMENU))
84
+        ("navigation.shortcuts.forward", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_FORWARD))
85
+        ("navigation.shortcuts.forwardMenu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU))
86
+        ("navigation.shortcuts.refresh", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_REFRESH))
87
+        ("navigation.shortcuts.reload", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_RELOAD))
88
+        ("navigation.shortcuts.home", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_HOME))
89 89
 
90 90
         // address bar
91
-        ("addressbar.shortcuts.focus", po::value<std::string>()->default_value("F4"))
92
-        ("addressbar.shortcuts.menu", po::value<std::string>()->default_value("F2"))
91
+        ("addressbar.shortcuts.focus", po::value<std::string>()->default_value(CONFIG_SHORTCUT_ADDRESS_FOCUS))
92
+        ("addressbar.shortcuts.menu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_ADDRESS_MENU))
93 93
 
94 94
         // subwindow
95
-        ("subwindow.shortcuts.menu", po::value<std::string>()->default_value("F1"))
96
-        ("subwindow.shortcuts.new", po::value<std::string>()->default_value("Ctrl+T"))
97
-        ("subwindow.shortcuts.close", po::value<std::string>()->default_value("Ctrl+X"))
98
-        ("subwindow.shortcuts.left", po::value<std::string>()->default_value("Ctrl+O"))
99
-        ("subwindow.shortcuts.moveLeft", po::value<std::string>()->default_value("Ctrl+Shift+O"))
100
-        ("subwindow.shortcuts.right", po::value<std::string>()->default_value("Ctrl+P"))
101
-        ("subwindow.shortcuts.moveRight", po::value<std::string>()->default_value("Ctrl+Shift+P"))
102
-        ("subwindow.shortcuts.fullscreen", po::value<std::string>()->default_value("F11"))
95
+        ("subwindow.shortcuts.menu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MENU))
96
+        ("subwindow.shortcuts.new", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_NEWTAB))
97
+        ("subwindow.shortcuts.close", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB))
98
+        ("subwindow.shortcuts.left", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TABLEFT))
99
+        ("subwindow.shortcuts.moveLeft", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT))
100
+        ("subwindow.shortcuts.right", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT))
101
+        ("subwindow.shortcuts.moveRight", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT))
102
+        ("subwindow.shortcuts.fullscreen", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN))
103 103
 
104 104
         // Filter settings
105 105
         ("filter.hosts", po::value<std::string>()->default_value(CONFIG_PATH_FILTER))
@@ -114,19 +114,19 @@ Configuration::Configuration(QObject *parent)
114 114
 
115 115
         // Profile settings
116 116
         // default profile name the browser should use; "" is off-the-record
117
-        ("profile.default", po::value<std::string>()->default_value(""))
117
+        ("profile.default", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT))
118 118
         ("profile.path", po::value<std::string>()->default_value(CONFIG_PATH_PROFILES))
119
-        ("profile.search", po::value<std::string>()->default_value("https://duckduckgo.com/?q=%1&ia=web"))
120
-        ("profile.homepage", po::value<std::string>()->default_value("about:blank"))
121
-        ("profile.newtab", po::value<std::string>()->default_value("about:blank"))
119
+        ("profile.search", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_SEARCH))
120
+        ("profile.homepage", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_HOMEPAGE))
121
+        ("profile.newtab", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_NEWTAB))
122 122
 
123 123
         // Bookmark settings
124 124
         ("bookmarks.path", po::value<std::string>()->default_value(CONFIG_PATH_BOOKMARKS))
125
-        ("bookmarks.shortcut", po::value<std::string>()->default_value("Ctrl+B"))
125
+        ("bookmarks.shortcut", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_BOOKMARKS))
126 126
 
127 127
         // Downloads settings
128 128
         ("downloads.path", po::value<std::string>()->default_value(CONFIG_PATH_DOWNLOADS))
129
-        ("downloads.shortcut", po::value<std::string>()->default_value("Ctrl+D"))
129
+        ("downloads.shortcut", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_DOWNLOADS))
130 130
         ;
131 131
 }
132 132
 

+ 54
- 19
linux/.config View File

@@ -1,27 +1,9 @@
1 1
 # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
2 2
 
3
-#
4
-# Build system settings
5
-#
6
-
7
-#
8
-# Install paths
9
-#
10
-CONFIG_INSTALL_BINDIR="bin"
11
-CONFIG_INSTALL_LIBDIR="lib64/smolbote"
12
-CONFIG_INSTALL_PLUGINDIR="lib64/smolbote/plugins"
13
-CONFIG_INSTALL_APPDIR="share/applications"
14
-CONFIG_INSTALL_ICONDIR="share/icons"
15
-
16
-#
17
-# Application Settings
18
-#
19
-
20 3
 #
21 4
 # Application
22 5
 #
23 6
 CONFIG_POI_NAME="smolbote"
24
-CONFIG_POI_EXE="poi"
25 7
 CONFIG_POI_ICON=":/icon.svg"
26 8
 
27 9
 #
@@ -33,6 +15,60 @@ CONFIG_PATH_PLUGINS="~/.config/smolbote/plugins.d"
33 15
 CONFIG_PATH_PROFILES="~/.config/smolbote/profiles.d"
34 16
 CONFIG_PATH_BOOKMARKS="~/.config/smolbote/bookmarks.xbel"
35 17
 CONFIG_PATH_DOWNLOADS="~/Downloads"
18
+
19
+#
20
+# Keyboard shortcuts
21
+#
22
+
23
+#
24
+# Main Window shortcuts
25
+#
26
+CONFIG_SHORTCUT_WINDOW_NEWGROUP="Ctrl+G"
27
+CONFIG_SHORTCUT_WINDOW_NEWWINDOW="Ctrl+N"
28
+CONFIG_SHORTCUT_WINDOW_ABOUT="Ctrl+H"
29
+CONFIG_SHORTCUT_WINDOW_QUIT="Ctrl+Q"
30
+CONFIG_SHORTCUT_WINDOW_SEARCH="F3"
31
+CONFIG_SHORTCUT_WINDOW_BOOKMARKS="Ctrl+B"
32
+CONFIG_SHORTCUT_WINDOW_DOWNLOADS="Ctrl+D"
33
+
34
+#
35
+# Navigation Bar shortcuts
36
+#
37
+CONFIG_SHORTCUT_NAVIGATION_BACK="Ctrl+Left"
38
+CONFIG_SHORTCUT_NAVIGATION_BACKMENU="Ctrl+Down"
39
+CONFIG_SHORTCUT_NAVIGATION_FORWARD="Ctrl+Right"
40
+CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU="Ctrl+Up"
41
+CONFIG_SHORTCUT_NAVIGATION_REFRESH="F5"
42
+CONFIG_SHORTCUT_NAVIGATION_RELOAD="Ctrl+F5"
43
+CONFIG_SHORTCUT_NAVIGATION_HOME="Ctrl+Home"
44
+
45
+#
46
+# Address Bar shortcuts
47
+#
48
+CONFIG_SHORTCUT_ADDRESS_FOCUS="F4"
49
+CONFIG_SHORTCUT_ADDRESS_MENU="F2"
50
+
51
+#
52
+# Subwindow shortcuts
53
+#
54
+CONFIG_SHORTCUT_SUBWINDOW_MENU="F1"
55
+CONFIG_SHORTCUT_SUBWINDOW_TILE="F9"
56
+CONFIG_SHORTCUT_SUBWINDOW_CASCADE="F10"
57
+CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN="F11"
58
+CONFIG_SHORTCUT_SUBWINDOW_NEWTAB="Ctrl+T"
59
+CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB="Ctrl+X"
60
+CONFIG_SHORTCUT_SUBWINDOW_TABLEFT="Ctrl+O"
61
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT="Ctrl+Shift+O"
62
+CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT="Ctrl+P"
63
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT="Ctrl+Shift+P"
64
+
65
+#
66
+# Profile defaults
67
+#
68
+CONFIG_PROFILE_DEFAULT=""
69
+CONFIG_PROFILE_DEFAULT_SEARCH="https://duckduckgo.com/?q=%1&ia=web"
70
+CONFIG_PROFILE_DEFAULT_HOMEPAGE="about:blank"
71
+CONFIG_PROFILE_DEFAULT_NEWTAB="about:blank"
36 72
 CONFIG_USEPLASMA=y
37 73
 
38 74
 #
@@ -45,5 +81,4 @@ CONFIG_WALLET_FOLDER="smolbote"
45 81
 #
46 82
 # Workarounds
47 83
 #
48
-CONFIG_QTBUG_62511=y
49 84
 CONFIG_QTBUG_65223=y

+ 11
- 8
linux/makepkg/PKGBUILD View File

@@ -14,15 +14,13 @@ license=('GPL3')
14 14
 
15 15
 depends=('qt5-webengine>=5.11.0' 'boost-libs>=1.66.0')
16 16
 optdepends=('firejail: launch a sandboxed instance')
17
-makedepends=('git' 'meson' 'pkg-config' 'asciidoctor')
17
+makedepends=('git' 'meson' 'pkg-config' 'python-kconfiglib' 'asciidoctor')
18 18
 
19 19
 # this is the central repository
20 20
 source=("git+https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote.git"
21
-        "git+https://github.com/itay-grudev/SingleApplication.git"
22
-        "git+https://github.com/ulfalizer/Kconfiglib.git")
21
+        "git+https://github.com/itay-grudev/SingleApplication.git")
23 22
 
24 23
 sha512sums=('SKIP'
25
-            'SKIP'
26 24
             'SKIP')
27 25
 
28 26
 #validgpgkeys=(# Aqua-sama <aqua@iserlohn-fortress.net>
@@ -34,8 +32,6 @@ prepare() {
34 32
     git submodule init
35 33
     git config submodule.3rd-party/SingleApplication/SingleApplication.git.url $srcdir/SingleApplication
36 34
     git submodule update 3rd-party/SingleApplication/SingleApplication.git
37
-    git config submodule.tools/Kconfiglib.url $srcdir/Kconfiglib
38
-    git submodule update tools/Kconfiglib
39 35
 }
40 36
 
41 37
 pkgver() {
@@ -51,12 +47,19 @@ build() {
51 47
 
52 48
     # For a list of configureable options, check smolbote/meson_options.txt, or
53 49
     # run `meson configure` in $srcdir/build
54
-    meson --buildtype=release --prefix=/usr/local --auto-features=disabled $srcdir/build
50
+    # --buildtype=plain - meson won't add any flags to the command line
51
+    # --prefix=... - install prefix
52
+    # --auto-features=disabled - features should be explicitly enabled
53
+    meson --buildtype=plain --prefix=/usr/local --auto-features=disabled $srcdir/build
55 54
 
56
-    # Build
57 55
     cd $srcdir/build
56
+
57
+    # Toggle features
58
+    #meson configure -DBreakpad=enabled
58 59
     meson configure -DPlasma=enabled
59 60
     meson configure -Dmanpage=enabled
61
+
62
+    # Build
60 63
     ninja
61 64
 }
62 65
 

+ 0
- 1
tools/Kconfiglib

@@ -1 +0,0 @@
1
-Subproject commit 5d918357dd5734b900e1fdf074090ea662debd9e

+ 11
- 79
tools/config.py View File

@@ -1,88 +1,20 @@
1 1
 #!/usr/bin/env python3
2 2
 
3
+import os
3 4
 import argparse
4
-from Kconfiglib import kconfiglib
5
-
6
-def search(node, term):
7
-    while node:
8
-        if isinstance(node.item, kconfiglib.Symbol):
9
-            if node.item.name == term:
10
-                return node.item.str_value
11
-
12
-        if node.list:
13
-            r = search(node.list, term)
14
-            if r is not None:
15
-                return r
16
-
17
-        node = node.next
18
-
19
-def searchBug(node, term):
20
-    bugs = ""
21
-
22
-    while node:
23
-        if isinstance(node.item, kconfiglib.Symbol):
24
-            if node.item.name.startswith(term):
25
-                if bugs is not "":
26
-                    bugs += ";"
27
-                bugs += node.item.name
28
-
29
-        if node.list:
30
-            r = searchBug(node.list, term)
31
-            if r is not None and r is not "":
32
-                if bugs is not "":
33
-                    bugs += ";"
34
-                bugs += r
35
-
36
-        node = node.next
37
-    return bugs
38
-
39
-def main(args):
40
-    kconf = kconfiglib.Kconfig(args.kconfig)
41
-    if args.dotconfig is not None:
42
-        kconf.load_config(args.dotconfig)
43
-
44
-    i = ""
45
-    if args.setting.endswith("BUG"):
46
-        i = searchBug(kconf.top_node, args.setting)
47
-    else:
48
-        i = search(kconf.top_node, args.setting)
49
-
50
-    if i is not None:
51
-        print(i)
52
-
53
-def writeItem(node, gen):
54
-    while node:
55
-        if isinstance(node.item, kconfiglib.Symbol):
56
-            if node.item.str_value == 'y':
57
-                gen.write("#define CONFIG_{0}\n".format(node.item.name))
58
-            elif node.item.str_value == 'n':
59
-                gen.write("#undef CONFIG_{0}\n".format(node.item.name))
60
-            else:
61
-                gen.write("#define CONFIG_{0} \"{1}\"\n".format(node.item.name, node.item.str_value))
62
-
63
-        if node.list:
64
-            writeItem(node.list, gen)
65
-
66
-        node = node.next
67
-
68
-def generate(args):
69
-    kconf = kconfiglib.Kconfig(args.kconfig)
70
-    if args.dotconfig is not None:
71
-        kconf.load_config(args.dotconfig)
72
-
73
-    with open(args.generate, "wt") as gen:
74
-        gen.write("// This is an auto-generated file, do not edit.\n")
75
-        writeItem(kconf.top_node, gen)
5
+import subprocess
76 6
 
77 7
 if __name__ == "__main__":
78 8
     parser = argparse.ArgumentParser()
79 9
     parser.add_argument("--kconfig", metavar="Kconfig", nargs="?", default="Kconfig", help="Top-level Kconfig file (default: Kconfig)")
80
-    parser.add_argument("--dotconfig", metavar="dotconfig", nargs="?", help=".config")
81
-    parser.add_argument("--generate", metavar="config_header", nargs="?", help="Generate config file")
82
-    parser.add_argument("setting", metavar="CONFIG_KEY", nargs="?", help="Top-level Kconfig file (default: Kconfig)")
10
+    parser.add_argument("--dotconfig", metavar="dotconfig", nargs="?", default=".config", help=".config")
11
+    parser.add_argument("--generate", metavar="config_header", nargs="?", default="config.h", help="Generate config file")
83 12
 
84 13
     args = parser.parse_args()
85
-    if args.generate is not None:
86
-        generate(args)
87
-    else:
88
-        main(args)
14
+
15
+    # set srctree, otherwise includes don't work
16
+    os.environ["srctree"] = os.path.dirname(os.path.realpath(args.kconfig))
17
+    os.environ["KCONFIG_CONFIG"] = os.path.realpath(args.dotconfig)
18
+
19
+    subprocess.run(["genconfig", os.path.realpath(args.kconfig), "--header-path=" + args.generate], check=True)
20
+

+ 53
- 27
windows/.config View File

@@ -1,52 +1,78 @@
1
+# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
2
+
1 3
 #
2
-# Automatically generated file; DO NOT EDIT.
3
-# smolbote configuration
4
+# Application
4 5
 #
6
+CONFIG_POI_NAME="smolbote"
7
+CONFIG_POI_ICON=":/icons/poi.svg"
5 8
 
6 9
 #
7
-# Build
10
+# Configuration defaults
8 11
 #
12
+CONFIG_PATH_CONFIG="smolbote.cfg"
13
+CONFIG_PATH_FILTER="hosts"
14
+CONFIG_PATH_PLUGINS="plugins"
15
+CONFIG_PATH_PROFILES="profiles"
16
+CONFIG_PATH_BOOKMARKS="bookmarks.xbel"
17
+CONFIG_PATH_DOWNLOADS="~/Downloads"
9 18
 
10 19
 #
11
-# Compiler settings
20
+# Keyboard shortcuts
12 21
 #
13
-CONFIG_CXX_FLAGS=""
14
-CONFIG_CXX_FLAGS_DEBUG=""
15
-CONFIG_CXX_FLAGS_RELEASE=""
16 22
 
17 23
 #
18
-# Install paths
24
+# Main Window shortcuts
19 25
 #
20
-CONFIG_INSTALL_PREFIX=""
21
-CONFIG_INSTALL_BIN=""
22
-CONFIG_INSTALL_LIB="plugins"
26
+CONFIG_SHORTCUT_WINDOW_NEWGROUP="Ctrl+G"
27
+CONFIG_SHORTCUT_WINDOW_NEWWINDOW="Ctrl+N"
28
+CONFIG_SHORTCUT_WINDOW_ABOUT="Ctrl+H"
29
+CONFIG_SHORTCUT_WINDOW_QUIT="Ctrl+Q"
30
+CONFIG_SHORTCUT_WINDOW_SEARCH="F3"
31
+CONFIG_SHORTCUT_WINDOW_BOOKMARKS="Ctrl+B"
32
+CONFIG_SHORTCUT_WINDOW_DOWNLOADS="Ctrl+D"
23 33
 
24 34
 #
25
-# Branding
35
+# Navigation Bar shortcuts
26 36
 #
27
-CONFIG_POI_NAME="smolbote"
28
-CONFIG_POI_EXE="poi"
37
+CONFIG_SHORTCUT_NAVIGATION_BACK="Ctrl+Left"
38
+CONFIG_SHORTCUT_NAVIGATION_BACKMENU="Ctrl+Down"
39
+CONFIG_SHORTCUT_NAVIGATION_FORWARD="Ctrl+Right"
40
+CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU="Ctrl+Up"
41
+CONFIG_SHORTCUT_NAVIGATION_REFRESH="F5"
42
+CONFIG_SHORTCUT_NAVIGATION_RELOAD="Ctrl+F5"
43
+CONFIG_SHORTCUT_NAVIGATION_HOME="Ctrl+Home"
29 44
 
30 45
 #
31
-# Browser configuration
46
+# Address Bar shortcuts
32 47
 #
48
+CONFIG_SHORTCUT_ADDRESS_FOCUS="F4"
49
+CONFIG_SHORTCUT_ADDRESS_MENU="F2"
33 50
 
34 51
 #
35
-# Configuration defaults
52
+# Subwindow shortcuts
53
+#
54
+CONFIG_SHORTCUT_SUBWINDOW_MENU="F1"
55
+CONFIG_SHORTCUT_SUBWINDOW_TILE="F9"
56
+CONFIG_SHORTCUT_SUBWINDOW_CASCADE="F10"
57
+CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN="F11"
58
+CONFIG_SHORTCUT_SUBWINDOW_NEWTAB="Ctrl+T"
59
+CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB="Ctrl+X"
60
+CONFIG_SHORTCUT_SUBWINDOW_TABLEFT="Ctrl+O"
61
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT="Ctrl+Shift+O"
62
+CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT="Ctrl+P"
63
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT="Ctrl+Shift+P"
64
+
36 65
 #
37
-CONFIG_PATH_CONFIG="smolbote.cfg"
38
-CONFIG_PATH_CRASHDUMP="crashes"
39
-CONFIG_PATH_FILTER="hosts"
40
-CONFIG_PATH_PLUGINS="plugins"
41
-CONFIG_PATH_PROFILES="profiles"
42
-CONFIG_PATH_BOOKMARKS="bookmarks.xbel"
43
-CONFIG_PATH_DOWNLOADS="~/Downloads"
66
+# Profile defaults
67
+#
68
+CONFIG_PROFILE_DEFAULT=""
69
+CONFIG_PROFILE_DEFAULT_SEARCH="https://duckduckgo.com/?q=%1&ia=web"
70
+CONFIG_PROFILE_DEFAULT_HOMEPAGE="about:blank"
71
+CONFIG_PROFILE_DEFAULT_NEWTAB="about:blank"
44 72
 # CONFIG_USEPLASMA is not set
45 73
 # CONFIG_USEBREAKPAD is not set
46 74
 
47 75
 #
48
-# Devel
76
+# Workarounds
49 77
 #
50
-CONFIG_QTWARNINGS=y
51
-# CONFIG_TESTS is not set
52
-# CONFIG_LLVMLIBCPP is not set
78
+CONFIG_QTBUG_65223=y

Loading…
Cancel
Save