Add ac-adaptive and ac-i3

This commit is contained in:
2024-12-30 17:42:34 -07:00
parent 08266c9e8a
commit 0df5cf6ad2
77 changed files with 11099 additions and 24 deletions

66
ac-i3/scripts/bluetooth.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Colors
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
CDIR=`cd "$DIR" && cd .. && pwd`
POWER_ON=`cat $CDIR/colors.ini | grep 'GREEN' | head -n1 | cut -d '=' -f2 | tr -d ' '`
POWER_OFF=`cat $CDIR/colors.ini | grep 'ALTFOREGROUND' | head -n1 | cut -d '=' -f2 | tr -d ' '`
# Checks if bluetooth controller is powered on
power_on() {
if bluetoothctl show | grep -q "Powered: yes"; then
return 0
else
return 1
fi
}
# Checks if a device is connected
device_connected() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Connected: yes"; then
return 0
else
return 1
fi
}
# Prints a short string with the current bluetooth status
# Useful for status bars like polybar, etc.
print_status() {
if power_on; then
if [[ -z `bluetoothctl info "$device" | grep "Alias" | cut -d ' ' -f 2-` ]]; then
echo "%{F$POWER_ON}%{T2}%{T-} %{F-}On"
fi
paired_devices_cmd="devices Paired"
# Check if an outdated version of bluetoothctl is used to preserve backwards compatibility
if (( $(echo "$(bluetoothctl version | cut -d ' ' -f 2) < 5.65" | bc -l) )); then
paired_devices_cmd="paired-devices"
fi
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
counter=0
for device in "${paired_devices[@]}"; do
if device_connected "$device"; then
device_alias=$(bluetoothctl info "$device" | grep "Alias" | cut -d ' ' -f 2-)
if [ $counter -gt 0 ]; then
echo "%{F$POWER_ON}%{T2}%{T-} %{F-}$device_alias"
else
echo "%{F$POWER_ON}%{T2}%{T-} %{F-}$device_alias"
fi
((counter++))
fi
done
else
echo "%{F$POWER_OFF}%{T2}%{T-} Off%{F-}"
fi
}
# Print Status
print_status

12
ac-i3/scripts/i3_asroot Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
# rofi sudo askpass helper
export SUDO_ASKPASS="$DIR"/scripts/rofi_askpass
# execute the application
sudo -A $1

52
ac-i3/scripts/i3_autostart Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Autostart Programs
# i3 dir
DIR="$HOME/.config/polybar/ac-i3"
# Export desktop session
export XDG_CURRENT_DESKTOP='i3'
# Kill already running process
_ps=(xsettingsd ksuperkey)
for _prs in "${_ps[@]}"; do
if [[ `pidof ${_prs}` ]]; then
killall -9 ${_prs}
fi
done
# Lauch xsettingsd daemon
xsettingsd --config="$idir"/xsettingsd &
# polkit agent
if [[ ! `pidof xfce-polkit` ]]; then
/usr/lib/xfce-polkit/xfce-polkit &
fi
# Enable power management
xfce4-power-manager &
# Enable Super Keys For Menu
ksuperkey -e 'Super_L=Alt_L|F1' &
ksuperkey -e 'Super_R=Alt_L|F1' &
# Fix cursor
xsetroot -cursor_name left_ptr
# Restore wallpaper
hsetroot -cover "$idir"/theme/wallpaper
# Lauch notification daemon
"$idir"/scripts/i3_dunst
# Lauch polybar
"$idir"/scripts/i3_bar
# Lauch compositor
"$idir"/scripts/i3_comp
# Start mpd
exec mpd &

9
ac-i3/scripts/i3_bar Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
# launch polybar
bash "$DIR"/theme/polybar.sh

73
ac-i3/scripts/i3_brightness Executable file
View File

@@ -0,0 +1,73 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Script to manage brightness on Archcraft.
# Icons
iDIR='~/.config/dunst/icons'
# Graphics card
CARD=`ls /sys/class/backlight | head -n 1`
# Get brightness
get_backlight() {
if [[ "$CARD" == *"intel_"* ]]; then
BNESS=`xbacklight -get`
LIGHT=${BNESS%.*}
else
LIGHT=$(printf "%.0f\n" `light -G`)
fi
echo "${LIGHT}%"
}
# Get icons
get_icon() {
backlight="$(get_backlight)"
current="${backlight%%%}"
if [[ ("$current" -ge "0") && ("$current" -le "20") ]]; then
icon="$iDIR"/brightness-20.png
elif [[ ("$current" -ge "20") && ("$current" -le "40") ]]; then
icon="$iDIR"/brightness-40.png
elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then
icon="$iDIR"/brightness-60.png
elif [[ ("$current" -ge "60") && ("$current" -le "80") ]]; then
icon="$iDIR"/brightness-80.png
elif [[ ("$current" -ge "80") && ("$current" -le "100") ]]; then
icon="$iDIR"/brightness-100.png
fi
}
# Notify
notify_bl() {
get_icon && dunstify -u low -h string:x-dunst-stack-tag:obbacklight -i "$icon" "Brightness : $(get_backlight)"
}
# Increase brightness
inc_backlight() {
if [[ "$CARD" == *"intel_"* ]]; then
xbacklight -inc 10 && notify_bl
else
light -A 5 && notify_bl
fi
}
# Decrease brightness
dec_backlight() {
if [[ "$CARD" == *"intel_"* ]]; then
xbacklight -dec 10 && notify_bl
else
light -U 5 && notify_bl
fi
}
# Execute accordingly
if [[ "$1" == "--get" ]]; then
get_backlight
elif [[ "$1" == "--inc" ]]; then
inc_backlight
elif [[ "$1" == "--dec" ]]; then
dec_backlight
else
get_backlight
fi

22
ac-i3/scripts/i3_colorpicker Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Simple script to pick color quickly.
color=$(xcolor --format hex --preview-size 255 --scale 10)
image=/tmp/${color}.png
main() {
if [[ "$color" ]]; then
# copy color code to clipboard
echo $color | tr -d "\n" | xclip -selection clipboard
# generate preview
convert -size 48x48 xc:"$color" ${image}
# notify about it
dunstify -u low -h string:x-dunst-stack-tag:obcolorpicker -i ${image} "$color, copied to clipboard."
fi
}
# run the script
main

15
ac-i3/scripts/i3_comp Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
# Terminate if picom is already running
killall -q picom
# Wait until the processes have been shut down
while pgrep -u $UID -x picom >/dev/null; do sleep 1; done
# Launch picom
picom --config "$DIR"/picom.conf &

13
ac-i3/scripts/i3_dunst Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
# Launch dunst daemon
if [[ `pidof dunst` ]]; then
pkill dunst
fi
dunst -config "$DIR"/dunstrc &

21
ac-i3/scripts/i3_kitty Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## launch kitty with i3 config
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
CONFIG="$DIR/kitty/kitty.conf"
if [ "$1" == "--float" ]; then
kitty --class 'kitty-float' --config "$CONFIG"
elif [ "$1" == "--full" ]; then
kitty --class 'kitty-fullscreen' --config "$CONFIG" \
--start-as fullscreen \
--override 'window_padding_width=30' \
--override 'font_size=14' \
--override 'background_opacity=0.95'
else
kitty --config "$CONFIG" ${@}
fi

14
ac-i3/scripts/i3_music Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Run ncmpcpp with alternate config
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
CONFIG="$DIR/alacritty/alacritty.toml"
alacritty --class 'Music,Music' --config-file "$CONFIG" \
-o window.dimensions.columns=105 window.dimensions.lines=22 \
-e ~/.ncmpcpp/scripts/ncmpcpp-art

87
ac-i3/scripts/i3_screenshot Executable file
View File

@@ -0,0 +1,87 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Script to take screenshots on Archcraft.
# file
time=`date +%Y-%m-%d-%H-%M-%S`
geometry=`xrandr | grep 'current' | head -n1 | cut -d',' -f2 | tr -d '[:blank:],current'`
dir="`xdg-user-dir PICTURES`/Screenshots"
file="Screenshot_${time}_${geometry}.png"
# directory
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"
fi
# notify and view screenshot
notify_view () {
notify_cmd_shot='dunstify -u low -h string:x-dunst-stack-tag:obscreenshot -i /usr/share/archcraft/icons/dunst/picture.png'
${notify_cmd_shot} "Copied to clipboard."
paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga &>/dev/null &
viewnior ${dir}/"$file"
if [[ -e "$dir/$file" ]]; then
${notify_cmd_shot} "Screenshot Saved."
else
${notify_cmd_shot} "Screenshot Deleted."
fi
}
# copy screenshot to clipboard
copy_shot () {
tee "$file" | xclip -selection clipboard -t image/png
}
# countdown
countdown () {
for sec in `seq $1 -1 1`; do
dunstify -t 1000 -h string:x-dunst-stack-tag:screenshottimer -i /usr/share/archcraft/icons/dunst/timer.png "Taking shot in : $sec"
sleep 1
done
}
# take shots
shotnow () {
cd ${dir} && maim -u -f png | copy_shot
notify_view
}
shot5 () {
countdown '5'
sleep 1 && cd ${dir} && maim -u -f png | copy_shot
notify_view
}
shot10 () {
countdown '10'
sleep 1 && cd ${dir} && maim -u -f png | copy_shot
notify_view
}
shotwin () {
cd ${dir} && maim -u -f png -i `xdotool getactivewindow` | copy_shot
notify_view
}
shotarea () {
cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.85,0.25 -l | copy_shot
notify_view
}
# execute
if [[ "$1" == "--now" ]]; then
shotnow
elif [[ "$1" == "--in5" ]]; then
shot5
elif [[ "$1" == "--in10" ]]; then
shot10
elif [[ "$1" == "--win" ]]; then
shotwin
elif [[ "$1" == "--area" ]]; then
shotarea
else
echo -e "Available Options : --now --in5 --in10 --win --area"
fi
exit 0

20
ac-i3/scripts/i3_term Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## launch alacritty with i3 config
# i3 directory
DIR="$HOME/.config/polybar/ac-i3"
CONFIG="$DIR/alacritty/alacritty.toml"
if [ "$1" == "--float" ]; then
alacritty --class 'alacritty-float,alacritty-float' --config-file "$CONFIG"
elif [ "$1" == "--full" ]; then
alacritty --class 'alacritty-fullscreen,alacritty-fullscreen' --config-file "$CONFIG" \
-o window.startup_mode="'Fullscreen'" \
window.padding.x=30 window.padding.y=30 \
window.opacity=0.95 font.size=14
else
alacritty --config-file "$CONFIG" ${@}
fi

83
ac-i3/scripts/i3_volume Executable file
View File

@@ -0,0 +1,83 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Script to manage speaker volume on Archcraft.
# Icons
iDIR='~/.config/dunst/icons'
notify_cmd='dunstify -u low -h string:x-dunst-stack-tag:obvolume'
# Get Volume
get_volume() {
echo "`pulsemixer --get-volume | cut -d' ' -f1`"
}
# Get icons
get_icon() {
current="$(get_volume)"
if [[ "$current" -eq "0" ]]; then
icon="$iDIR/volume-mute.png"
elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
icon="$iDIR/volume-low.png"
elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
icon="$iDIR/volume-mid.png"
elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
icon="$iDIR/volume-high.png"
fi
}
# Notify
notify_user() {
${notify_cmd} -i "$icon" "Volume : $(get_volume)%"
}
# Increase Volume
inc_volume() {
[[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume +5 && get_icon && notify_user
}
# Decrease Volume
dec_volume() {
[[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume -5 && get_icon && notify_user
}
# Toggle Mute
toggle_mute() {
if [[ `pulsemixer --get-mute` == 0 ]]; then
pulsemixer --toggle-mute && ${notify_cmd} -i "$iDIR/volume-mute.png" "Mute"
else
pulsemixer --toggle-mute && get_icon && ${notify_cmd} -i "$icon" "Unmute"
fi
}
# Toggle Mic
toggle_mic() {
ID="`pulsemixer --list-sources | grep 'Default' | cut -d',' -f1 | cut -d' ' -f3`"
if [[ `pulsemixer --id $ID --get-mute` == 0 ]]; then
pulsemixer --id ${ID} --toggle-mute && ${notify_cmd} -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
else
pulsemixer --id ${ID} --toggle-mute && ${notify_cmd} -i "$iDIR/microphone.png" "Microphone Switched ON"
fi
}
# Execute accordingly
if [[ -x `which pulsemixer` ]]; then
if [[ "$1" == "--get" ]]; then
get_volume
elif [[ "$1" == "--inc" ]]; then
inc_volume
elif [[ "$1" == "--dec" ]]; then
dec_volume
elif [[ "$1" == "--toggle" ]]; then
toggle_mute
elif [[ "$1" == "--toggle-mic" ]]; then
toggle_mic
else
echo $(get_volume)%
fi
else
${notify_cmd} "'pulsemixer' is not installed."
fi

1
ac-i3/scripts/launcher.sh Symbolic link
View File

@@ -0,0 +1 @@
rofi_launcher

1039
ac-i3/scripts/network_menu Executable file

File diff suppressed because it is too large Load Diff

1
ac-i3/scripts/powermenu.sh Symbolic link
View File

@@ -0,0 +1 @@
rofi_powermenu

View File

@@ -0,0 +1,77 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
location: center;
anchor: center;
fullscreen: false;
width: 350px;
x-offset: 0px;
y-offset: 0px;
padding: 20px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background;
cursor: "default";
children: [ "inputbar", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt", "entry" ];
}
dummy {
expand: false;
width: 10px;
background-color: transparent;
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 9px;
border-radius: 12px;
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 10px;
border: 0px 0px 0px 0px;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: inherit;
cursor: text;
placeholder: "Password";
placeholder-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: false;
}

View File

@@ -0,0 +1,151 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 455px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 12px;
background-color: @selected;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 5;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 20px 10px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 18";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@@ -0,0 +1,301 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
modi: "drun,run,filebrowser,window";
show-icons: false;
drun-display-format: "{name}";
window-format: "{c} · {t}";
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
* {
border-colour: var(selected);
handle-colour: var(selected);
background-colour: var(background);
foreground-colour: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(background);
selected-normal-background: var(selected);
selected-normal-foreground: var(background);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(background);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 450px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @border-colour;
cursor: "default";
/* Backgroud Colors */
background-color: @background-colour;
/* Backgroud Image */
//background-image: url("/path/to/image.png", none);
/* Simple Linear Gradient */
//background-image: linear-gradient(red, orange, pink, purple);
/* Directional Linear Gradient */
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
/* Angle Linear Gradient */
//background-image: linear-gradient(45, cyan, purple, indigo);
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-colour;
background-color: transparent;
children: [ "inputbar", "message", "listview", "mode-switcher" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px 0px 0px 0px;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
children: [ "textbox-prompt-colon", "prompt" ];
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
textbox-prompt-colon {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
expand: false;
str: "";
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 7;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: "default";
}
scrollbar {
handle-width: 5px ;
handle-color: @handle-colour;
border-radius: 0px;
background-color: @alternate-background;
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 6px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Mode Switcher -----*****/
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
}
button {
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: @foreground-colour;
}
textbox {
border: 0px solid;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-colour;
blink: true;
markup: true;
}
error-message {
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: @background-colour;
text-color: @foreground-colour;
}

View File

@@ -0,0 +1,148 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 300px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
background-color: transparent;
children: [ "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 0px;
background-color: @active;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 0px;
background-color: @selected;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 2;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 5px 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 20";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@@ -0,0 +1,303 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
modi: "drun,run,filebrowser,window";
show-icons: false;
display-drun: " Apps";
display-run: " Run";
display-filebrowser: " Files";
display-window: " Windows";
drun-display-format: "{name}";
window-format: "{c} · {t}";
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
* {
border-colour: var(selected);
handle-colour: var(selected);
background-colour: var(background);
foreground-colour: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(background);
selected-normal-background: var(selected);
selected-normal-foreground: var(background);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(background);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 650px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @border-colour;
cursor: "default";
/* Backgroud Colors */
background-color: @background-colour;
/* Backgroud Image */
//background-image: url("/path/to/image.png", none);
/* Simple Linear Gradient */
//background-image: linear-gradient(red, orange, pink, purple);
/* Directional Linear Gradient */
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
/* Angle Linear Gradient */
//background-image: linear-gradient(45, cyan, purple, indigo);
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-colour;
background-color: transparent;
children: [ "inputbar", "message", "listview", "mode-switcher" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px 0px 0px 0px;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
children: [ "textbox-prompt-colon", "entry" ];
}
prompt {
enabled: true;
background-color: inherit;
text-color: inherit;
}
textbox-prompt-colon {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
expand: false;
str: "";
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "Search...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 2;
lines: 8;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: "default";
}
scrollbar {
handle-width: 5px ;
handle-color: @handle-colour;
border-radius: 0px;
background-color: @alternate-background;
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 6px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Mode Switcher -----*****/
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
}
button {
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: @foreground-colour;
}
textbox {
border: 0px solid;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-colour;
blink: true;
markup: true;
}
error-message {
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: @background-colour;
text-color: @foreground-colour;
}

View File

@@ -0,0 +1,151 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 540px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 12px;
background-color: @selected;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 6;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 20px 10px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 18";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@@ -0,0 +1,302 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
modi: "drun,run,filebrowser,window";
show-icons: false;
drun-display-format: "{name}";
window-format: "{c} · {t}";
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
* {
border-colour: var(selected);
handle-colour: var(selected);
background-colour: var(background);
foreground-colour: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(background);
selected-normal-background: var(selected);
selected-normal-foreground: var(background);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(background);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 450px;
height: 435px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @border-colour;
cursor: "default";
/* Backgroud Colors */
background-color: @background-colour;
/* Backgroud Image */
//background-image: url("/path/to/image.png", none);
/* Simple Linear Gradient */
//background-image: linear-gradient(red, orange, pink, purple);
/* Directional Linear Gradient */
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
/* Angle Linear Gradient */
//background-image: linear-gradient(45, cyan, purple, indigo);
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-colour;
background-color: transparent;
children: [ "inputbar", "message", "listview", "mode-switcher" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px 0px 0px 0px;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
children: [ "textbox-prompt-colon", "prompt", "entry" ];
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
textbox-prompt-colon {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
expand: false;
str: "";
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 8;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: "default";
}
scrollbar {
handle-width: 5px ;
handle-color: @handle-colour;
border-radius: 0px;
background-color: @alternate-background;
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 6px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Mode Switcher -----*****/
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
}
button {
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: @foreground-colour;
}
textbox {
border: 0px solid;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-colour;
blink: true;
markup: true;
}
error-message {
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: @background-colour;
text-color: @foreground-colour;
}

View File

@@ -0,0 +1,151 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 540px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 12px;
background-color: @selected;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 6;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 20px 10px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 18";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@@ -0,0 +1,303 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
modi: "run";
show-icons: false;
display-drun: " Apps";
display-run: " Run";
display-filebrowser: " Files";
display-window: " Windows";
drun-display-format: "{name}";
window-format: "{c} · {t}";
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
* {
border-colour: var(selected);
handle-colour: var(selected);
background-colour: var(background);
foreground-colour: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(background);
selected-normal-background: var(selected);
selected-normal-foreground: var(background);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(background);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 400px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @border-colour;
cursor: "default";
/* Backgroud Colors */
background-color: @background-colour;
/* Backgroud Image */
//background-image: url("/path/to/image.png", none);
/* Simple Linear Gradient */
//background-image: linear-gradient(red, orange, pink, purple);
/* Directional Linear Gradient */
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
/* Angle Linear Gradient */
//background-image: linear-gradient(45, cyan, purple, indigo);
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-colour;
background-color: transparent;
children: [ "inputbar", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px 0px 0px 0px;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
children: [ "textbox-prompt-colon", "entry" ];
}
prompt {
enabled: true;
background-color: inherit;
text-color: inherit;
}
textbox-prompt-colon {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
expand: false;
str: "";
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "Run...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 6;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: "default";
}
scrollbar {
handle-width: 5px ;
handle-color: @handle-colour;
border-radius: 0px;
background-color: @alternate-background;
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 6px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Mode Switcher -----*****/
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
}
button {
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: @foreground-colour;
}
textbox {
border: 0px solid;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-colour;
blink: true;
markup: true;
}
error-message {
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: @background-colour;
text-color: @foreground-colour;
}

View File

@@ -0,0 +1,151 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 455px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 6px 10px;
border-radius: 12px;
background-color: @selected;
text-color: @background;
}
prompt {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 5;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 20px 10px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 18";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@@ -0,0 +1,12 @@
/* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com> */
/* Colors */
* {
background: #1e222a;
background-alt: #292e39;
foreground: #c8ccd4;
selected: #da6e89;
active: #98c379;
urgent: #e06c75;
}

View File

@@ -0,0 +1,7 @@
/* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com> */
/* Text Font */
* {
font: "JetBrainsMono Nerd Font 10";
}

View File

@@ -0,0 +1,303 @@
/**
* Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
**/
/*****----- Configuration -----*****/
configuration {
modi: "window";
show-icons: false;
display-drun: " Apps";
display-run: " Run";
display-filebrowser: " Files";
display-window: " Windows";
drun-display-format: "{name}";
window-format: "{c} · {t}";
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
* {
border-colour: var(selected);
handle-colour: var(selected);
background-colour: var(background);
foreground-colour: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(background);
selected-normal-background: var(selected);
selected-normal-foreground: var(background);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(background);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 600px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @border-colour;
cursor: "default";
/* Backgroud Colors */
background-color: @background-colour;
/* Backgroud Image */
//background-image: url("/path/to/image.png", none);
/* Simple Linear Gradient */
//background-image: linear-gradient(red, orange, pink, purple);
/* Directional Linear Gradient */
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
/* Angle Linear Gradient */
//background-image: linear-gradient(45, cyan, purple, indigo);
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-colour;
background-color: transparent;
children: [ "inputbar", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px 0px 0px 0px;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
children: [ "textbox-prompt-colon", "entry" ];
}
prompt {
enabled: true;
background-color: inherit;
text-color: inherit;
}
textbox-prompt-colon {
enabled: true;
padding: 6px 10px;
border-radius: 12px;
expand: false;
str: "";
background-color: @selected;
text-color: @background;
}
entry {
enabled: true;
padding: 6px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "Filter...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 8;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: "default";
}
scrollbar {
handle-width: 5px ;
handle-color: @handle-colour;
border-radius: 0px;
background-color: @alternate-background;
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 6px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Mode Switcher -----*****/
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
}
button {
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 6px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-colour;
background-color: @alternate-background;
text-color: @foreground-colour;
}
textbox {
border: 0px solid;
border-color: @border-colour;
background-color: transparent;
text-color: @foreground-colour;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-colour;
blink: true;
markup: true;
}
error-message {
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @border-colour;
background-color: @background-colour;
text-color: @foreground-colour;
}

14
ac-i3/scripts/rofi_askpass Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/askpass.rasi"
# Rofi text dialog to get password
rofi -dmenu \
-password \
-i \
-p "Root" \
-theme ${RASI}

78
ac-i3/scripts/rofi_asroot Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/asroot.rasi"
ASROOT="$DIR/scripts/i3_asroot"
# Theme Elements
prompt='Root'
mesg="Run Applications As Root"
term='alacritty --class alacritty-float,alacritty-float --config-file /root/.config/i3/alacritty/alacritty.toml'
# Options
layout=`cat ${RASI} | grep 'USE_ICON' | cut -d'=' -f2`
if [[ "$layout" == 'NO' ]]; then
option_1=" Alacritty"
option_2=" Thunar"
option_3=" Geany"
option_4=" Ranger"
option_5=" Vim"
else
option_1=""
option_2=""
option_3=""
option_4=""
option_5=""
fi
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$prompt" \
-mesg "$mesg" \
-markup-rows \
-theme ${RASI}
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5" | rofi_cmd
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
${ASROOT} "$term"
elif [[ "$1" == '--opt2' ]]; then
${ASROOT} 'dbus-run-session thunar'
elif [[ "$1" == '--opt3' ]]; then
${ASROOT} geany
elif [[ "$1" == '--opt4' ]]; then
${ASROOT} "$term -e ranger"
elif [[ "$1" == '--opt5' ]]; then
${ASROOT} "$term -e vim"
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$option_1)
run_cmd --opt1
;;
$option_2)
run_cmd --opt2
;;
$option_3)
run_cmd --opt3
;;
$option_4)
run_cmd --opt4
;;
$option_5)
run_cmd --opt5
;;
esac

321
ac-i3/scripts/rofi_bluetooth Executable file
View File

@@ -0,0 +1,321 @@
#!/usr/bin/env bash
# __ _ _ _ _ _ _
# _ __ ___ / _(_) | |__ | |_ _ ___| |_ ___ ___ | |_| |__
# | '__/ _ \| |_| |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __| '_ \
# | | | (_) | _| |_____| |_) | | |_| | __/ || (_) | (_) | |_| | | |
# |_| \___/|_| |_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__|_| |_|
#
# Author: Nick Clyde (clydedroid)
#
# A script that generates a rofi menu that uses bluetoothctl to
# connect to bluetooth devices and display status info.
#
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
#
# Depends on:
# Arch repositories: rofi, bluez-utils (contains bluetoothctl)
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/bluetooth.rasi"
# Constants
divider="---------"
goback="Back"
# Checks if bluetooth controller is powered on
power_on() {
if bluetoothctl show | grep -q "Powered: yes"; then
return 0
else
return 1
fi
}
# Toggles power state
toggle_power() {
if power_on; then
bluetoothctl power off
show_menu
else
if rfkill list bluetooth | grep -q 'blocked: yes'; then
rfkill unblock bluetooth && sleep 3
fi
bluetoothctl power on
show_menu
fi
}
# Checks if controller is scanning for new devices
scan_on() {
if bluetoothctl show | grep -q "Discovering: yes"; then
echo "Scan: on"
return 0
else
echo "Scan: off"
return 1
fi
}
# Toggles scanning state
toggle_scan() {
if scan_on; then
kill $(pgrep -f "bluetoothctl scan on")
bluetoothctl scan off
show_menu
else
bluetoothctl scan on &
echo "Scanning..."
sleep 5
show_menu
fi
}
# Checks if controller is able to pair to devices
pairable_on() {
if bluetoothctl show | grep -q "Pairable: yes"; then
echo "Pairable: on"
return 0
else
echo "Pairable: off"
return 1
fi
}
# Toggles pairable state
toggle_pairable() {
if pairable_on; then
bluetoothctl pairable off
show_menu
else
bluetoothctl pairable on
show_menu
fi
}
# Checks if controller is discoverable by other devices
discoverable_on() {
if bluetoothctl show | grep -q "Discoverable: yes"; then
echo "Discoverable: on"
return 0
else
echo "Discoverable: off"
return 1
fi
}
# Toggles discoverable state
toggle_discoverable() {
if discoverable_on; then
bluetoothctl discoverable off
show_menu
else
bluetoothctl discoverable on
show_menu
fi
}
# Checks if a device is connected
device_connected() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Connected: yes"; then
return 0
else
return 1
fi
}
# Toggles device connection
toggle_connection() {
if device_connected "$1"; then
bluetoothctl disconnect "$1"
device_menu "$device"
else
bluetoothctl connect "$1"
device_menu "$device"
fi
}
# Checks if a device is paired
device_paired() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Paired: yes"; then
echo "Paired: yes"
return 0
else
echo "Paired: no"
return 1
fi
}
# Toggles device paired state
toggle_paired() {
if device_paired "$1"; then
bluetoothctl remove "$1"
device_menu "$device"
else
bluetoothctl pair "$1"
device_menu "$device"
fi
}
# Checks if a device is trusted
device_trusted() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Trusted: yes"; then
echo "Trusted: yes"
return 0
else
echo "Trusted: no"
return 1
fi
}
# Toggles device connection
toggle_trust() {
if device_trusted "$1"; then
bluetoothctl untrust "$1"
device_menu "$device"
else
bluetoothctl trust "$1"
device_menu "$device"
fi
}
# Prints a short string with the current bluetooth status
# Useful for status bars like polybar, etc.
print_status() {
if power_on; then
printf '󰂯'
paired_devices_cmd="devices Paired"
# Check if an outdated version of bluetoothctl is used to preserve backwards compatibility
if (( $(echo "$(bluetoothctl version | cut -d ' ' -f 2) < 5.65" | bc -l) )); then
paired_devices_cmd="paired-devices"
fi
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
counter=0
for device in "${paired_devices[@]}"; do
if device_connected "$device"; then
device_alias=$(bluetoothctl info "$device" | grep "Alias" | cut -d ' ' -f 2-)
if [ $counter -gt 0 ]; then
printf ", %s" "$device_alias"
else
printf " %s" "$device_alias"
fi
((counter++))
fi
done
printf "\n"
else
echo "󰂲"
fi
}
# A submenu for a specific device that allows connecting, pairing, and trusting
device_menu() {
device=$1
# Get device name and mac address
device_name=$(echo "$device" | cut -d ' ' -f 3-)
mac=$(echo "$device" | cut -d ' ' -f 2)
# Build options
if device_connected "$mac"; then
connected="Connected: yes"
else
connected="Connected: no"
fi
paired=$(device_paired "$mac")
trusted=$(device_trusted "$mac")
options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit"
# Open rofi menu, read chosen option
chosen="$(echo -e "$options" | $rofi_command "$device_name")"
# Match chosen option to command
case "$chosen" in
"" | "$divider")
echo "No option chosen."
;;
"$connected")
toggle_connection "$mac"
;;
"$paired")
toggle_paired "$mac"
;;
"$trusted")
toggle_trust "$mac"
;;
"$goback")
show_menu
;;
esac
}
# Opens a rofi menu with current bluetooth status and options to connect
show_menu() {
# Get menu options
if power_on; then
power="Power: on"
# Human-readable names of devices, one per line
# If scan is off, will only list paired devices
devices=$(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
# Get controller flags
scan=$(scan_on)
pairable=$(pairable_on)
discoverable=$(discoverable_on)
# Options passed to rofi
options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit"
else
power="Power: off"
options="$power\nExit"
fi
# Open rofi menu, read chosen option
chosen="$(echo -e "$options" | $rofi_command "Bluetooth")"
# Match chosen option to command
case "$chosen" in
"" | "$divider")
echo "No option chosen."
;;
"$power")
toggle_power
;;
"$scan")
toggle_scan
;;
"$discoverable")
toggle_discoverable
;;
"$pairable")
toggle_pairable
;;
*)
device=$(bluetoothctl devices | grep "$chosen")
# Open a submenu if a device is selected
if [[ $device ]]; then device_menu "$device"; fi
;;
esac
}
# Rofi command to pipe into, can add any options here
rofi_command="rofi -theme ${RASI} -dmenu $* -p"
case "$1" in
--status)
print_status
;;
*)
show_menu
;;
esac

13
ac-i3/scripts/rofi_launcher Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/launcher.rasi"
# Run
rofi \
-show drun \
-kb-cancel Alt-F1 \
-theme ${RASI}

118
ac-i3/scripts/rofi_music Executable file
View File

@@ -0,0 +1,118 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/music.rasi"
# Theme Elements
status="`mpc status`"
if [[ -z "$status" ]]; then
prompt='Offline'
mesg="MPD is Offline"
else
prompt="`mpc -f "%artist%" current`"
mesg="`mpc -f "%title%" current` :: `mpc status | grep "#" | awk '{print $3}'`"
fi
# Options
layout=`cat ${RASI} | grep 'USE_ICON' | cut -d'=' -f2`
if [[ "$layout" == 'NO' ]]; then
if [[ ${status} == *"[playing]"* ]]; then
option_1=" Pause"
else
option_1=" Play"
fi
option_2=" Stop"
option_3=" Previous"
option_4=" Next"
option_5=" Repeat"
option_6=" Random"
else
if [[ ${status} == *"[playing]"* ]]; then
option_1=""
else
option_1=""
fi
option_2=""
option_3=""
option_4=""
option_5=""
option_6=""
fi
# Toggle Actions
active=''
urgent=''
# Repeat
if [[ ${status} == *"repeat: on"* ]]; then
active="-a 4"
elif [[ ${status} == *"repeat: off"* ]]; then
urgent="-u 4"
else
option_5=" Parsing Error"
fi
# Random
if [[ ${status} == *"random: on"* ]]; then
[ -n "$active" ] && active+=",5" || active="-a 5"
elif [[ ${status} == *"random: off"* ]]; then
[ -n "$urgent" ] && urgent+=",5" || urgent="-u 5"
else
option_6=" Parsing Error"
fi
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$prompt" \
-mesg "$mesg" \
${active} ${urgent} \
-markup-rows \
-theme ${RASI}
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5\n$option_6" | rofi_cmd
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
mpc -q toggle && kunst --size 60x60 --silent
elif [[ "$1" == '--opt2' ]]; then
mpc -q stop
elif [[ "$1" == '--opt3' ]]; then
mpc -q prev && kunst --size 60x60 --silent
elif [[ "$1" == '--opt4' ]]; then
mpc -q next && kunst --size 60x60 --silent
elif [[ "$1" == '--opt5' ]]; then
mpc -q repeat
elif [[ "$1" == '--opt6' ]]; then
mpc -q random
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$option_1)
run_cmd --opt1
;;
$option_2)
run_cmd --opt2
;;
$option_3)
run_cmd --opt3
;;
$option_4)
run_cmd --opt4
;;
$option_5)
run_cmd --opt5
;;
$option_6)
run_cmd --opt6
;;
esac

117
ac-i3/scripts/rofi_powermenu Executable file
View File

@@ -0,0 +1,117 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/powermenu.rasi"
CNFR="$DIR/scripts/rofi/confirm.rasi"
# Theme Elements
prompt="`hostname` (`echo $DESKTOP_SESSION`)"
mesg="Uptime : `uptime -p | sed -e 's/up //g'`"
# Options
layout=`cat ${RASI} | grep 'USE_ICON' | cut -d'=' -f2`
if [[ "$layout" == 'NO' ]]; then
option_1=" Lock"
option_2=" Logout"
option_3=" Suspend"
option_4=" Hibernate"
option_5=" Reboot"
option_6=" Shutdown"
else
option_1=""
option_2=""
option_3=""
option_4=""
option_5=""
option_6=""
fi
cnflayout=`cat ${CNFR} | grep 'USE_ICON' | cut -d'=' -f2`
if [[ "$cnflayout" == 'NO' ]]; then
yes=' Yes'
no=' No'
else
yes=''
no=''
fi
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$prompt" \
-mesg "$mesg" \
-markup-rows \
-theme ${RASI}
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5\n$option_6" | rofi_cmd
}
# Confirmation CMD
confirm_cmd() {
rofi -dmenu \
-p 'Confirmation' \
-mesg 'Are you Sure?' \
-selected-row 1 \
-no-click-to-exit \
-theme ${CNFR}
}
# Ask for confirmation
confirm_exit() {
echo -e "$yes\n$no" | confirm_cmd
}
# Confirm and execute
confirm_run () {
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
${1} && ${2} && ${3}
else
exit
fi
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
betterlockscreen --lock
elif [[ "$1" == '--opt2' ]]; then
confirm_run 'i3-msg exit'
elif [[ "$1" == '--opt3' ]]; then
confirm_run 'mpc -q pause' 'pulsemixer --mute' 'betterlockscreen --suspend'
elif [[ "$1" == '--opt4' ]]; then
confirm_run 'systemctl hibernate'
elif [[ "$1" == '--opt5' ]]; then
confirm_run 'systemctl reboot'
elif [[ "$1" == '--opt6' ]]; then
confirm_run 'systemctl poweroff'
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$option_1)
run_cmd --opt1
;;
$option_2)
run_cmd --opt2
;;
$option_3)
run_cmd --opt3
;;
$option_4)
run_cmd --opt4
;;
$option_5)
run_cmd --opt5
;;
$option_6)
run_cmd --opt6
;;
esac

12
ac-i3/scripts/rofi_runner Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/runner.rasi"
# Run
rofi \
-show run \
-theme ${RASI}

141
ac-i3/scripts/rofi_screenshot Executable file
View File

@@ -0,0 +1,141 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/screenshot.rasi"
# Theme Elements
prompt='Screenshot'
mesg="Directory :: `xdg-user-dir PICTURES`/Screenshots"
# Options
layout=`cat ${RASI} | grep 'USE_ICON' | cut -d'=' -f2`
if [[ "$layout" == 'NO' ]]; then
option_1=" Capture Desktop"
option_2=" Capture Area"
option_3=" Capture Window"
option_4=" Capture in 5s"
option_5=" Capture in 10s"
else
option_1=""
option_2=""
option_3=""
option_4=""
option_5=""
fi
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$prompt" \
-mesg "$mesg" \
-markup-rows \
-theme ${RASI}
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5" | rofi_cmd
}
# Screenshot
time=`date +%Y-%m-%d-%H-%M-%S`
geometry=`xrandr | grep 'current' | head -n1 | cut -d',' -f2 | tr -d '[:blank:],current'`
dir="`xdg-user-dir PICTURES`/Screenshots"
file="Screenshot_${time}_${geometry}.png"
# Directory
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"
fi
# notify and view screenshot
notify_view() {
notify_cmd_shot='dunstify -u low -h string:x-dunst-stack-tag:obscreenshot -i /usr/share/archcraft/icons/dunst/picture.png'
${notify_cmd_shot} "Copied to clipboard."
paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga &>/dev/null &
viewnior ${dir}/"$file"
if [[ -e "$dir/$file" ]]; then
${notify_cmd_shot} "Screenshot Saved."
else
${notify_cmd_shot} "Screenshot Deleted."
fi
}
# Copy screenshot to clipboard
copy_shot () {
tee "$file" | xclip -selection clipboard -t image/png
}
# countdown
countdown () {
for sec in `seq $1 -1 1`; do
dunstify -t 1000 -h string:x-dunst-stack-tag:screenshottimer -i /usr/share/archcraft/icons/dunst/timer.png "Taking shot in : $sec"
sleep 1
done
}
# take shots
shotnow () {
cd ${dir} && sleep 0.5 && maim -u -f png | copy_shot
notify_view
}
shot5 () {
countdown '5'
sleep 1 && cd ${dir} && maim -u -f png | copy_shot
notify_view
}
shot10 () {
countdown '10'
sleep 1 && cd ${dir} && maim -u -f png | copy_shot
notify_view
}
shotwin () {
cd ${dir} && maim -u -f png -i `xdotool getactivewindow` | copy_shot
notify_view
}
shotarea () {
cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.85,0.25 -l | copy_shot
notify_view
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
shotnow
elif [[ "$1" == '--opt2' ]]; then
shotarea
elif [[ "$1" == '--opt3' ]]; then
shotwin
elif [[ "$1" == '--opt4' ]]; then
shot5
elif [[ "$1" == '--opt5' ]]; then
shot10
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$option_1)
run_cmd --opt1
;;
$option_2)
run_cmd --opt2
;;
$option_3)
run_cmd --opt3
;;
$option_4)
run_cmd --opt4
;;
$option_5)
run_cmd --opt5
;;
esac

12
ac-i3/scripts/rofi_windows Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
# Import Current Theme
DIR="$HOME/.config/polybar/ac-i3"
RASI="$DIR/scripts/rofi/windows.rasi"
# Run
rofi \
-show window \
-theme ${RASI}