From 660fc44c906fe40fc3b166e17923e1cd003e1281 Mon Sep 17 00:00:00 2001 From: adi1090x Date: Sun, 16 Jul 2023 01:32:34 +0530 Subject: [PATCH] Updated berry completely --- .gitignore | 5 + PKGBUILD | 18 +- files/alacritty/alacritty.yml | 4 +- files/alacritty/colors.yml | 3 +- files/alacritty/fonts.yml | 3 +- files/autostart | 2 +- files/bin/askpass.sh | 10 - files/bin/asroot.sh | 9 - files/dunstrc | 8 +- files/picom.conf | 2 +- files/rofi/bin/asroot | 38 --- files/rofi/bin/launcher | 17 - files/rofi/bin/mpd | 84 ----- files/rofi/bin/powermenu | 80 ----- files/rofi/bin/screenshot | 102 ------ files/rofi/themes/askpass.rasi | 26 -- files/rofi/themes/asroot.rasi | 152 --------- files/rofi/themes/colors.rasi | 11 - files/rofi/themes/confirm.rasi | 26 -- files/rofi/themes/launcher.rasi | 207 ----------- files/rofi/themes/mpd.rasi | 154 --------- files/rofi/themes/networkmenu.rasi | 153 --------- files/rofi/themes/powermenu.rasi | 154 --------- files/rofi/themes/screenshot.rasi | 154 --------- files/scripts/berry_asroot | 12 + .../autostart.sh => scripts/berry_autostart} | 36 +- files/scripts/berry_bar | 9 + .../berry_brightness} | 0 .../berry_colorpicker} | 0 .../{bin/berrycomp.sh => scripts/berry_comp} | 5 +- .../berrydunst.sh => scripts/berry_dunst} | 7 +- .../berrymusic.sh => scripts/berry_music} | 5 +- .../berry_screenshot} | 0 .../{bin/berryterm.sh => scripts/berry_term} | 11 +- .../berryvolume.sh => scripts/berry_volume} | 0 files/{rofi/bin => scripts}/network_menu | 4 +- files/scripts/rofi_askpass | 14 + files/scripts/rofi_asroot | 78 +++++ files/scripts/rofi_bluetooth | 321 ++++++++++++++++++ files/scripts/rofi_launcher | 13 + files/scripts/rofi_music | 118 +++++++ files/scripts/rofi_powermenu | 115 +++++++ files/scripts/rofi_runner | 12 + files/scripts/rofi_screenshot | 141 ++++++++ files/scripts/rofi_windows | 12 + files/sxhkdrc | 42 ++- .../themes => theme}/networkmenu_config.ini | 2 +- files/{bin/berrybar.sh => theme/polybar.sh} | 34 +- .../colors => theme/polybar/colors.ini} | 0 .../config => theme/polybar/config.ini} | 13 +- .../decor => theme/polybar/decor.ini} | 0 files/theme/polybar/launch.sh | 42 +++ .../modules => theme/polybar/modules.ini} | 23 +- files/theme/polybar/scripts/bluetooth.sh | 66 ++++ files/theme/rofi/askpass.rasi | 77 +++++ files/theme/rofi/asroot.rasi | 151 ++++++++ files/theme/rofi/bluetooth.rasi | 306 +++++++++++++++++ files/theme/rofi/confirm.rasi | 151 ++++++++ files/theme/rofi/launcher.rasi | 304 +++++++++++++++++ files/theme/rofi/music.rasi | 151 ++++++++ files/theme/rofi/networkmenu.rasi | 306 +++++++++++++++++ files/theme/rofi/powermenu.rasi | 151 ++++++++ files/theme/rofi/runner.rasi | 304 +++++++++++++++++ files/theme/rofi/screenshot.rasi | 151 ++++++++ files/theme/rofi/shared/colors.rasi | 12 + files/theme/rofi/shared/fonts.rasi | 7 + files/theme/rofi/windows.rasi | 304 +++++++++++++++++ files/{polybar/system => theme/system.ini} | 1 - .../default.jpg => theme/wallpaper} | Bin files/xsettingsd | 12 + 70 files changed, 3466 insertions(+), 1479 deletions(-) create mode 100644 .gitignore delete mode 100755 files/bin/askpass.sh delete mode 100755 files/bin/asroot.sh delete mode 100755 files/rofi/bin/asroot delete mode 100755 files/rofi/bin/launcher delete mode 100755 files/rofi/bin/mpd delete mode 100755 files/rofi/bin/powermenu delete mode 100755 files/rofi/bin/screenshot delete mode 100644 files/rofi/themes/askpass.rasi delete mode 100644 files/rofi/themes/asroot.rasi delete mode 100644 files/rofi/themes/colors.rasi delete mode 100644 files/rofi/themes/confirm.rasi delete mode 100644 files/rofi/themes/launcher.rasi delete mode 100644 files/rofi/themes/mpd.rasi delete mode 100644 files/rofi/themes/networkmenu.rasi delete mode 100644 files/rofi/themes/powermenu.rasi delete mode 100644 files/rofi/themes/screenshot.rasi create mode 100755 files/scripts/berry_asroot rename files/{bin/autostart.sh => scripts/berry_autostart} (54%) create mode 100755 files/scripts/berry_bar rename files/{bin/berrybrightness.sh => scripts/berry_brightness} (100%) rename files/{bin/berrycolorpicker.sh => scripts/berry_colorpicker} (100%) rename files/{bin/berrycomp.sh => scripts/berry_comp} (76%) rename files/{bin/berrydunst.sh => scripts/berry_dunst} (57%) rename files/{bin/berrymusic.sh => scripts/berry_music} (87%) rename files/{bin/berryscreenshot.sh => scripts/berry_screenshot} (100%) rename files/{bin/berryterm.sh => scripts/berry_term} (63%) rename files/{bin/berryvolume.sh => scripts/berry_volume} (100%) rename files/{rofi/bin => scripts}/network_menu (99%) create mode 100755 files/scripts/rofi_askpass create mode 100755 files/scripts/rofi_asroot create mode 100755 files/scripts/rofi_bluetooth create mode 100755 files/scripts/rofi_launcher create mode 100755 files/scripts/rofi_music create mode 100755 files/scripts/rofi_powermenu create mode 100755 files/scripts/rofi_runner create mode 100755 files/scripts/rofi_screenshot create mode 100755 files/scripts/rofi_windows rename files/{rofi/themes => theme}/networkmenu_config.ini (92%) rename files/{bin/berrybar.sh => theme/polybar.sh} (57%) rename files/{polybar/colors => theme/polybar/colors.ini} (100%) rename files/{polybar/config => theme/polybar/config.ini} (97%) rename files/{polybar/decor => theme/polybar/decor.ini} (100%) create mode 100755 files/theme/polybar/launch.sh rename files/{polybar/modules => theme/polybar/modules.ini} (97%) create mode 100755 files/theme/polybar/scripts/bluetooth.sh create mode 100644 files/theme/rofi/askpass.rasi create mode 100644 files/theme/rofi/asroot.rasi create mode 100644 files/theme/rofi/bluetooth.rasi create mode 100644 files/theme/rofi/confirm.rasi create mode 100644 files/theme/rofi/launcher.rasi create mode 100644 files/theme/rofi/music.rasi create mode 100644 files/theme/rofi/networkmenu.rasi create mode 100644 files/theme/rofi/powermenu.rasi create mode 100644 files/theme/rofi/runner.rasi create mode 100644 files/theme/rofi/screenshot.rasi create mode 100644 files/theme/rofi/shared/colors.rasi create mode 100644 files/theme/rofi/shared/fonts.rasi create mode 100644 files/theme/rofi/windows.rasi rename files/{polybar/system => theme/system.ini} (99%) rename files/{wallpapers/default.jpg => theme/wallpaper} (100%) create mode 100644 files/xsettingsd diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..af24f00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/src +/pkg +*.pkg.tar.zst +cleanup.sh +push.sh diff --git a/PKGBUILD b/PKGBUILD index ae9b96d..b1c2cb2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,8 +1,8 @@ # Maintainer: Aditya Shakya pkgname=archcraft-berry -pkgver=2.0 -pkgrel=4 +pkgver=3.0 +pkgrel=0 pkgdesc="Berry Configurations for Archcraft" url="https://github.com/archcraft-os/archcraft-berry" arch=('any') @@ -17,6 +17,7 @@ depends=('berry-git' 'betterlockscreen' 'xfce4-power-manager' 'sxhkd' 'hsetroot' + 'xsettingsd' 'wmname' 'pulsemixer' 'light' 'xcolor' ) @@ -35,13 +36,13 @@ package() { # Copy config files cp -r ${srcdir}/alacritty "$_config" - cp -r ${srcdir}/bin "$_config" - cp -r ${srcdir}/polybar "$_config" - cp -r ${srcdir}/rofi "$_config" - cp -r ${srcdir}/wallpapers "$_config" + cp -r ${srcdir}/scripts "$_config" + cp -r ${srcdir}/theme "$_config" - chmod +x "$_config"/bin/* - chmod +x "$_config"/rofi/bin/* + chmod +x "$_config"/scripts/* + chmod +x "$_config"/theme/polybar.sh + chmod +x "$_config"/theme/polybar/launch.sh + chmod +x "$_config"/theme/polybar/scripts/bluetooth.sh install -Dm 755 autostart "$_config"/autostart install -Dm 644 dunstrc "$_config"/dunstrc @@ -50,6 +51,7 @@ package() { install -Dm 644 picom-jonaburg.conf "$_config"/picom-jonaburg.conf install -Dm 644 picom-original.conf "$_config"/picom-original.conf install -Dm 644 sxhkdrc "$_config"/sxhkdrc + install -Dm 644 xsettingsd "$_config"/xsettingsd install -Dm 644 berry.desktop ${pkgdir}/usr/share/xsessions/berry.desktop } diff --git a/files/alacritty/alacritty.yml b/files/alacritty/alacritty.yml index 3b8e6ba..297f34b 100644 --- a/files/alacritty/alacritty.yml +++ b/files/alacritty/alacritty.yml @@ -17,8 +17,8 @@ env: ## Terminal window settings window: dimensions: - columns: 84 - lines: 23 + columns: 82 + lines: 24 padding: x: 25 diff --git a/files/alacritty/colors.yml b/files/alacritty/colors.yml index 91079fd..b6f6a22 100644 --- a/files/alacritty/colors.yml +++ b/files/alacritty/colors.yml @@ -1,6 +1,7 @@ ## Copyright (C) 2020-2023 Aditya Shakya - +## ## Colors configuration + colors: # Default colors primary: diff --git a/files/alacritty/fonts.yml b/files/alacritty/fonts.yml index b242122..dcb2943 100644 --- a/files/alacritty/fonts.yml +++ b/files/alacritty/fonts.yml @@ -1,6 +1,7 @@ ## Copyright (C) 2020-2023 Aditya Shakya - +## ## Font configuration + font: # Normal (roman) font face normal: diff --git a/files/autostart b/files/autostart index f34be75..0078a6f 100755 --- a/files/autostart +++ b/files/autostart @@ -37,4 +37,4 @@ berryc resize_mask "mod4" berryc resize_button 3 ## Autostart Programs ------------------------------------------ -bash "$HOME"/.config/berry/bin/autostart.sh +bash "$HOME"/.config/berry/scripts/berry_autostart diff --git a/files/bin/askpass.sh b/files/bin/askpass.sh deleted file mode 100755 index 4635f31..0000000 --- a/files/bin/askpass.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -rofi -dmenu \ - -password \ - -i \ - -no-fixed-num-lines \ - -p "User Password: " \ - -theme ~/.config/berry/rofi/themes/askpass.rasi & diff --git a/files/bin/asroot.sh b/files/bin/asroot.sh deleted file mode 100755 index 7d1fa6c..0000000 --- a/files/bin/asroot.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -## rofi sudo askpass helper -export SUDO_ASKPASS=~/.config/berry/bin/askpass.sh - -## execute the application -sudo -A $1 diff --git a/files/dunstrc b/files/dunstrc index 54da3e0..a4b756a 100644 --- a/files/dunstrc +++ b/files/dunstrc @@ -12,12 +12,12 @@ scale = 0 notification_limit = 0 progress_bar = true progress_bar_height = 80 -progress_bar_frame_width = 1 +progress_bar_frame_width = 2 progress_bar_min_width = 300 progress_bar_max_width = 300 indicate_hidden = yes transparency = 0 -separator_height = 4 +separator_height = 2 padding = 15 horizontal_padding = 15 text_icon_padding = 0 @@ -26,8 +26,8 @@ gap_size = 0 separator_color = frame sort = yes idle_threshold = 120 -font = Iosevka Custom 9 -line_height = 4 +font = JetBrainsMono Nerd Font 10 +line_height = 2 markup = full format = %s\n%b alignment = left diff --git a/files/picom.conf b/files/picom.conf index d5f748c..0ff7616 100644 --- a/files/picom.conf +++ b/files/picom.conf @@ -10,7 +10,7 @@ # Sets the radius of rounded window corners. When > 0, the compositor will # round the corners of windows. Does not interact well with # `transparent-clipping`. -corner-radius = 12 +corner-radius = 20 rounded-corners-exclude = [ # "window_type = 'normal'", diff --git a/files/rofi/bin/asroot b/files/rofi/bin/asroot deleted file mode 100755 index 3d4712c..0000000 --- a/files/rofi/bin/asroot +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -DIR="$HOME/.config/berry" -rofi_cmd="rofi -theme $DIR/rofi/themes/asroot.rasi" - -# Apps -terminal=" Alacritty" -files=" Thunar" -editor=" Geany" -clifm=" Ranger" -vim=" Vim" - -# Variable passed to rofi -options="$terminal\n$files\n$editor\n$clifm\n$vim" -term='alacritty --class alacritty-float,alacritty-float --config-file /root/.config/alacritty/alacritty.yml' - -# Functions - -chosen="$(echo -e "$options" | $rofi_cmd -p "Run as root" -dmenu -selected-row 0)" -case $chosen in - $terminal) - "$DIR"/bin/asroot.sh "$term" - ;; - $files) - "$DIR"/bin/asroot.sh 'dbus-run-session thunar' - ;; - $editor) - "$DIR"/bin/asroot.sh geany - ;; - $clifm) - "$DIR"/bin/asroot.sh "$term -e ranger" - ;; - $vim) - "$DIR"/bin/asroot.sh "$term -e vim" - ;; -esac diff --git a/files/rofi/bin/launcher b/files/rofi/bin/launcher deleted file mode 100755 index 2c9f62c..0000000 --- a/files/rofi/bin/launcher +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -DIR="$HOME/.config/berry" - -rofi \ - -show drun \ - -modi run,drun \ - -no-lazy-grab \ - -scroll-method 0 \ - -drun-match-fields all \ - -drun-display-format "{name}" \ - -no-drun-show-actions \ - -terminal alacritty \ - -kb-cancel Alt-F1 \ - -theme "$DIR"/rofi/themes/launcher.rasi diff --git a/files/rofi/bin/mpd b/files/rofi/bin/mpd deleted file mode 100755 index a092083..0000000 --- a/files/rofi/bin/mpd +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -DIR="$HOME/.config/berry" - -rofi_cmd="rofi -theme $DIR/rofi/themes/mpd.rasi" - -button_music='' -button_play='' -button_pause='' -button_stop='' -button_next='' -button_previous='' -button_repeat='' -button_shuffle='' -button_error='' - -# Colors -active="" -urgent="" - -# Gets the current status of mpd -status="$(mpc status)" - -# Defines the Play / Pause option content -if [[ $status == *"[playing]"* ]]; then - toggle="$button_pause" -else - toggle="$button_play" -fi - -# Display if repeat mode is on / off -tog_repeat="$button_repeat" -if [[ $status == *"repeat: on"* ]]; then - active="-a 4" -elif [[ $status == *"repeat: off"* ]]; then - urgent="-u 4" -else - tog_repeat="$button_error" -fi - -# Display if random mode is on / off -tog_random="$button_shuffle" -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 - tog_random="$button_error" -fi - -# Variable passed to rofi -options="$toggle\n$button_stop\n$button_previous\n$button_next\n$tog_repeat\n$tog_random" - -# Get the current playing song -current=$(mpc current) -# If mpd isn't running it will return an empty string, we don't want to display that -if [[ -z "$current" ]]; then - current="None" -fi - -# Spawn the mpd menu with the "Play / Pause" entry selected by default -chosen="$(echo -e "$options" | $rofi_cmd -p "$current" -dmenu $active $urgent -selected-row 0)" -case $chosen in - $button_previous) - mpc -q prev && kunst --size 60x60 --silent - ;; - $toggle) - mpc -q toggle && kunst --size 60x60 --silent - ;; - $button_stop) - mpc -q stop - ;; - $button_next) - mpc -q next && kunst --size 60x60 --silent - ;; - $tog_repeat) - mpc -q repeat - ;; - $tog_random) - mpc -q random - ;; -esac diff --git a/files/rofi/bin/powermenu b/files/rofi/bin/powermenu deleted file mode 100755 index c459ec0..0000000 --- a/files/rofi/bin/powermenu +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -DIR="$HOME/.config/berry" - -rofi_cmd="rofi -theme $DIR/rofi/themes/powermenu.rasi" -uptime=$(uptime -p | sed -e 's/up //g') - -# Options -shutdown="" -reboot="" -lock="" -suspend="" -logout="" - -# Get user confirmation -get_confirmation() { - rofi -dmenu -i \ - -no-fixed-num-lines \ - -p "Are You Sure? : " \ - -theme "$DIR"/rofi/themes/confirm.rasi -} - -# Show message -show_msg() { - rofi -theme "$DIR"/rofi/themes/askpass.rasi -e "Options - yes / y / no / n" -} - -# Variable passed to rofi -options="$shutdown\n$reboot\n$lock\n$suspend\n$logout" - -chosen="$(echo -e "$options" | $rofi_cmd -p "UP - $uptime" -dmenu -selected-row 2)" -case $chosen in - $shutdown) - ans=$(get_confirmation) - if [[ $ans == "yes" ]] || [[ $ans == "YES" ]] || [[ $ans == "y" ]]; then - systemctl poweroff - elif [[ $ans == "no" ]] || [[ $ans == "NO" ]] || [[ $ans == "n" ]]; then - exit - else - show_msg - fi - ;; - $reboot) - ans=$(get_confirmation) - if [[ $ans == "yes" ]] || [[ $ans == "YES" ]] || [[ $ans == "y" ]]; then - systemctl reboot - elif [[ $ans == "no" ]] || [[ $ans == "NO" ]] || [[ $ans == "n" ]]; then - exit - else - show_msg - fi - ;; - $lock) - betterlockscreen --lock - ;; - $suspend) - ans=$(get_confirmation) - if [[ $ans == "yes" ]] || [[ $ans == "YES" ]] || [[ $ans == "y" ]]; then - mpc -q pause - amixer set Master mute - betterlockscreen --suspend - elif [[ $ans == "no" ]] || [[ $ans == "NO" ]] || [[ $ans == "n" ]]; then - exit - else - show_msg - fi - ;; - $logout) - ans=$(get_confirmation) - if [[ $ans == "yes" ]] || [[ $ans == "YES" ]] || [[ $ans == "y" ]]; then - berryc quit - elif [[ $ans == "no" ]] || [[ $ans == "NO" ]] || [[ $ans == "n" ]]; then - exit - else - show_msg - fi - ;; -esac diff --git a/files/rofi/bin/screenshot b/files/rofi/bin/screenshot deleted file mode 100755 index 19447d8..0000000 --- a/files/rofi/bin/screenshot +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2023 Aditya Shakya - -DIR="$HOME/.config/berry" - -# 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" - -# Commands -notify_cmd_shot="dunstify -u low --replace=699 -i /usr/share/archcraft/icons/dunst/picture.png" -rofi_cmd="rofi -theme $DIR/rofi/themes/screenshot.rasi" - -# Buttons -screen="" -area="" -window="" -infive="" -inten="" - -# notify and view screenshot -notify_view () { - ${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 --replace=699 -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 -} - -if [[ ! -d "$dir" ]]; then - mkdir -p "$dir" -fi - -# Variable passed to rofi -options="$screen\n$area\n$window\n$infive\n$inten" - -chosen="$(echo -e "$options" | $rofi_cmd -p 'Take Screenshot' -dmenu -selected-row 0)" -case $chosen in - $screen) - shotnow - ;; - $area) - shotarea - ;; - $window) - shotwin - ;; - $infive) - shot5 - ;; - $inten) - shot10 - ;; -esac - diff --git a/files/rofi/themes/askpass.rasi b/files/rofi/themes/askpass.rasi deleted file mode 100644 index 1d9a55a..0000000 --- a/files/rofi/themes/askpass.rasi +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -@import "colors.rasi" - -* { - background-color: @background; - text-color: @foreground; - font: "JetBrains Mono Medium 10"; -} - -window { - width: 300px; - padding: 25px; - border: 1px; - border-radius: 14px; - border-color: @selected; - location: center; - x-offset: 0; - y-offset: -4%; -} - -entry { - expand: true; - width: 150px; - text-color: @selected; -} diff --git a/files/rofi/themes/asroot.rasi b/files/rofi/themes/asroot.rasi deleted file mode 100644 index 73a9e11..0000000 --- a/files/rofi/themes/asroot.rasi +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - font: "JetBrains Mono Medium 10"; - show-icons: false; - display-drun: ""; - drun-display-format: "{icon} {name}"; - disable-history: false; - click-to-exit: true; -} - -@import "colors.rasi" - -window { - transparency: "real"; - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 300px; - location: center; - anchor: center; - x-offset: 0; - y-offset: 0; -} - -prompt { - enabled: true; - margin: 0px 0px 0px 8px; - padding: 6px 0px 6px 0px; - background-color: @selected; - text-color: @background; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -textbox-prompt-colon { - expand: false; - str: ""; - border-radius: 100%; - background-color: @background-alt; - text-color: @foreground; - padding: 6px 10px 6px 10px; - font: "Iosevka Nerd Font 10"; -} - -entry { - background-color: @selected; - text-color: @background; - placeholder-color: @background; - placeholder: ""; - expand: true; - horizontal-align: 0; - blink: false; - padding: 6px; -} - -inputbar { - children: [ textbox-prompt-colon, prompt ]; - background-color: @selected; - spacing: 0px; - text-color: @foreground; - border: 0px; - border-radius: 100%; - border-color: @selected; - expand: false; - margin: 0px 0px 0px 0px; - padding: 2px; - position: center; -} - -case-indicator { - background-color: @background; - text-color: @foreground; - spacing: 0; -} - - -listview { - background-color: @background; - columns: 1; - lines: 5; - spacing: 4px; - cycle: true; - dynamic: true; - layout: vertical; -} - -mainbox { - background-color: @background; - children: [ inputbar, listview ]; - spacing: 15px; - padding: 20px; -} - -element { - background-color: @background; - text-color: @foreground; - orientation: horizontal; - border-radius: 0px; - padding: 6px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 0px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - expand: true; - horizontal-align: 0; - vertical-align: 0.5; - margin: 2px 0px 2px 2px; -} - -element selected { - background-color: @on; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -element.active, -element.selected.urgent { - background-color: @on; - text-color: @background; - border-color: @on; -} - -element.selected.urgent { - border-color: @selected; -} - -element.urgent, -element.selected.active { - background-color: @off; - text-color: @background; - border-color: @off; -} - -element.selected.active { - border-color: @selected; -} diff --git a/files/rofi/themes/colors.rasi b/files/rofi/themes/colors.rasi deleted file mode 100644 index c240741..0000000 --- a/files/rofi/themes/colors.rasi +++ /dev/null @@ -1,11 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -* { - background: #011826; - background-alt: #0A2332; - foreground: #EEEEEE; - selected: #D97E96; - urgent: #635373; - on: #496886; - off: #A36584; -} diff --git a/files/rofi/themes/confirm.rasi b/files/rofi/themes/confirm.rasi deleted file mode 100644 index 93de33e..0000000 --- a/files/rofi/themes/confirm.rasi +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -@import "colors.rasi" - -* { - background-color: @background; - text-color: @foreground; - font: "JetBrains Mono Medium 10"; -} - -window { - width: 230px; - padding: 25px; - border: 1px; - border-radius: 14px; - border-color: @selected; - location: center; - x-offset: 0; - y-offset: -4%; -} - -entry { - expand: true; - width: 150px; - text-color: @selected; -} diff --git a/files/rofi/themes/launcher.rasi b/files/rofi/themes/launcher.rasi deleted file mode 100644 index c5d74d0..0000000 --- a/files/rofi/themes/launcher.rasi +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - location: 8; - fixed-num-lines: true; - show-icons: true; - sidebar-mode: true; - scroll-method: 1; - window-format: "[{w}] | {c} | {t}"; - click-to-exit: true; - combi-hide-mode-prefix: false; - display-window: ""; - display-windowcd: ""; - display-run: ""; - display-ssh: ""; - display-drun: ""; - display-combi: ""; -} - -@import "colors.rasi" - -* { - font: "JetBrains Mono Medium 10"; - background-color: @background; -} - -window { - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 420px; - height: 90%; - x-offset: 20; - y-offset: 28; -} - -prompt { - spacing: 0; - border: 0; - border-radius: 100%; - background-color: @background-alt; - text-color: @foreground; - padding: 6px 14px 6px 10px; -} - -textbox-prompt-colon { - background-color: @selected; - expand: false; - str: ""; - padding: 6px 4px 6px 4px; - text-color: inherit; -} - -entry { - spacing: 0; - expand: true; - horizontal-align: 0; - background-color: @selected; - text-color: @background; - placeholder-color: @background; - placeholder: "Search..."; - padding: 6px 2px 6px 2px; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -case-indicator { - spacing: 0; - text-color: @foreground; -} - -inputbar { - background-color: @selected; - spacing: 0px; - padding: 2px; - text-color: @background; - border: 1px; - border-color: @selected; - border-radius: 100%; - children: [ prompt,textbox-prompt-colon,entry ]; -} - -mainbox { - border: 0px; - border-color: @selected; - spacing: 10px; - padding: 25px; -} - -listview { - lines: 7; - columns: 1; - fixed-height: 0; - border: 0px; - border-color: @foreground; - spacing: 5px; - scrollbar: false; - padding: 5px 0px 0px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 24px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - expand: true; - horizontal-align: 0; - vertical-align: 0.5; - margin: 2px 0px 2px 10px; -} - - -element { - border: 0px; - padding: 6px; -} -element normal.normal { - background-color: @background; - text-color: @foreground; -} -element normal.urgent { - background-color: @background; - text-color: @off; -} -element normal.active { - background-color: @background; - text-color: @on; -} -element selected.normal { - background-color: @on; - text-color: @foreground; - border: 0px; - border-radius: 100%; - border-color: @selected; -} -element selected.urgent { - background-color: @background; - text-color: @off; -} -element selected.active { - background-color: @background; - text-color: @selected; -} -element alternate.normal { - background-color: @background; - text-color: @foreground; -} -element alternate.urgent { - background-color: @background; - text-color: @foreground; -} -element alternate.active { - background-color: @background; - text-color: @foreground; -} - -sidebar { - border: 0px; - border-color: @selected; - border-radius: 0px; -} - -button { - margin: 5px 10px 0px 10px; - horizontal-align: 0.5; - vertical-align: 0.5; - padding: 10px; - background-color: @background-alt; - text-color: @foreground; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -button selected { - background-color: @selected; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -scrollbar { - width: 4px; - border: 0px; - handle-color: @foreground; - handle-width: 8px; - padding: 0; -} - -message { - border: 0px; - border-color: @selected; - padding: 1px; -} - -textbox { - text-color: @foreground; -} diff --git a/files/rofi/themes/mpd.rasi b/files/rofi/themes/mpd.rasi deleted file mode 100644 index b516872..0000000 --- a/files/rofi/themes/mpd.rasi +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - location: 4; - font: "JetBrains Mono Medium 10"; - show-icons: false; - display-drun: ""; - drun-display-format: "{icon} {name}"; - disable-history: false; - click-to-exit: true; -} - -@import "colors.rasi" - -window { - transparency: "real"; - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 100px; - x-offset: -20; - y-offset: 0; -} - -prompt { - enabled: true; - margin: 0px 0px 0px 8px; - padding: 6px 0px 6px 0px; - background-color: @background; - text-color: @foreground; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -textbox-prompt-colon { - expand: false; - str: "ﱘ"; - border-radius: 8px; - background-color: @highlight; - text-color: @background; - padding: 6px 10px 6px 10px; - font: "Iosevka Nerd Font 10"; -} - -entry { - background-color: @background; - text-color: @background; - placeholder-color: @background; - placeholder: ""; - expand: true; - horizontal-align: 0; - blink: false; - padding: 6px; -} - -inputbar { - children: [ textbox-prompt-colon, prompt ]; - spacing: 0; - background-color: @background; - text-color: @foreground; - border: 0px; - border-radius: 0px; - border-color: @selected; - expand: false; - margin: 0px 0px 0px 0px; - padding: 0px; - position: center; -} - -case-indicator { - background-color: @background; - text-color: @foreground; - spacing: 0; -} - - -listview { - background-color: @background; - columns: 1; - lines: 6; - spacing: 10px; - cycle: true; - dynamic: true; - layout: vertical; -} - -mainbox { - background-color: @background; - children: [ listview ]; - spacing: 10px; - padding: 20px; -} - -element { - background-color: @background-alt; - text-color: @foreground; - orientation: horizontal; - border-radius: 100%; - padding: 14px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 0px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - font: "feather 16"; - expand: true; - horizontal-align: 0.5; - vertical-align: 0.5; - margin: 0px; -} - -element selected { - background-color: @selected; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -element.active, -element.selected.urgent { - background-color: @on; - text-color: @background; - border-color: @on; - border-radius: 100%; -} - -element.selected.urgent { - border-color: @selected; -} - -element.urgent, -element.selected.active { - background-color: @off; - text-color: @background; - border-color: @off; - border-radius: 100%; -} - -element.selected.active { - border-color: @selected; -} diff --git a/files/rofi/themes/networkmenu.rasi b/files/rofi/themes/networkmenu.rasi deleted file mode 100644 index d84355d..0000000 --- a/files/rofi/themes/networkmenu.rasi +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - font: "JetBrains Mono Medium 10"; - show-icons: false; - display-drun: ""; - drun-display-format: "{icon} {name}"; - disable-history: false; - click-to-exit: true; -} - -@import "colors.rasi" - -window { - transparency: "real"; - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 400px; - height: 400px; - location: center; - anchor: center; - x-offset: 0; - y-offset: 0; -} - -prompt { - enabled: true; - margin: 0px 0px 0px 8px; - padding: 6px 0px 6px 0px; - background-color: @selected; - text-color: @background; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -textbox-prompt-colon { - expand: false; - str: "直"; - border-radius: 100%; - background-color: @background-alt; - text-color: @foreground; - padding: 6px 10px 6px 10px; - font: "Iosevka Nerd Font 10"; -} - -entry { - background-color: @selected; - text-color: @background; - placeholder-color: @background; - placeholder: ""; - expand: true; - horizontal-align: 0; - blink: false; - padding: 6px; -} - -inputbar { - children: [ textbox-prompt-colon, prompt, entry ]; - background-color: @selected; - spacing: 0px; - text-color: @foreground; - border: 0px; - border-radius: 100%; - border-color: @selected; - expand: false; - margin: 0px 0px 0px 0px; - padding: 2px; - position: center; -} - -case-indicator { - background-color: @background; - text-color: @foreground; - spacing: 0; -} - - -listview { - background-color: @background; - columns: 1; - lines: 8; - spacing: 4px; - cycle: true; - dynamic: true; - layout: vertical; -} - -mainbox { - background-color: @background; - children: [ inputbar, listview ]; - spacing: 15px; - padding: 20px; -} - -element { - background-color: @background; - text-color: @foreground; - orientation: horizontal; - border-radius: 0px; - padding: 6px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 0px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - expand: true; - horizontal-align: 0; - vertical-align: 0.5; - margin: 2px 0px 2px 2px; -} - -element selected { - background-color: @on; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -element.active, -element.selected.urgent { - background-color: @on; - text-color: @background; - border-color: @on; -} - -element.selected.urgent { - border-color: @selected; -} - -element.urgent, -element.selected.active { - background-color: @off; - text-color: @background; - border-color: @off; -} - -element.selected.active { - border-color: @selected; -} diff --git a/files/rofi/themes/powermenu.rasi b/files/rofi/themes/powermenu.rasi deleted file mode 100644 index 499ebf5..0000000 --- a/files/rofi/themes/powermenu.rasi +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - location: 4; - font: "JetBrains Mono Medium 10"; - show-icons: false; - display-drun: ""; - drun-display-format: "{icon} {name}"; - disable-history: false; - click-to-exit: true; -} - -@import "colors.rasi" - -window { - transparency: "real"; - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 100px; - x-offset: -20; - y-offset: 0; -} - -prompt { - enabled: true; - margin: 0px 0px 0px 8px; - padding: 6px 0px 6px 0px; - background-color: @background; - text-color: @foreground; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -textbox-prompt-colon { - expand: false; - str: ""; - border-radius: 8px; - background-color: @highlight; - text-color: @background; - padding: 6px 10px 6px 10px; - font: "Iosevka Nerd Font 10"; -} - -entry { - background-color: @background; - text-color: @background; - placeholder-color: @background; - placeholder: ""; - expand: true; - horizontal-align: 0; - blink: false; - padding: 6px; -} - -inputbar { - children: [ textbox-prompt-colon, prompt ]; - spacing: 0; - background-color: @background; - text-color: @foreground; - border: 0px; - border-radius: 0px; - border-color: @selected; - expand: false; - margin: 0px 0px 0px 0px; - padding: 0px; - position: center; -} - -case-indicator { - background-color: @background; - text-color: @foreground; - spacing: 0; -} - - -listview { - background-color: @background; - columns: 1; - lines: 5; - spacing: 10px; - cycle: true; - dynamic: true; - layout: vertical; -} - -mainbox { - background-color: @background; - children: [ listview ]; - spacing: 10px; - padding: 20px; -} - -element { - background-color: @background-alt; - text-color: @foreground; - orientation: horizontal; - border-radius: 100%; - padding: 14px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 0px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - font: "feather 16"; - expand: true; - horizontal-align: 0.5; - vertical-align: 0.5; - margin: 0px; -} - -element selected { - background-color: @selected; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -element.active, -element.selected.urgent { - background-color: @on; - text-color: @background; - border-color: @on; - border-radius: 100%; -} - -element.selected.urgent { - border-color: @selected; -} - -element.urgent, -element.selected.active { - background-color: @off; - text-color: @background; - border-color: @off; - border-radius: 100%; -} - -element.selected.active { - border-color: @selected; -} diff --git a/files/rofi/themes/screenshot.rasi b/files/rofi/themes/screenshot.rasi deleted file mode 100644 index 669716b..0000000 --- a/files/rofi/themes/screenshot.rasi +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2020-2023 Aditya Shakya */ - -configuration { - location: 4; - font: "JetBrains Mono Medium 10"; - show-icons: false; - display-drun: ""; - drun-display-format: "{icon} {name}"; - disable-history: false; - click-to-exit: true; -} - -@import "colors.rasi" - -window { - transparency: "real"; - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @selected; - border-radius: 14px; - width: 100px; - x-offset: -20; - y-offset: 0; -} - -prompt { - enabled: true; - margin: 0px 0px 0px 8px; - padding: 6px 0px 6px 0px; - background-color: @background; - text-color: @foreground; - border: 0px 0px 0px 0px; - border-color: @selected; - border-radius: 0px; -} - -textbox-prompt-colon { - expand: false; - str: ""; - border-radius: 8px; - background-color: @highlight; - text-color: @background; - padding: 6px 10px 6px 10px; - font: "Iosevka Nerd Font 10"; -} - -entry { - background-color: @background; - text-color: @background; - placeholder-color: @background; - placeholder: ""; - expand: true; - horizontal-align: 0; - blink: false; - padding: 6px; -} - -inputbar { - children: [ textbox-prompt-colon, prompt ]; - spacing: 0; - background-color: @background; - text-color: @foreground; - border: 0px; - border-radius: 0px; - border-color: @selected; - expand: false; - margin: 0px 0px 0px 0px; - padding: 0px; - position: center; -} - -case-indicator { - background-color: @background; - text-color: @foreground; - spacing: 0; -} - - -listview { - background-color: @background; - columns: 1; - lines: 5; - spacing: 10px; - cycle: true; - dynamic: true; - layout: vertical; -} - -mainbox { - background-color: @background; - children: [ listview ]; - spacing: 10px; - padding: 20px; -} - -element { - background-color: @background-alt; - text-color: @foreground; - orientation: horizontal; - border-radius: 100%; - padding: 14px; -} - -element-icon { - background-color: inherit; - text-color: inherit; - horizontal-align: 0.5; - vertical-align: 0.5; - size: 0px; - border: 0px; -} - -element-text { - background-color: inherit; - text-color: inherit; - font: "feather 16"; - expand: true; - horizontal-align: 0.5; - vertical-align: 0.5; - margin: 0px; -} - -element selected { - background-color: @selected; - text-color: @background; - border: 0px; - border-radius: 100%; - border-color: @selected; -} - -element.active, -element.selected.urgent { - background-color: @on; - text-color: @background; - border-color: @on; - border-radius: 100%; -} - -element.selected.urgent { - border-color: @selected; -} - -element.urgent, -element.selected.active { - background-color: @off; - text-color: @background; - border-color: @off; - border-radius: 100%; -} - -element.selected.active { - border-color: @selected; -} diff --git a/files/scripts/berry_asroot b/files/scripts/berry_asroot new file mode 100755 index 0000000..df17cd9 --- /dev/null +++ b/files/scripts/berry_asroot @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# berry directory +DIR="$HOME/.config/berry" + +# rofi sudo askpass helper +export SUDO_ASKPASS="$DIR"/scripts/rofi_askpass + +# execute the application +sudo -A $1 diff --git a/files/bin/autostart.sh b/files/scripts/berry_autostart similarity index 54% rename from files/bin/autostart.sh rename to files/scripts/berry_autostart index 44c116e..172ef74 100755 --- a/files/bin/autostart.sh +++ b/files/scripts/berry_autostart @@ -4,41 +4,49 @@ ## ## Autostart Programs +# berry dir +bdir="$HOME/.config/berry" + # Kill already running process -_ps=(sxhkd polybar picom dunst ksuperkey mpd xfce-polkit xfce4-power-manager) +_ps=(xsettingsd ksuperkey) for _prs in "${_ps[@]}"; do if [[ `pidof ${_prs}` ]]; then killall -9 ${_prs} fi done -# Fix cursor -xsetroot -cursor_name left_ptr +# Enable Simple X hotkey daemon +sxhkd -c "$bdir"/sxhkdrc & -# Polkit agent -/usr/lib/xfce-polkit/xfce-polkit & +# Lauch xsettingsd daemon +xsettingsd --config="$bdir"/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 -sxhkd -c ~/.config/berry/sxhkdrc & - # Enable Super Keys For Menu ksuperkey -e 'Super_L=Alt_L|F1' & ksuperkey -e 'Super_R=Alt_L|F1' & -# Set/Restore wallpaper -hsetroot -cover ~/.config/berry/wallpapers/default.jpg +# Fix cursor +xsetroot -cursor_name left_ptr -# Lauch polybar -~/.config/berry/bin/berrybar.sh +# Restore wallpaper +hsetroot -root -cover "$bdir"/theme/wallpaper # Lauch notification daemon -~/.config/berry/bin/berrydunst.sh +"$bdir"/scripts/berry_dunst + +# Lauch polybar +"$bdir"/scripts/berry_bar # Lauch compositor -~/.config/berry/bin/berrycomp.sh +"$bdir"/scripts/berry_comp # Start mpd exec mpd & diff --git a/files/scripts/berry_bar b/files/scripts/berry_bar new file mode 100755 index 0000000..53a4e0b --- /dev/null +++ b/files/scripts/berry_bar @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# berry directory +DIR="$HOME/.config/berry" + +# launch polybar +bash "$DIR"/theme/polybar.sh diff --git a/files/bin/berrybrightness.sh b/files/scripts/berry_brightness similarity index 100% rename from files/bin/berrybrightness.sh rename to files/scripts/berry_brightness diff --git a/files/bin/berrycolorpicker.sh b/files/scripts/berry_colorpicker similarity index 100% rename from files/bin/berrycolorpicker.sh rename to files/scripts/berry_colorpicker diff --git a/files/bin/berrycomp.sh b/files/scripts/berry_comp similarity index 76% rename from files/bin/berrycomp.sh rename to files/scripts/berry_comp index 7daef41..502e50f 100755 --- a/files/bin/berrycomp.sh +++ b/files/scripts/berry_comp @@ -2,6 +2,9 @@ ## Copyright (C) 2020-2023 Aditya Shakya +# berry directory +DIR="$HOME/.config/berry" + # Terminate if picom is already running killall -q picom @@ -9,4 +12,4 @@ killall -q picom while pgrep -u $UID -x picom >/dev/null; do sleep 1; done # Launch picom -picom --config ~/.config/berry/picom.conf & +picom --config "$DIR"/picom.conf & diff --git a/files/bin/berrydunst.sh b/files/scripts/berry_dunst similarity index 57% rename from files/bin/berrydunst.sh rename to files/scripts/berry_dunst index db407ea..fc2c0aa 100755 --- a/files/bin/berrydunst.sh +++ b/files/scripts/berry_dunst @@ -2,9 +2,12 @@ ## Copyright (C) 2020-2023 Aditya Shakya -## Launch dunst daemon +# berry directory +DIR="$HOME/.config/berry" + +# Launch dunst daemon if [[ `pidof dunst` ]]; then pkill dunst fi -dunst -config ~/.config/berry/dunstrc & +dunst -config "$DIR"/dunstrc & diff --git a/files/bin/berrymusic.sh b/files/scripts/berry_music similarity index 87% rename from files/bin/berrymusic.sh rename to files/scripts/berry_music index 5f0dd4e..b4eb560 100755 --- a/files/bin/berrymusic.sh +++ b/files/scripts/berry_music @@ -4,11 +4,12 @@ ## ## Run ncmpcpp with alternate config -# Berry directory -DIR="$HOME/.config/i3" +# berry directory +DIR="$HOME/.config/berry" CONFIG="$DIR/alacritty/alacritty.yml" alacritty --class 'Music,Music' --config-file "$CONFIG" \ -o window.dimensions.columns=109 window.dimensions.lines=22 \ -e ~/.ncmpcpp/scripts/ncmpcpp-art + diff --git a/files/bin/berryscreenshot.sh b/files/scripts/berry_screenshot similarity index 100% rename from files/bin/berryscreenshot.sh rename to files/scripts/berry_screenshot diff --git a/files/bin/berryterm.sh b/files/scripts/berry_term similarity index 63% rename from files/bin/berryterm.sh rename to files/scripts/berry_term index cdf6962..91f0638 100755 --- a/files/bin/berryterm.sh +++ b/files/scripts/berry_term @@ -1,15 +1,20 @@ #!/usr/bin/env bash ## Copyright (C) 2020-2023 Aditya Shakya - +## ## launch alacritty with berry config -CONFIG="$HOME/.config/berry/alacritty/alacritty.yml" +# berry directory +DIR="$HOME/.config/berry" +CONFIG="$DIR/alacritty/alacritty.yml" if [ "$1" == "--float" ]; then alacritty --class 'alacritty-float,alacritty-float' --config-file "$CONFIG" elif [ "$1" == "--full" ]; then - alacritty --class 'Fullscreen,Fullscreen' --config-file "$CONFIG" -o window.startup_mode=fullscreen window.padding.x=30 window.padding.y=30 window.opacity=0.95 font.size=14 + alacritty --class 'Fullscreen,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 diff --git a/files/bin/berryvolume.sh b/files/scripts/berry_volume similarity index 100% rename from files/bin/berryvolume.sh rename to files/scripts/berry_volume diff --git a/files/rofi/bin/network_menu b/files/scripts/network_menu similarity index 99% rename from files/rofi/bin/network_menu rename to files/scripts/network_menu index 5f04bed..71a4f52 100755 --- a/files/rofi/bin/network_menu +++ b/files/scripts/network_menu @@ -9,7 +9,7 @@ https://wiki.archlinux.org/index.php/NetworkManager#Set_up_PolicyKit_permissions OR running the script as root Add dmenu options and default terminal if desired to -~/.config/networkmanager-dmenu/nmd.ini +~/.config/berry/theme/networkmenu_config.ini """ import pathlib @@ -36,7 +36,7 @@ ENV['LC_ALL'] = 'C' ENC = locale.getpreferredencoding() CONF = configparser.ConfigParser() -CONF.read(expanduser("~/.config/berry/rofi/themes/networkmenu_config.ini")) +CONF.read(expanduser("~/.config/berry/theme/networkmenu_config.ini")) def cli_args(): diff --git a/files/scripts/rofi_askpass b/files/scripts/rofi_askpass new file mode 100755 index 0000000..a8b1cc7 --- /dev/null +++ b/files/scripts/rofi_askpass @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/askpass.rasi" + +# Rofi text dialog to get password +rofi -dmenu \ + -password \ + -i \ + -p "Root" \ + -theme ${RASI} diff --git a/files/scripts/rofi_asroot b/files/scripts/rofi_asroot new file mode 100755 index 0000000..c3bdd04 --- /dev/null +++ b/files/scripts/rofi_asroot @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/asroot.rasi" +ASROOT="$DIR/scripts/berry_asroot" + +# Theme Elements +prompt='Root' +mesg="Run Applications As Root" +term='alacritty --class alacritty-float,alacritty-float --config-file /root/.config/berry/alacritty/alacritty.yml' + +# 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 diff --git a/files/scripts/rofi_bluetooth b/files/scripts/rofi_bluetooth new file mode 100755 index 0000000..45b668a --- /dev/null +++ b/files/scripts/rofi_bluetooth @@ -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/berry" +RASI="$DIR/theme/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 diff --git a/files/scripts/rofi_launcher b/files/scripts/rofi_launcher new file mode 100755 index 0000000..7f975a9 --- /dev/null +++ b/files/scripts/rofi_launcher @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/launcher.rasi" + +# Run +rofi \ + -show drun \ + -kb-cancel Alt-F1 \ + -theme ${RASI} diff --git a/files/scripts/rofi_music b/files/scripts/rofi_music new file mode 100755 index 0000000..4f68e6c --- /dev/null +++ b/files/scripts/rofi_music @@ -0,0 +1,118 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/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 diff --git a/files/scripts/rofi_powermenu b/files/scripts/rofi_powermenu new file mode 100755 index 0000000..f45a994 --- /dev/null +++ b/files/scripts/rofi_powermenu @@ -0,0 +1,115 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/powermenu.rasi" +CNFR="$DIR/theme/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?' \ + -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 'berryc quit' + 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 diff --git a/files/scripts/rofi_runner b/files/scripts/rofi_runner new file mode 100755 index 0000000..ae03497 --- /dev/null +++ b/files/scripts/rofi_runner @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/runner.rasi" + +# Run +rofi \ + -show run \ + -theme ${RASI} diff --git a/files/scripts/rofi_screenshot b/files/scripts/rofi_screenshot new file mode 100755 index 0000000..92324fe --- /dev/null +++ b/files/scripts/rofi_screenshot @@ -0,0 +1,141 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/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 diff --git a/files/scripts/rofi_windows b/files/scripts/rofi_windows new file mode 100755 index 0000000..04abbdb --- /dev/null +++ b/files/scripts/rofi_windows @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +# Import Current Theme +DIR="$HOME/.config/berry" +RASI="$DIR/theme/rofi/windows.rasi" + +# Run +rofi \ + -show window \ + -theme ${RASI} diff --git a/files/sxhkdrc b/files/sxhkdrc index 84bb93f..dd0cd1d 100644 --- a/files/sxhkdrc +++ b/files/sxhkdrc @@ -4,25 +4,29 @@ # Terminal (alacritty) super + Return - bash ~/.config/berry/bin/berryterm.sh + bash ~/.config/berry/scripts/berry_term # Terminal (floating) super + shift + Return - bash ~/.config/berry/bin/berryterm.sh --full + bash ~/.config/berry/scripts/berry_term --full ##---------- Rofi Launcher & Menus ----------## # Rofi App Launcher alt + F1 - bash ~/.config/berry/rofi/bin/launcher + bash ~/.config/berry/scripts/rofi_launcher + +# Rofi Runner +alt + F2 + bash ~/.config/berry/scripts/rofi_runner # Rofi Network Menu super + n - ~/.config/berry/rofi/bin/network_menu + ~/.config/berry/scripts/network_menu # Rofi Menus/Applets -super + {r,m,s,x} - bash ~/.config/berry/rofi/bin/{asroot,mpd,screenshot,powermenu} +super + {b,r,m,s,x,w} + bash ~/.config/berry/scripts/{rofi_bluetooth,rofi_asroot,rofi_music,rofi_screenshot,rofi_powermenu,rofi_windows} ##---------- Applications ----------## @@ -38,41 +42,49 @@ ctrl + alt + {v,r,h} ctrl + alt + l betterlockscreen --lock +# Music Player +ctrl + alt + m + ~/.config/berry/scripts/berry_music + +# Color Picker +super + p + ~/.config/berry/scripts/berry_colorpicker + ##---------- System Keys ----------## # Take a screenshot Print - ~/.config/berry/bin/berryscreenshot.sh --now + ~/.config/berry/scripts/berry_screenshot --now # Take screenshot in 5 second alt + Print - ~/.config/berry/bin/berryscreenshot.sh --in5 + ~/.config/berry/scripts/berry_screenshot --in5 # Take screenshot in 10 second shift + Print - ~/.config/berry/bin/berryscreenshot.sh --in10 + ~/.config/berry/scripts/berry_screenshot --in10 # Take screenshot of active window ctrl + Print - ~/.config/berry/bin/berryscreenshot.sh --win + ~/.config/berry/scripts/berry_screenshot --win # Take screenshot of area super + Print - ~/.config/berry/bin/berryscreenshot.sh --area + ~/.config/berry/scripts/berry_screenshot --area # Brighness control XF86MonBrightness{Up,Down} - ~/.config/berry/bin/berrybrightness.sh{ --inc, --dec} + ~/.config/berry/scripts/berry_brightness{ --inc, --dec} # Volume control XF86Audio{RaiseVolume,LowerVolume} - ~/.config/berry/bin/berryvolume.sh{ --inc, --dec} + ~/.config/berry/scripts/berry_volume{ --inc, --dec} XF86AudioMute - ~/.config/berry/bin/berryvolume.sh --toggle + ~/.config/berry/scripts/berry_volume --toggle XF86AudioMicMute - ~/.config/berry/bin/berryvolume.sh --toggle-mic + ~/.config/berry/scripts/berry_volume --toggle-mic # Music control XF86Audio{Next,Prev,Play,Stop} diff --git a/files/rofi/themes/networkmenu_config.ini b/files/theme/networkmenu_config.ini similarity index 92% rename from files/rofi/themes/networkmenu_config.ini rename to files/theme/networkmenu_config.ini index 1ae2dc6..e7891a7 100644 --- a/files/rofi/themes/networkmenu_config.ini +++ b/files/theme/networkmenu_config.ini @@ -1,7 +1,7 @@ ## Copyright (C) 2020-2023 Aditya Shakya [dmenu] -dmenu_command = rofi -dmenu -theme ~/.config/berry/rofi/themes/networkmenu.rasi +dmenu_command = rofi -dmenu -theme ~/.config/berry/theme/rofi/networkmenu.rasi # # Note that dmenu_command can contain arguments as well like `rofi -width 30` # # Rofi and dmenu are set to case insensitive by default `-i` # l = number of lines to display, defaults to number of total network options diff --git a/files/bin/berrybar.sh b/files/theme/polybar.sh similarity index 57% rename from files/bin/berrybar.sh rename to files/theme/polybar.sh index 0e310bf..26b56ac 100755 --- a/files/bin/berrybar.sh +++ b/files/theme/polybar.sh @@ -3,10 +3,9 @@ ## Copyright (C) 2020-2023 Aditya Shakya ## Files and Directories -DIR="$HOME/.config/berry/polybar" -SFILE="$DIR/system" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +SFILE="$DIR/system.ini" RFILE="$DIR/.system" -MFILE="$DIR/.module" ## Get system variable values for various modules get_values() { @@ -16,7 +15,7 @@ get_values() { INTERFACE=$(ip link | awk '/state UP/ {print $2}' | tr -d :) } -## Write values to `system` file +## Write values to `system.ini` file set_values() { if [[ "$ADAPTER" ]]; then sed -i -e "s/sys_adapter = .*/sys_adapter = $ADAPTER/g" ${SFILE} @@ -34,32 +33,7 @@ set_values() { ## Launch Polybar with selected style launch_bar() { - CARD=$(light -L | grep 'backlight' | head -n1 | cut -d'/' -f3) - INTERFACE=$(ip link | awk '/state UP/ {print $2}' | tr -d :) - - if [[ ! -f "$MFILE" ]]; then - if [[ -z "$CARD" ]]; then - sed -i -e 's/backlight/bna/g' "$DIR"/config - elif [[ "$CARD" != *"intel_"* ]]; then - sed -i -e 's/backlight/brightness/g' "$DIR"/config - fi - - if [[ "$INTERFACE" == e* ]]; then - sed -i -e 's/network/ethernet/g' "$DIR"/config - fi - touch "$MFILE" - fi - - # Terminate already running bar instances - killall -q polybar - - # Wait until the processes have been shut down - while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - - # Launch the bar - for mon in $(polybar --list-monitors | cut -d":" -f1); do - MONITOR=$mon polybar -q main -c "$DIR"/config & - done + bash "$DIR"/polybar/launch.sh } # Execute functions diff --git a/files/polybar/colors b/files/theme/polybar/colors.ini similarity index 100% rename from files/polybar/colors rename to files/theme/polybar/colors.ini diff --git a/files/polybar/config b/files/theme/polybar/config.ini similarity index 97% rename from files/polybar/config rename to files/theme/polybar/config.ini index 18491e3..8c4dc1a 100644 --- a/files/polybar/config +++ b/files/theme/polybar/config.ini @@ -18,11 +18,10 @@ margin-top = 0 ;; File Inclusion ; include an external file, like module file, etc. -include-file = ~/.config/berry/polybar/system - -include-file = ~/.config/berry/polybar/colors -include-file = ~/.config/berry/polybar/modules -include-file = ~/.config/berry/polybar/decor +include-file = ../system.ini +include-file = ./colors.ini +include-file = ./modules.ini +include-file = ./decor.ini ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ @@ -90,7 +89,7 @@ radius = 20.0 ; {overline,underline}-size ; {overline,underline}-color line-size = 2 -line-color = ${color.AC} +line-color = ${color.FG} ; Values applied to all borders ; Individual side values can be defined using: @@ -146,7 +145,7 @@ font-5 = "archcraft:size=12;3" # Default modules-left = date dot mpd modules-center = berrywm -modules-right = volume backlight network battery dot sysmenu +modules-right = volume backlight bluetooth network battery dot sysmenu # Alternate ;modules-left = openbox 2LD cpu 3LD memory 4LD filesystem 5LD diff --git a/files/polybar/decor b/files/theme/polybar/decor.ini similarity index 100% rename from files/polybar/decor rename to files/theme/polybar/decor.ini diff --git a/files/theme/polybar/launch.sh b/files/theme/polybar/launch.sh new file mode 100755 index 0000000..2da7b23 --- /dev/null +++ b/files/theme/polybar/launch.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +CARD="$(light -L | grep 'backlight' | head -n1 | cut -d'/' -f3)" +INTERFACE="$(ip link | awk '/state UP/ {print $2}' | tr -d :)" +RFILE="$DIR/.module" + +# Fix backlight and network modules +fix_modules() { + if [[ -z "$CARD" ]]; then + sed -i -e 's/backlight/bna/g' "$DIR"/config.ini + elif [[ "$CARD" != *"intel_"* ]]; then + sed -i -e 's/backlight/brightness/g' "$DIR"/config.ini + fi + + if [[ "$INTERFACE" == e* ]]; then + sed -i -e 's/network/ethernet/g' "$DIR"/config.ini + fi +} + +# Launch the bar +launch_bar() { + # Terminate already running bar instances + killall -q polybar + + # Wait until the processes have been shut down + while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + # Launch the bar + for mon in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$mon polybar -q main -c "$DIR"/config.ini & + done +} + +# Execute functions +if [[ ! -f "$RFILE" ]]; then + fix_modules + touch "$RFILE" +fi +launch_bar diff --git a/files/polybar/modules b/files/theme/polybar/modules.ini similarity index 97% rename from files/polybar/modules rename to files/theme/polybar/modules.ini index f72be14..8484668 100644 --- a/files/polybar/modules +++ b/files/theme/polybar/modules.ini @@ -612,8 +612,8 @@ format-disconnected-foreground = ${color.BGA} format-disconnected-background = ${color.BG} format-disconnected-padding = 1 -label-connected = "%{A1:~/.config/berry/rofi/bin/network_menu &:}%downspeed%, %upspeed%%{A}" -label-disconnected = "%{A1:~/.config/berry/rofi/bin/network_menu &:}Offline%{A}" +label-connected = "%{A1:~/.config/berry/scripts/network_menu &:}%downspeed%, %upspeed%%{A}" +label-disconnected = "%{A1:~/.config/berry/scripts/network_menu &:}Offline%{A}" ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ @@ -680,12 +680,12 @@ format-disconnected-padding = 1 ; %linkspeed% [wired] ; Default: %ifname% %local_ip% ;label-connected = "%essid%  %downspeed%" -label-connected = "%{A1:~/.config/berry/rofi/bin/network_menu &:}%essid%%{A}" +label-connected = "%{A1:~/.config/berry/scripts/network_menu &:}%essid%%{A}" ; Available tokens: ; %ifname% [wireless+wired] ; Default: (none) -label-disconnected = "%{A1:~/.config/berry/rofi/bin/network_menu &:}Offline%{A}" +label-disconnected = "%{A1:~/.config/berry/scripts/network_menu &:}Offline%{A}" ; Available tokens: ; %ifname% [wireless+wired] @@ -719,6 +719,17 @@ ramp-signal-font = 2 ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +[module/bluetooth] +type = custom/script +exec = ~/.config/berry/theme/polybar/scripts/bluetooth.sh +interval = 1 +tail = true +format =