コマンドラインでXubuntu環境設定を編集する

コマンドラインでXubuntu環境設定を編集する

一部の環境設定を修正したかったのですが、xubuntu-desktop (xfce4)100%通過しましたTerminal

たとえば、次のようにubuntu-desktop (gnome)なります。

   # Prevent suspend and lock the sreen
   gsettings set org.gnome.desktop.screensaver lock-enabled false
   gsettings set org.gnome.desktop.screensaver ubuntu-lock-on-suspend false

   # Set performance settings
   gsettings set org.gnome.desktop.interface enable-animations false
   gsettings set org.gnome.shell.extensions.dash-to-dock animate-show-apps false

   # Set personal configs
   gnome-extensions enable [email protected]
   gnome-extensions enable desktop-icons@csoriano
   gnome-extensions enable [email protected]
   gnome-extensions enable [email protected]
   gsettings set org.gnome.desktop.privacy remember-recent-files false
   gsettings set org.gnome.SessionManager logout-prompt false

では、xubuntu-desktop (xfce4)これらのすべての基本設定を実行できますが、GUIコマンドラインから同じことを行う方法を見つけることができません。




詳細については、情報を追加してください。

  • オペレーティングシステム:Ubuntu 20.04
  • アクセスタイプ:xrdpと経由のリモートデスクトップSSH
  • どの設定を変更する必要がありますか?
    • 非アクティブによるシステム停止の防止
    • スクリーンセーバーの無効化
    • アニメーションの無効化
    • ログアウトチェックを無効にする
    • 障害を負うdock
    • panel位置を変える
    • 参考文献1:変更を実行するgsettings set ...同様のコマンドgnome-extensions enable ...ubuntu-desktop (gnome)
    • 参考文献2:gsettings list-schemas同様のコマンドは、利用可能な基本設定のリストをgsettings list-keys ...表示します。ubuntu-desktop (gnome)

ベストアンサー1

解決策:

変更を実行するコマンド:xfconf-query



変更可能なチャンネルのリスト

   xfconf-query -l


各チャンネルの属性のリスト

   xfconf-query -c $PROPERTY -l -v

   # For example, the property "xfce4-desktop":
   xfconf-query -c xfce4-desktop -l -v
  • -v:属性値を表示します。
  • /子属性です。


リアルタイムで変化を監視

   xfconf-query -c $PROPERTY -m

   # For example, the property "xfce4-desktop":
   xfconf-query -c xfce4-desktop -m
  • たとえば、workspace0壁紙が変更されると、更新されたプロパティへのフルパスが表示されます。/backdrop/screen0/monitorrdp0/workspace0/last-image
  • GUIを介して監視および変更操作を開始できます。ここで変更されたすべての属性は、後でコマンドラインで使用できるように端末に表示されます。


プロパティの作成または更新

   xfconf-query -c $CHANNEL -np $PROPERTY -t 'bool' -s 'true';

   # For example, the channel "xfce4-panel" and the property "/panels/dark-mode":
   xfconf-query -c xfce4-panel -np '/panels/dark-mode' -t 'bool' -s 'true';
  • -n:属性が存在しない場合に作成されることを確認します。
  • 属性値のタイプを入力する必要があります。
       [ 'string', 'int', 'bool', 'double' ]
    
  • -s:プロパティの値を設定します。
  • 複数の要素を含む配列を挿入するには、型と値を順番に挿入します。
       -t int -s 0 -t int -s 1 -t int -s 2 #...
    
  • 単一項目を配列に強制する:
       -t int -s 0 -a
    


属性の削除

   xfconf-query -c $CHANNEL -p $PROPERTY -r -R;

   # For example, removing "Panel 2" completely:
   xfconf-query -c xfce4-panel -p '/panels/panel-2' -r -R;
  • -r:削除を示します。
  • -R:すべての子属性が属性とともに削除されていることを確認してください。


Xfce端末

  • 編集できますXfce端末デフォルト設定はに設定されています~/.config/xfce4/terminal/terminalrc
  • GUIを使用して編集し、後で使用するためにファイルをコピーできます。
    • 変更を確認するには、端末を閉じて再度開くことができます。


ひげメニュー

  • 使用する場合ひげメニュー、デフォルト設定をで編集できます~/.config/xfce4/panel/whiskermenu-**.rc
    • **プラグインの順に置き換えてください。

      whistermenuxfce4-panel/pluginsプラグイン番号を表示するには、プロパティでプラグインを見つけます。

      例えば、フィストメニューはいplugin-19、もしそうなら:~/.config/xfce4/panel/whiskermenu-19.rc

  • GUIを使用して編集し、後で使用するためにファイルをコピーできます。


指示:

  • フロントエンドに影響を与えるほとんどの変更は、特にパネルで変更を表示するにはログアウトしてから再度ログインする必要があります。
  • このxfconf-queryコマンドは、ディスプレイがアクティブな場合にのみ機能します。


以下は、現在の問題に対する完全なソリューションを含むスクリプトです。

   #!/bin/sh

   # Check the display's availability
   if [ -z $DISPLAY ]; then exit 1; fi;

   # Prevent suspend and lock the sreen
   xfconf-query -c xfce4-screensaver -np '/lock/enabled' -t 'bool' -s 'false';
   xfconf-query -c xfce4-screensaver -np '/lock/saver-activation/enabled' -t 'bool' -s 'false';
   xfconf-query -c xfce4-screensaver -np '/saver/enabled' -t 'bool' -s 'false';
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/inactivity-on-ac' -t int -s 0;
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/blank-on-ac' -t int -s 0;
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/dpms-on-ac-sleep' -t int -s 0;
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/dpms-on-ac-off' -t int -s 0;
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/lock-screen-suspend-hibernate' -t 'bool' -s 'false';
   xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/dpms-enabled' -t 'bool' -s 'false';

   # Remove dock
   xfconf-query -c xfce4-panel -p '/panels/panel-2' -r -R;
   xfconf-query -c xfce4-panel -np '/panels' -t int -s 1 -a;

   # Removing wallpaper
   xfconf-query -c xfce4-desktop -np '/backdrop/screen0/monitorrdp0/workspace0/color-style' -t int -s 0;
   xfconf-query -c xfce4-desktop -np '/backdrop/screen0/monitorrdp0/workspace0/image-style' -t int -s 0;
   xfconf-query -c xfce4-desktop -np '/backdrop/screen0/monitorrdp0/workspace0/rgba1' -t double -s 0.184314 -t double -s 0.207843 -t double -s 0.258824  -t double -s 1.000000;

   # Personal settings
   xfconf-query -c xfce4-desktop -np '/desktop-icons/tooltip-size' -t 'double' -s 48.000000;
   xfconf-query -c xfce4-desktop -np '/desktop-icons/gravity' -t int -s 0;
   xfconf-query -c xfwm4 -np '/general/workspace_count' -t int -s 1;

   # Put menu in bottom
   xfconf-query -c xfce4-panel -np '/panels/dark-mode' -t 'bool' -s 'true';
   xfconf-query -c xfce4-panel -np '/panels/panel-1/position' -t 'string' -s 'p=10;x=0;y=0';
   xfconf-query -c xfce4-panel -np '/plugins/plugin-1/show-tooltips' -t 'bool' -s 'true';

   # Grouping tasklist
   xfconf-query -c xfce4-panel -np '/plugins/plugin-2/grouping' -t int -s 1;

   # Logout settings
   xfconf-query -c xfce4-session -np '/shutdown/ShowSuspend' -t 'bool' -s 'false';
   xfconf-query -c xfce4-session -np '/shutdown/LockScreen' -t 'bool' -s 'false';
   xfconf-query -c xfce4-session -np '/shutdown/ShowHibernate' -t 'bool' -s 'false';
   xfconf-query -c xfce4-session -np '/general/PromptOnLogout' -t 'bool' -s 'false';

   # Logout to save changes
   xfce4-session-logout --logout;


源泉:

おすすめ記事