Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support almost arbitrary characters in dir names #101

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 7 additions & 40 deletions data/dconf.settings
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
[org/virt-manager/virt-manager/urls]
isos=['/home/bbigras/Downloads/something {ddsa}']

[ org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9 ]
[org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]
foo=true

[ org/gnome/desktop/interface ]
clock-show-weekday=true
document-font-name=' JetBrainsMono Nerd Font 11 '
enable-hot-corners=false
font-name=' JetBrainsMono Nerd Font 11 '
gtk-im-module=' gtk-im-context-simple '
gtk-theme=' Adwaita-dark '
icon-theme=' Adwaita '
monospace-font-name=' JetBrainsMono Nerd Font 10 '
show-battery-percentage=true

[ org/gnome/desktop/peripherals/mouse ]
natural-scroll=false
speed=-0.5

[ org/gnome/desktop/peripherals/touchpad ]
tap-to-click=false
two-finger-scrolling-enabled=true

[ org/gnome/desktop/screensaver ]
picture-uri=' file:///home/gvolpe/Pictures/nixos.png '

[ org/gnome/desktop/sound ]
allow-volume-above-100-percent=true
event-sounds=true

[org/gnome/desktop/wm/keybindings]
close=['<Super>w']
switch-applications=@as []
switch-applications-backward=@as []
switch-windows=['<Alt>Tab']
switch-windows-backward=['<Shift><Alt>Tab']

[ org/gnome/desktop/wm/preferences ]
button-layout=' close,minimize,maximize:'
titlebar-font='JetBrainsMono Nerd Font Mono 11'
workspace-names=@as []

[ca/desrt/dconf-editor]
saved-pathbar-path='/org/gnome/desktop/input-sources/'
saved-view='/org/gnome/desktop/input-sources/'
Expand Down Expand Up @@ -226,10 +195,6 @@ disabled-extensions=['apps-menu@gnome-shell-extensions.gcampax.github.com', 'pla
enabled-extensions=['horizontal-workspaces@gnome-shell-extensions.gcampax.github.com', 'drive-menu@gnome-shell-extensions.gcampax.github.com', 'screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com', 'workspace-indicator@gnome-shell-extensions.gcampax.github.com', 'user-theme@gnome-shell-extensions.gcampax.github.com', 'dash-to-dock@micxgx.gmail.com', 'timepp@zagortenay333', 'TopIcons@phocean.net']
favorite-apps=['chromium-browser.desktop', 'spotify.desktop', 'slack.desktop', 'telegramdesktop.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.tweaks.desktop', 'terminator.desktop']

[org/gnome/shell/extensions/dash-to-dock ]
dock-fixed=false
dock-position=' BOTTOM '

[org/gnome/shell/extensions/dash-to-dock]
background-opacity=0.80000000000000004
custom-theme-shrink=false
Expand All @@ -247,10 +212,6 @@ running-indicator-style='DEFAULT'
show-trash=false
transparency-mode='DEFAULT'

[org/gnome/shell/extensions/desktop-icons ]
show-home=false
show-trash=false

[org/gnome/shell/extensions/desktop-icons]
show-home=false
show-trash=false
Expand Down Expand Up @@ -329,3 +290,9 @@ pictures-directory=@ms nothing

[org/gnome/easytag]
default-path=b'/home/alice/Music'

[ test / *#@= All the special characters ]
foo_bar='test'

[com/github/wwmm/easyeffects/streamoutputs/compressor#0]
sidechain-input-device='alsa_input.platform-snd_aloop.0.analog-stereo'
2 changes: 1 addition & 1 deletion data/emoji.settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[ org/gnome/Characters ]
[org/gnome/Characters]
recent-characters=['💡']
some-other-character=['🤓']
emoji-in-double-quotes=["🔥"]
55 changes: 8 additions & 47 deletions output/dconf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,6 @@ with lib.hm.gvariant;
foo = true;
};

"org/gnome/desktop/interface" = {
clock-show-weekday = true;
document-font-name = " JetBrainsMono Nerd Font 11 ";
enable-hot-corners = false;
font-name = " JetBrainsMono Nerd Font 11 ";
gtk-im-module = " gtk-im-context-simple ";
gtk-theme = " Adwaita-dark ";
icon-theme = " Adwaita ";
monospace-font-name = " JetBrainsMono Nerd Font 10 ";
show-battery-percentage = true;
};

"org/gnome/desktop/peripherals/mouse" = {
natural-scroll = false;
speed = -0.5;
};

"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = false;
two-finger-scrolling-enabled = true;
};

"org/gnome/desktop/screensaver" = {
picture-uri = " file:///home/gvolpe/Pictures/nixos.png ";
};

"org/gnome/desktop/sound" = {
allow-volume-above-100-percent = true;
event-sounds = true;
};

"org/gnome/desktop/wm/keybindings" = {
close = [ "<Super>w" ];
switch-applications = [];
Expand All @@ -52,12 +21,6 @@ with lib.hm.gvariant;
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};

"org/gnome/desktop/wm/preferences" = {
button-layout = " close,minimize,maximize:";
titlebar-font = "JetBrainsMono Nerd Font Mono 11";
workspace-names = [];
};

"ca/desrt/dconf-editor" = {
saved-pathbar-path = "/org/gnome/desktop/input-sources/";
saved-view = "/org/gnome/desktop/input-sources/";
Expand Down Expand Up @@ -284,11 +247,6 @@ with lib.hm.gvariant;
favorite-apps = [ "chromium-browser.desktop" "spotify.desktop" "slack.desktop" "telegramdesktop.desktop" "org.gnome.Nautilus.desktop" "org.gnome.tweaks.desktop" "terminator.desktop" ];
};

"org/gnome/shell/extensions/dash-to-dock" = {
dock-fixed = false;
dock-position = " BOTTOM ";
};

"org/gnome/shell/extensions/dash-to-dock" = {
background-opacity = 0.8;
custom-theme-shrink = false;
Expand All @@ -312,11 +270,6 @@ with lib.hm.gvariant;
show-trash = false;
};

"org/gnome/shell/extensions/desktop-icons" = {
show-home = false;
show-trash = false;
};

"org/gnome/shell/extensions/timepp" = {
alarms-fullscreen-monitor-pos = 0;
alarms-sound-file-path = "file:///home/gvolpe/.nix-profile/share/gnome-shell/extensions/timepp@zagortenay333/data/sounds/beeps.ogg";
Expand Down Expand Up @@ -413,5 +366,13 @@ with lib.hm.gvariant;
default-path = mkByteString ''/home/alice/Music'';
};

" test / *#@= All the special characters " = {
foo_bar = "test";
};

"com/github/wwmm/easyeffects/streamoutputs/compressor#0" = {
sidechain-input-device = "alsa_input.platform-snd_aloop.0.analog-stereo";
};

};
}
6 changes: 2 additions & 4 deletions src/DConf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,12 @@ vDictDictEntry = bracket "{" "}" $ do

dconfHeader :: Parsec Text () Header
dconfHeader = bracket "[" "]" $ do
_ <- spaces
h <- many1 $ satisfy $ \c -> isAlphaNum c || elem c ("/.-:_" :: [Char])
_ <- spaces
h <- many1 $ satisfy $ \c -> not (isControl c) && not (elem c ("[]" :: [Char]))
return $ T.pack h

kvLine :: Parsec Text () (Key,Value)
kvLine = do
k <- many1 $ satisfy $ \c -> isAlphaNum c || c == '-'
k <- many1 $ satisfy $ \c -> isAlphaNum c || c == '-' || c == '_'
_ <- char '='
v <- value
_ <- endOfLine
Expand Down
2 changes: 1 addition & 1 deletion test/DConfTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ simpleParser =

testInput :: Text
testInput = T.unlines
[ "[ org/gnome/desktop/peripherals/mouse ]"
[ "[org/gnome/desktop/peripherals/mouse]"
, "natural-scroll=false"
, "speed=-0.5"
]
Expand Down