From 7aface3a179db733f6542f1e62eb8c1579b3759a Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 14 Jun 2022 23:09:44 +0900 Subject: [PATCH] add install_gsettings function --- desktop/install | 2 ++ desktop/settings.ini | 59 +++++++++++++++++++++++++++++++++++ desktop/terminal-settings.ini | 6 ++++ mod.bash | 13 ++++++++ 4 files changed, 80 insertions(+) create mode 100644 desktop/settings.ini create mode 100644 desktop/terminal-settings.ini diff --git a/desktop/install b/desktop/install index 202b11b..694c987 100755 --- a/desktop/install +++ b/desktop/install @@ -5,3 +5,5 @@ cd -- "$(dirname -- "$0")" (($(id -u) == 0)) \ && [[ -f /etc/debian_version ]] \ && install_apt_packages +install_gsettings settings.ini / +install_gsettings terminal-settings.ini "/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')/" diff --git a/desktop/settings.ini b/desktop/settings.ini new file mode 100644 index 0000000..17652e0 --- /dev/null +++ b/desktop/settings.ini @@ -0,0 +1,59 @@ +# [外観] > [スタイル] +[org/gnome/desktop/interface] +gtk-theme='Yaru-dark' + +# [外観] > [Dock] +[org/gnome/shell/extensions/dash-to-dock] +# アイコンのサイズ +dash-max-icon-size=16 +# ボリュームとデバイスの表示 +show-mounts=false +# ゴミ箱の表示 +show-trash=false + +# [電源管理] +[org/gnome/settings-daemon/plugins/power] +# [省電力オプション] 自動サスペンド (バッテリー動作時) +sleep-inactive-battery-type='nothing' +# [省電力オプション] 自動サスペンド (電源接続時) +sleep-inactive-ac-type='nothing' +# [電源ボタン] 電源ボタンの挙動 +power-button-action='suspend' + +# [電源管理] > [省電力オプション] +[org/gnome/desktop/session] +# 画面のブランク +idle-delay=uint32 0 + +# [プライバシー] > [ファイルの履歴と削除] > [ゴミ箱と一時ファイル] +[org/gnome/desktop/privacy] +remove-old-temp-files=true +remove-old-trash-files=true + +# [キーボード] +[org/gnome/desktop/input-sources] +# キーボードの設定 +xkb-options=['ctrl:nocaps'] + +# IBusの設定 絵文字の無効化 +[org/freedesktop/ibus/panel/emoji] +hotkey=@as [] + +# [マウスとタッチパッド] > [マウス] +[org/gnome/desktop/peripherals/mouse] +# マウスの速度 +speed=1.0 + +# [サウンド] +[org/gnome/desktop/sound] +# 警告音の無効化 +event-sounds=false + +# [通知] +[org/gnome/desktop/notifications] +# 通知ポップアップの表示 +show-banners=false + +# Dockのお気に入りの設定 +[org/gnome/shell] +favorite-apps=['google-chrome.desktop', 'firefox_firefox.desktop', 'slack.desktop', 'code.desktop', 'org.gnome.Nautilus.desktop'] diff --git a/desktop/terminal-settings.ini b/desktop/terminal-settings.ini new file mode 100644 index 0000000..625354d --- /dev/null +++ b/desktop/terminal-settings.ini @@ -0,0 +1,6 @@ +[/] +font='Monospace 10' +cell-height-scale=1.25 +default-size-columns=100 +default-size-rows=40 +audible-bell=false diff --git a/mod.bash b/mod.bash index eb19fcc..1505e74 100644 --- a/mod.bash +++ b/mod.bash @@ -35,3 +35,16 @@ function install_addons() { ) done } + +function install_gsettings() { + local uid + local gsettings_file + local gsettings_dir + uid=${SUDO_UID:-$(id -u)} + gsettings_file=$1 + gsettings_dir=$2 + < "$gsettings_file" \ + sudo --user="#$uid" \ + DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \ + dconf load "$gsettings_dir" +}