/DSBSu

Qt frontend to su

Primary LanguageCBSD 2-Clause "Simplified" LicenseBSD-2-Clause

DSBSu - a Qt front end to su(1)

About

DSBSu is a Qt front end which allows executing commands as another user using su(1). dsbsudo is a wrapper script for sudo(8) which uses dsbsu to ask for a password if necessary.

Main window

Installation

Dependencies

Getting the Source Code

% git clone https://github.com/mrclksr/DSBSu.git

Building and Installation

$ cd DSBSu
$ cmake -S . -B build
$ cmake --build build

Then as root run

# cmake --install build

Installing via pkg(8)

# pkg install dsbsu

Installing from the FreeBSD Ports

# cd /usr/ports/sysutils/dsbsu
# make install distclean

Usage

Command-Line

dsbsu [-m message][-u user] command
dsbsu -a [-c command]
dsbsudo [sudo options] command [args …​]

Options

-a

Writes the entered password to stdout, and exits.

-c

Shows the given command string in the password window.

-m

Shows the given message in the password window.

-u

Runs the command as the given user. If -u is not defined, root is assumed.

Development

Contributing Translations

Available Translations

  • French

  • German

Instructions

Let’s say you want to add French translations, you can proceed as follows:

  1. Create a fork of this repo, and clone it:

    % git clone url-of-your-fork
  2. Install devel/qt6-tools

  3. cd to your-forked-dsbsu-dir

  4. Add locale/dsbsu_fr.ts to the TS_FILES list in CMakeLists.txt.

  5. In order to create the dsbsu_fr.ts file, run

% cd your-fork
% cmake -S . -B build
% cmake --build build -t dsbsu_lupdate
  1. Run linguist6 locale/dsbsu_fr.ts

  2. Add the file to the repo: git add locale/dsbsu_fr.ts

  3. Commit: git commit -am 'Add French translations.'

  4. Send a pull request.

Configuring the Look and Behavior of Qt6 Applications

If you are not using a desktop environment that takes care of your Qt application’s look and behavior, you can use qt6ct together with the Kvantum theme engine.

qt6ct and the Kvantum theme engine

qt6ct

qt6ct is a tool that allows you to configure themes, fonts, and icons of Qt6 applications. It can be installed via pkg

# pkg install qt6ct

or via the FreeBSD ports:

# cd /usr/ports/misc/qt6ct
# make install

In order to make Qt6 applications use qt6ct, add the line export QT_QPA_PLATFORMTHEME=qt6ct to one of the following files, depending on how you start your X session:

Table 1. Session Files
X Session Start Method File

SliM, startx, xinit

~/.xinitrc

GDM, LightDM, LXDM, SDDM

~/.xprofile

WDM, XDM

~/.xsession

Alternatively, you can add the line to your window manager’s startup script, or, if you are using a Bourne shell compatible login shell, to your ~/.profile.

After loggin out and in again, proceed with the next section.

Kvantum

Kvantum is a SVG-based theme engine for Qt, KDE and LXQt. Install it via pkg:

# pkg install Kvantum-qt6

or via the FreeBSD ports:

# cd /usr/ports/x11-themes/Kvantum
# make install distclean

Start qt6ct and choose kvantum under AppeareanceStyle, and press Ok.

💡

You can use Kvantum directly without qt6ct by setting QT_STYLE_OVERRIDE=kvantum. Note, however, that the Kvantum Manager lacks the ability to change fonts and the icon theme.

Now you can start kvantummanager to set, install and configure themes.

💡

You can download Kvantum themes from KDE Store. Unpack them, and use the Kvantum Manager to install new themes.