1
0
forked from extern/nix-config

Revert "meta: Remove rofi"

Some programs expect rofi to be installed. Although dmenu is nice, rofi
is more customizable and has the potential to look nicer overall.
This commit is contained in:
Donovan Glover 2022-11-09 21:10:18 -05:00
parent ba0ad5b142
commit 77d9e7f3fc
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,27 @@
configuration {
modi: ["drun", "filebrowser"];
font: "Hack 12";
show-icons: true;
bw: 0;
drun-icon-theme: "Papirus-Dark";
terminal: "kitty";
scroll-method: 1;
display-drun: "Search";
}
@theme "~/.cache/wal/colors-rofi-dark.rasi"
element-text {
background-color: inherit;
text-color: inherit;
}
listview {
columns: 3;
}
window {
width: 1200px;
}
// vim:syn=java

64
rofi/.config/rofi/launch.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/sh
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2018 Donovan Glover
# This script will find the X server DPI and apply the necessary
# settings to make Rofi, X, GNOME, and KDE applications have the
# proper scaling, with no intervention from the user necessary.
# Note that XDG_CURRENT_DESKTOP is required for KDE/Qt applications to
# have the proper theming in non-Plasma environments. In contrast, GNOME
# respects its theming even when XDG_CURRENT_DESKTOP is not set to it
# (through settings.ini).
# Note that the xcursor size is specified with:
#
# 1. The X server resource database (xrdb), of which cursor size is
# only applied BEFORE your window manager starts
# 2. The xsetroot command, which affects the cursor shown on the root
# window (your desktop)
# 3. The XCURSOR_SIZE environment variable, which affects the current
# program
#
# There are a few things to take away from this:
#
# 1. The root window (desktop) cursor size MUST be changed with xsetroot
# 2. KDE applications will honor XCURSOR_SIZE but NOT xsetroot
# 3. GTK applications will honor xsetroot but NOT XCURSOR_SIZE
#
# Additionally,
#
# 4. SOME X applications require XCURSOR_SIZE to be set and will NOT
# honor xsetroot
# 5. SOME X applications require xsetroot to be set and will NOT
# honor XCURSOR_SIZE
#
# So for a consistent variable cursor DPI environment, one has to set BOTH
# xsetroot and XCURSOR_SIZE
#
# Note that existing windows will NOT have their X cursor size changed
# if they don't depend on xsetroot. Because of this, and because of the
# fact that active windows will not handle DPI changes anyway, you should
# probably have no GUIs running when switching DPI.
ROFI_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
ROFI_SCALE=$(expr $ROFI_DPI / 96)
ROFI_DPI_SCALE=$(awk "BEGIN { print "1/$ROFI_SCALE" }")
CURSOR_THEME=${XCURSOR_THEME:-phinger-cursors}
CURSOR_SIZE=$((16 * $ROFI_SCALE))
xsetroot -xcf "/usr/share/icons/$CURSOR_THEME/cursors/left_ptr" "$CURSOR_SIZE"
env \
QT_AUTO_SCREEN_SCALE_FACTOR="0" \
QT_FONT_DPI="$ROFI_DPI" \
QT_SCREEN_SCALE_FACTORS="VGA-1=$ROFI_SCALE;" \
GDK_SCALE="$ROFI_SCALE" \
GDK_DPI_SCALE="$ROFI_DPI_SCALE" \
XCURSOR_SIZE="$CURSOR_SIZE" \
rofi \
-show drun \
-dpi "$ROFI_DPI" \
-m -1 \
-display-drun "Search ($(bspc query -D -d focused --names))"

17
rofi/README.md Normal file
View File

@ -0,0 +1,17 @@
# rofi
[rofi][rofi] is an application launcher, window switcher, and dmenu replacement.
## Use Cases
rofi can be used to:
- Launch applications based on `.desktop` files
- Show all open windows and switch between them
- Parse dmenu-like input
You should not use rofi if:
- Your desktop environment already has an application launcher and window switcher
[rofi]: https://github.com/DaveDavenport/rofi