master
yutent 2024-12-02 17:16:13 +08:00
commit 8529931538
7 changed files with 135 additions and 0 deletions

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
.vscode
._*
*.deb
.Spotlight-V100
.Trashes
.DS_Store
.AppleDouble
.LSOverride

26
build.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
if [ -d unpack ]; then
sudo rm -rf unpack
fi
version="1.0.3"
mkdir -p unpack/DEBIAN
cp debian/control unpack/DEBIAN/
cp -r usr unpack/
cd unpack
find usr -type f | xargs md5sum > DEBIAN/md5sums
_size=$(du -d 0 usr | cut -f1)
sed -i "s/{{size}}/${_size}/" DEBIAN/control
sed -i "s/{{version}}/${version}/" DEBIAN/control
cd ..
sudo chown -R root:root unpack/
dpkg-deb -b unpack/ "rofi-pkexec_${version}.deb"
sudo rm -rf unpack

13
debian/control vendored Normal file
View File

@ -0,0 +1,13 @@
Package: rofi-pkexec
Version: {{version}}
Architecture: all
Priority: optional
Provides: pkexec
Breaks: pkexec
Replaces: pkexec
Maintainer: Yutent <yutent.io@gmail.com>
Installed-Size: {{size}}
Homepage: https://git.wkit.fun/appcat/rofi-pkexec
Author: yutent
Description: rofi版的pkexec.
纯`bash shell + rofi`实现的pkexec, 能最大程度上适配当前用户的环境变量.

6
usr/bin/pkexec Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
export SUDO_ASKPASS=/usr/bin/rofi-passwd
sudo -E -A $1 "$@"

3
usr/bin/rofi-passwd Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
rofi -dmenu -password -i -p "Enter your password" -theme password

View File

@ -0,0 +1,22 @@
* {
border: 0;
margin: 0;
padding: 0;
spacing: 0;
bg: #57606fae;
fg: #f8f8f2;
dark: #39404f;
red: #bf616a;
blue: #81a1c1;
green: #a3be8c;
grey: #ffffff10;
greydim: #aeaeae;
bluea: #81a1c150;
greena: #a3be8ca0;
background-color: @bg;
text-color: @fg;
font: "Menlo 12";
}

View File

@ -0,0 +1,54 @@
configuration {
show-icons: false;
}
@import "./colors.rasi"
window {
transparency: "real";
width: 360px;
border-radius: 4px;
background-color: @bg;
}
mainbox {
padding: 24px;
children: [ "inputbar", "entry", "listview"];
}
inputbar {
spacing: 10px;
background-color: transparent;
children: [ "textbox-prompt-colon", "prompt" ];
}
textbox-prompt-colon {
expand: false;
str: "";
padding: 12px 14px;
border-radius: 50%;
background-color: @blue;
}
prompt {
padding: 12px 16px;
border-radius: 24px;
background-color: @grey;
text-color: @fg;
vertical-align: 0.5;
}
entry {
margin: 16px 0 0 0;
padding: 12px;
border-radius: 6px;
font: "Menlo 18px";
background-color: @grey;
placeholder: "Type here";
}
listview {
enabled: false;
}