Skip to content

Commit

Permalink
add NM Applet check button
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg-piotr committed Jun 12, 2023
1 parent 89dade9 commit 9163ad4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nwg_shell_config/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@
"night-light-day-tooltip": "Day light color temperature: `wlsunset -T`",
"night-light-night-tooltip": "Night light color temperature: `wlsunset -t`",
"night-light-tooltip": "Determines if to use `wlsunset`.",
"nm-applet": "NetworkManager applet",
"nm-applet-tooltip": "Determines if to autostart NetworkManager applet",
"no-border-on-floating": "No boarder on floating",
"no-cursor-warps": "No cursor warps",
"no-cursor-warps-tooltip": "If set, will not warp the cursor in many cases (focusing, keybinds, etc)",
Expand Down
2 changes: 2 additions & 0 deletions nwg_shell_config/langs/pl_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@
"night-light-day-tooltip": "Temperatura barwowa światła dziennego: `wlsunset -T`",
"night-light-night-tooltip": "Temperatura barwowa światła nocnego: `wlsunset -t`",
"night-light-tooltip": "Określa czy używać `wlsunset`.",
"nm-applet": "Applet NetworkManager",
"nm-applet-tooltip": "Określa czy uruchamiać applet NetworkManager",
"no-border-on-floating": "Pływające okna bez ramki",
"no-cursor-warps": "Bez przyspieszania kursora",
"no-cursor-warps-tooltip": "Wyłącza przyspieszanie kursora w wielu przypadkach (ogniskowanie, skróty klawiaturowe itp.)",
Expand Down
4 changes: 3 additions & 1 deletion nwg_shell_config/main_hyprland.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ def save_includes():
p = os.path.join(config_home, "swaync")
includes.append("exec-once = swaync -c {}/hyprland.json -s {}/{}.css".format(p, p, name))

includes.append("exec-once = nm-applet --indicator")
if settings["appindicator"]:
includes.append("exec-once = nm-applet --indicator")

if cmd_launcher_autostart:
includes.append(cmd_launcher_autostart)
Expand Down Expand Up @@ -908,6 +909,7 @@ def reload():
def load_settings():
settings_file = os.path.join(data_dir, "settings-hyprland")
defaults = {
"appindicator": True,
"night-lat": -1,
"night-long": -1,
"night-temp-low": 4500,
Expand Down
2 changes: 1 addition & 1 deletion nwg_shell_config/shell/settings-hyprland
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"appindicator": true,
"night-lat": -1,
"night-long": -1,
"night-temp-low": 4500,
Expand Down Expand Up @@ -33,7 +34,6 @@
"dwindle-use-settings": true,
"dwindle-pseudotile": false,
"dwindle-force_split": 0,
"dwindle-preserve_split": true,
"dwindle-permanent_direction_override": false,
"dwindle-special_scale_factor": 0.8,
"dwindle-split_width_multiplier": 1.0,
Expand Down
6 changes: 6 additions & 0 deletions nwg_shell_config/ui_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ def screen_tab(settings, voc, pending_updates):
else:
settings["update-indicator-on"] = False

cb_nm_applet = Gtk.CheckButton.new_with_label(voc["nm-applet"])
cb_nm_applet.set_active(settings["appindicator"])
cb_nm_applet.connect("toggled", set_from_checkbutton, settings, "appindicator")
cb_nm_applet.set_tooltip_text(voc["nm-applet-tooltip"])
grid.attach(cb_nm_applet, 1, 8, 1, 1)

frame.show_all()

return frame, update_btn
Expand Down

0 comments on commit 9163ad4

Please sign in to comment.