Compare commits

...

2 commits

Author SHA1 Message Date
f9edc3e2cf
add more to ignore 2024-01-22 06:29:38 -06:00
248ec8fd26
add old qtile configs 2024-01-22 06:29:38 -06:00
35 changed files with 1601 additions and 2 deletions

View file

@ -3,12 +3,13 @@ bin/get-updates
bin/lock
.xinitrc
.xprofile
.zprofile
.config/alacritty
.config/wezterm
.config/leftwm
.config/autorandr
.config/pikaur.conf
.config/gtk-3.0
.config/vivaldi
.config/eww
.config/hypr
.config/rofi
{{- end }}

View file

@ -0,0 +1,10 @@
#!/bin/sh
if [ "$(bluetoothctl show | grep "Powered: yes" | wc -c)" -eq 0 ]; then
echo "󰂲"
else
if [ "$(bluetoothctl devices Connected | wc -c)" -eq 0 ]; then
echo ""
else
echo "󰂱"
fi
fi

View file

@ -0,0 +1,11 @@
#!/bin/sh
#source https://github.com/x70b1/polybar-scripts
#source https://github.com/polybar/polybar-scripts
if ! updates_arch=$(checkupdates 2>/dev/null | wc -l); then
updates_arch=0
fi
if [ $updates_arch -gt 0 ]; then
echo "Arch: $updates_arch"
fi

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
if ! updates_aur=$(($(pikaur -Qua 2>/dev/null | wc -l) - 1)); then
updates_aur=0
fi
if [ $updates_aur -gt 0 ]; then
echo "Aur: ${updates_aur}"
fi

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# nmcli -f IN-USE,SIGNAL,SSID device wifi | awk '/^\*/{if (NR!=1) {print $2}}'
# nmcli con show --active
get-network() {
nmcli --get-values name,type con show --active
}
wifi=$(get-network | grep "wireless")
ethernet=$(get-network | grep "ethernet")
if [[ -n $ethernet ]]; then
echo 'ethernet'
elif [[ -n $wifi ]]; then
echo $wifi | sed 's/:.*//'
fi

View file

@ -0,0 +1,86 @@
#!/usr/bin/env bash
# https://raw.githubusercontent.com/adi1090x/widgets/main/eww/arin/scripts/volume
# add commit info
# Get Volume
get_volume() {
status=$(pamixer --get-mute)
if [[ $status == "false" ]]; then
volume=$(pamixer --get-volume-human)
echo "$volume"
else
echo "Mute"
fi
}
# Get icons
get_icon() {
vol="$(get_volume)"
if [[ $vol == "Mute" ]]; then
echo "󰖁"
else
echo "󰕾"
fi
}
# Increase Volume
inc_volume() {
pamixer --increase 5
}
# Decrease Volume
dec_volume() {
pamixer --decrease 5
}
# Toggle Mute
toggle_mute() {
pamixer --toggle-mute
}
usage() {
cat <<HELP
volume [option]
--get returns the current volume [default flag]
--icon returns icon based on current volume
--inc increments volume by 5%
--dec decreases volumbe by 5%
--toggle toggle's mute status of volume
-h,--help print this page and exit
HELP
exit 0
}
[[ -z "$*" ]] && get_volume
for opt in "$@"; do
case $opt in
-h | --help)
usage
;;
--get)
get_volume
;;
--icon)
get_icon
;;
--inc)
inc_volume
;;
--dec)
dec_volume
;;
--toggle)
toggle_mute
;;
-*)
echo "Invalid option: $opt"
usage
;;
esac
done

View file

@ -0,0 +1,85 @@
import std/[os,net, json, sugar, enumerate, strformat, tables]
const NUM_WORKSPACES = 8
let icons = {
"[Running] - Oracle VM VirtualBox": "",
"Visual Studio Code": "",
"vivaldi-stable": "󰖟",
"LibreOffice": "",
"Geneious Prime": "󰚄",
"Firefox": "",
"- NVIM": "",
"Alacritty": "",
"- Wezterm": "",
}.toTable
type
HyprlandDefect* = Defect
Workspace = object
id, monitorID, windows: int
name, monitor, lastwindow, lastwindowtitle: string
hasfullscreen: bool
WorkspaceIcon = object
id: int
icon, class: string
ActiveWorkspace = object
id: int
name: string
Monitor = object
id: int
activeWorkspace: ActiveWorkspace
Client = object
workspace: ActiveWorkspace
class, title: string
proc getData(data: string): string =
let
his = getenv("HYPRLAND_INSTANCE_SIGNATURE")
socketPath = "/tmp/hypr" / his / ".socket.sock"
let socket = newSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)
try:
socket.connectUnix(socketPath)
except OSError:
raise newException(HyprlandDefect, "Could not connect to Hyprland IPC UNIX path; is Hyprland running?")
socket.send(data)
let response = socket.recv(4096)
socket.close() # is this necessary?
return response
proc getDefaultWorkspaces(): seq[WorkspaceIcon] =
let clients = parseJson(getData("[-j]/clients")).to(seq[Client])
result = collect(for i in 1..9: WorkspaceIcon(id: i, icon:"",class:fmt"ws-button-{i - 1}"))
for client in clients:
let match = icons.getOrDefault(client.class,"")
result[client.workspace.id - 1].icon &= match
for ws in result.mitems:
if ws.icon == "":
ws.icon = ""
proc getState(): seq[seq[WorkspaceIcon]] =
let monitors = parseJson(getData("[-j]/monitors")).to(seq[Monitor])
let workspaces = parseJson(getData("[-j]/workspaces")).to(seq[Workspace])
let defaultWorkspaces = getDefaultWorkspaces()
for monitor in monitors:
result.add defaultWorkspaces
result[monitor.id][monitor.activeWorkspace.id - 1].class &= " " & "ws-button-open"
when isMainModule:
while true:
sleep 500
echo (%* getState())

View file

@ -0,0 +1,124 @@
@use "sass:list";
@use "sass:math";
@import "scss/Catppuccin";
// todo: get rid of this
@import "/home/daylin/.config/qtile/colors/colors.scss";
* {
all: unset; //Unsets everything so you can style everything from scratch
}
$tag-palette: (
$lavender,
$flamingo,
$maroon,
$yellow,
$green,
$teal,
$blue,
$sky,
$rosewater,
);
// colors
$background: $black2;
$foreground: $white;
//$accent: list.nth($tag-palette,math.random(length($tag-palette)));
.debug {
background-color: $red;
border: 1px dashed;
}
//Global Styles
.bar {
color: $foreground;
padding: 2px 5px;
font-family:"FiraCode Nerd Font Propo";
font-size: 16px;
}
.panel {
margin: 5px;
background-color: $background;
border: 2px solid;
border-radius: 15px;
padding: 3px 10px;
border-color: $accent;
box-shadow: 1px 1px 3px $accent;
}
.ws-button {
border-style: solid;
padding:0px 10px;
border-radius: 5px;
}
.ws-button-active {
border-width: 2px;
}
.ws-button-open {
border-width: 0px 0px 2px;
border-style: solid;
}
// color each tag bubble from palette
@each $color in $tag-palette {
.ws-button-#{index($tag-palette,$color)} {
color:$color;
}
}
.workspaces {
padding: 0;
border-radius: 15px;
padding: 0 5px;
}
.active {
all: unset;
border-radius: 0;
padding-top: 0;
padding-bottom: 0;
}
.box-launcher {
background-color: $accent;
color: $background;
font-size: 1.1em;
font-weight: bold;
border-radius: 15px;
}
.button-launcher {
padding-left: 12px;
padding-right: 12px;
}
.clock {
margin-left: 10px;
margin-right: 20px;
}
.sysinfo {
margin-left: 10px;
margin-right: 10px;
}
.icon-ws-layout {
margin-right: 10px;
}
.update {
margin-right: 10px;
}
.separator {
margin: 0px 5px;
}

View file

@ -0,0 +1,3 @@
(include "./yuck/vars.yuck")
(include "./yuck/widgets.yuck")
(include "./yuck/windows.yuck")

View file

@ -0,0 +1,25 @@
/* ----- Catppuccin Colors ----- */
$rosewater: #F5E0DC;
$flamingo: #F2CDCD;
$mauve: #DDB6F2;
$pink: #F5C2E7;
$maroon: #E8A2AF;
$red: #F28FAD;
$peach: #F8BD96;
$yellow: #FAE3B0;
$green: #ABE9B3;
$teal: #B5E8E0;
$blue: #96CDFB;
$sky: #89DCEB;
$lavender: #C9CBFF;
$black0: #161320;
$black1: #1A1826;
$black2: #1E1E2E;
$black3: #302D41;
$black4: #575268;
$gray0: #6E6C7E;
$gray1: #988BA2;
$gray2: #C3BAC6;
$white: #D9E0EE;

View file

@ -0,0 +1,9 @@
(defvar rofi-bin "~/.config/rofi/bin")
(deflisten workspaces "nim c -r bin/hyprstate")
(defpoll clocktext :interval "10s" "date '+%d %b %I:%M %p'")
(defpoll bluetooth-icon :interval "5s" "bin/bluetooth.sh")
(defpoll volume-icon :interval "1s" "bin/volume --icon")
(defpoll volume-level :interval "1s" "bin/volume --get")
(defpoll ssid :interval "10s" "bin/getwifi")

View file

@ -0,0 +1,160 @@
;; Widgets
(defwidget launcher []
(box :class "box-launcher"
:orientation "h"
:hexpand false
(button :class "button-launcher"
:hexpand false
:onclick "${rofi-bin}/launcher.sh"
"")))
(defwidget powermenu []
(box :class "box-launcher"
:orientation "h"
(button :class "button-launcher"
:onclick "${rofi-bin}/powermenu.sh"
"󰐥")))
(defwidget volume []
(box :class "sysinfo"
:orientation "h"
:space-evenly "false"
(button
:onclick "bin/volume --toggle"
"${volume-icon} ")
(button
:onclick "bin/volume --inc"
:onrightclick "bin/volume --dec"
volume-level )))
(defwidget clock []
(box :class "clock"
:orientation "h"
:space-evenly "false"
(label
:text clocktext
:limit-width 40 )))
(defwidget battery []
(box :orientation "h"
(label :text '${EWW_BATTERY["BAT0"].status == "Discharging" ? "󰄌" : "󰚥"} ${EWW_BATTERY["BAT0"].capacity}%')
))
(defwidget ram []
(box :orientation "h"
(label :text "󰀹 ${round(EWW_RAM.used_mem_perc, 0)}% ")))
(defwidget cpu []
(box :orientation "h"
(label :text " ${round(EWW_CPU.avg, 0)}% ")))
(defwidget wifi []
(box :class "sysinfo"
:orientation "h"
(label :text '${ ssid=="ethernet" ? "󰈀" : ssid=="" ? "󰖪" : "󰖩"}'
:tooltip ssid)))
(defwidget bluetooth []
(box :class "sysinfo"
:orientation "h"
(button :onclick "${rofi-bin}/bluetooth.sh &"
bluetooth-icon)))
;(defwidget chord []
; (box :class "sysinfo"
; :visible "${wmstate.chord!=''}"
; (label :text " 󰌌 ${wmstate.chord}"
; ))
; )
; Composite Widgets
(defwidget sysinfo []
(box :class "sysinfo"
:orientation "h"
:space-evenly false
(ram)
(cpu)
(battery)
))
(defwidget workspaces [screen]
(box :class "workspaces panel"
:orientation "h"
:halign "start"
(workspaces-icons :screen screen)
))
(defwidget workspaces-icons [screen]
(box :class "workspaces"
:orientation "h"
:space-evenly false
:halign "center"
:valign "center"
(for ws in "${workspaces[screen]}"
(button
:class "ws-button ${ws.class}"
:onclick "hyprctl dispatch focusworkspaceoncurrentmonitor ${ws.id}"
"${ws.icon}"))))
(defwidget sep []
(box :class "separator"
(label :text "|")))
(defwidget sidestuff [?minimal]
(box :class "sidestuff panel"
:orientation "h"
:space-evenly false
:halign "end"
(box :visible {minimal ? false : true}
:space-evenly false
(bluetooth)
(sep)
(wifi)
(sep)
(volume))
(sep)
(clock)
(powermenu)))
(defwidget leftstuff [screen ?minimal]
(box :class "panel"
:orientation "h"
:halign "start"
:space-evenly false
(launcher)
(sysinfo)
; (ws-layout :screen screen)
;(box :visible {minimal ? false : true}
; :space-evenly false
; (sep)
; (sysinfo)
;; (chord)
;)
))
(defwidget leftstuffmin [screen]
(box :class "panel"
:orientation "h"
:halign "start"
:space-evenly false
(launcher)
(ws-layout :screen screen)))
(defwidget sidestuffmin []
(box :class "sidestuff panel"
:orientation "h"
:space-evenly false
:halign "end"
(clock)
(powermenu)))
(defwidget bar [screen ?minimal]
(centerbox :orientation "h"
:class "bar"
(leftstuff :screen screen :minimal minimal)
(workspaces :screen screen)
(sidestuff :minimal minimal)))

View file

@ -0,0 +1,41 @@
; Windows
(defwindow bar0
:monitor 0
:windowtype "dock"
:stacking "fg"
:exclusive true
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "40px"
:anchor "top center")
;:reserve (struts :side "top" :distance "45px")
(bar :screen 0 :minimal false)
)
(defwindow bar1
:monitor 1
:windowtype "dock"
:exclusive true
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "40px"
:anchor "top center")
;:reserve (struts :side "top" :distance "45px")
(bar :screen 1 :minimal false)
)
;(defwindow bar2
; :monitor 2
; :windowtype "dock"
; :geometry (geometry :x "0%"
; :y "0%"
; :width "100%"
; :height "40px"
; :anchor "top center")
; :reserve (struts :side "top" :distance "43px")
; (bar :screen 2 :minimal true)
;)

View file

@ -0,0 +1,83 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1
monitor=eDP-1,1920x1200,1920x0,1
monitor=DP-5,1920x1080,0x0,1
# Execute your favorite apps at launch
exec-once = eww open bar0 & eww open bar1 &
exec-once = hyprpaper &
# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
env = XDG_CURRENT_DESKTOP,sway # for flameshot
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = master
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 20
shadow_render_power = 2
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = off
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers
}
source = ./keys.conf
source = ./windows.conf

View file

@ -0,0 +1,5 @@
preload = ./wallpapers/ai/painted-landscape/00005-4229950720.png
preload = ./wallpapers/ai/painted-landscape/00006-2215131891.png
wallpaper = eDP-1, ./wallpapers/ai/painted-landscape/00005-4229950720.png
wallpaper = DP-5, ./wallpapers/ai/painted-landscape/00006-2215131891.png

View file

@ -0,0 +1,63 @@
$mainMod = SUPER
# Program binds
bind = $mainMod SHIFT, RETURN, exec, alacritty
bind = $mainMod, P, exec, ~/.config/rofi/bin/launcher.sh
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod, m, exit,
bind = $mainMod, f, togglefloating,
# Move focus with mainMod + hjkl
bind = $mainMod, h, movefocus, l
bind = $mainMod, j, movefocus, u
bind = $mainMod, k, movefocus, d
bind = $mainMod, l, movefocus, r
# Switch workspaces with mainMod + [1-9]
bind = $mainMod, 1, focusworkspaceoncurrentmonitor, 1
bind = $mainMod, 2, focusworkspaceoncurrentmonitor, 2
bind = $mainMod, 3, focusworkspaceoncurrentmonitor, 3
bind = $mainMod, 4, focusworkspaceoncurrentmonitor, 4
bind = $mainMod, 5, focusworkspaceoncurrentmonitor, 5
bind = $mainMod, 6, focusworkspaceoncurrentmonitor, 6
bind = $mainMod, 7, focusworkspaceoncurrentmonitor, 7
bind = $mainMod, 8, focusworkspaceoncurrentmonitor, 8
bind = $mainMod, 9, focusworkspaceoncurrentmonitor, 9
# Move active window to a workspace with mainMod + SHIFT + [1-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bind = $mainMod, R, submap, rofi
submap = rofi
bind = ,B, exec, ~/.config/rofi/bin/bluetooth.sh
bind = ,B, submap, reset
bind = ,W, exec, ~/.config/rofi/bin/windows.sh
bind = ,W, submap, reset
bind = ,P, exec, ~/.config/rofi/bin/powermenu.sh
bind = ,P, submap, reset
bind = ,escape, submap, reset
submap = reset

View file

@ -0,0 +1 @@
windowrulev2 = tile,class:(Vivaldi-stable)

View file

@ -0,0 +1,372 @@
#!/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)
# slightly modified for style and function by daylinmorgan
# Constants
divider="---------"
goback="Back"
styles="$(dirname $(which $0))/../styles"
rofi_cmd="rofi -theme $styles/bluetooth.rasi -dmenu -p"
# 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
else
if rfkill list bluetooth | grep -q 'blocked: yes'; then
rfkill unblock bluetooth && sleep 3
fi
bluetoothctl power on
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 &
notify-send -u low -t 5000 "Scanning disabled"
else
bluetoothctl scan on &
notify-send -u low -t 5000 "Scanning enabled"
sleep 5
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
notify-send -u low -t 5000 "Pairing disabled"
else
bluetoothctl pairable on
notify-send -u low -t 5000 "Pairing enabled"
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
notify-send -u low -t 5000 "Discoverable disabled"
else
bluetoothctl discoverable on
notify-send -u low -t 5000 "Discoverable enabled"
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
notify-send -u low -t 5000 "Disconnecting $1"
device_menu "$device"
else
bluetoothctl connect $1
notify-send -u low -t 5000 "Connecting $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"
notify-send -u low -t 5000 "Removing $1"
else
bluetoothctl pair $1
device_menu "$device"
notify-send -u low -t 5000 "Pairing $1"
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"
notify-send -u low -t 5000 "Untrusting $1"
else
bluetoothctl trust $1
device_menu "$device"
notify-send -u low -t 5000 "Trusting $1"
fi
}
# Prints a short string with the current bluetooth status
# Useful for status bars like polybar, etc.
print_status() {
if power_on; then
printf ''
mapfile -t paired_devices < <(bluetoothctl paired-devices | 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_cmd "$device_name")"
# Match chosen option to command
case $chosen in
"" | $divider)
echo "No option chosen."
;;
Exit)
exit
;;
$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
# # notify-send -u low -t 1000 -i "bluetooth" "main menu"
# # 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 -dmenu -theme $rofi_styles/bluetooth.rasi -no-fixed-num-lines -yoffset -100 -i -p "
while true; do
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=''
while read -r device; do
devices+="$device\n"
done < <(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
# 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
# devices has baked in trailing newline if it exists
options="$devices$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" &)"
chosen=$(echo -e $options | $rofi_cmd "Bluetooth")
# Match chosen option to command
case $chosen in
"" | $divider)
echo "No option chosen."
;;
Exit)
break
;;
$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
done

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
COLORSCRIPT="$HOME/.config/qtile/colors.py"
styles="$(dirname $(which $0))/../styles"
rofi -show color -modes "color:$COLORSCRIPT" -theme "$styles/launcher.rasi"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
styles="$(dirname $(which $0))/../styles"
rofi_command="rofi -theme $styles/confirm.rasi"
options="yes\nno"
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)"
echo "$chosen"

View file

@ -0,0 +1,66 @@
#!/usr/bin/env bash
style="$HOME/.config/qtile/rofi/styles/dqtile.rasi"
usage() {
echo "$(tput bold)dqtile-cmd$(tput sgr0)
A Rofi/dmenu interface to qtile cmd-obj. Accepts all arguments of qtile cmd-obj (see below).
"
qtile cmd-obj -h | sed "s/qtile cmd-obj/dqtile-cmd/"
echo "
If both rofi and dmenu are present rofi will be selected as default, to change this us --force-dmenu as the first argument.
"
exit
}
case $1 in
-h | --help) usage ;;
--force-dmenu)
FORCE_DMENU=1
shift
;;
esac
action=$(qtile cmd-obj $@)
# Path to menu application
if [[ -n $(command -v rofi) ]] && [[ -z "$FORCE_DMENU" ]]; then
menu="$(command -v rofi) -dmenu -columns 1 -theme $style"
global_mesg="Alt-1 Prompt for args and show function help (if -f is present)
.. Go back to menu.
C-u Clear input
Esc Exit"
action=$(echo -e "$action" | $menu -mesg "$global_mesg") # For rofi
elif [[ -n $(command -v dmenu) ]]; then
menu="cut -f 1 | sed -e 's/ *$//g' | $(command -v dmenu)"
action=$(echo -e "$action" | eval $menu) # For dmenu
else
echo >&2 "Rofi or dmenu not found"
exit
fi
action_info=$? # get the return code from rofi
action=$(echo "$action" | cut -f 1 | sed -e 's/ *$//g')
# if kb-mod-1 key was pressed in rofi
if [ "$action_info" -eq "10" ]; then
# only run when -f is present (then -i makes sense)
if [[ $action == *"-f"* ]]; then
info=$(qtile cmd-obj $action -i)
action=$($menu -mesg "$global_mesg
<b>Help</b>
$info" -filter "$action -a ")
fi
fi
case $action in
"") ;; # exit
..) $0 ;; # Go back to main menu
*) $0 "$action" ;;
esac

View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
styles="$(dirname $(which $0))/../styles"
rofi -show drun -show-icons -theme $styles/launcher.rasi

View file

@ -0,0 +1,79 @@
#!/usr/bin/env bash
styles="$(dirname $(which $0))/../styles"
rofi_command="rofi -theme $styles/powermenu.rasi"
#### Options ###
shutdown=""
reboot=""
lock=""
suspend=""
logout="󰗼"
options="$shutdown\n$reboot\n$lock\n$suspend\n$logout"
uptime=$(uptime | sed -e 's/up //g')
confirm_exit() {
"$(dirname $(which $0))/confirm.sh"
}
# Message
msg() {
rofi -theme "$styles/message.rasi" -e "Available Options - yes / y / no / n"
}
chosen="$(echo -e "$options" | $rofi_command -p "󱎫 $uptime " -dmenu -selected-row 2)"
case $chosen in
$lock)
if [[ -f $HOME/bin/lock ]]; then
$HOME/bin/lock
elif [[ -f /usr/bin/i3lock ]]; then
i3lock
elif [[ -f /usr/bin/dm-tool ]]; then
dm-tool "lock"
fi
;;
$shutdown)
ans=$(confirm_exit &)
if [[ $ans == "yes" ]]; then
systemctl poweroff
elif [[ $ans == "no" ]]; then
exit 0
else
msg
fi
;;
$reboot)
ans=$(confirm_exit &)
if [[ $ans == "yes" ]]; then
systemctl reboot
elif [[ $ans == "no" ]]; then
exit 0
else
msg
fi
;;
$suspend)
ans=$(confirm_exit &)
if [[ $ans == "yes" ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $ans == "no" ]]; then
exit 0
else
msg
fi
;;
$logout)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "y" ]]; then
loginctl terminate-session ${XDG_SESSION_ID-}
elif [[ $ans == "no" || $ans == "n" ]]; then
exit 0
else
msg
fi
;;
esac

View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
styles="$(dirname $(which $0))/../styles"
rofi -show ssh -theme $styles/launcher.rasi -disable-history -no-parse-known-hosts

View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
styles="$(dirname $(which $0))/../styles"
rofi -show window -theme $styles/windows.rasi

View file

@ -0,0 +1,32 @@
@import "default.rasi"
@import "colors.rasi"
mainbox {
padding: 12px;
}
inputbar {
background-color: @background;
border-color: @primary;
border: 2px;
border-radius: 4px;
padding: 8px 16px;
spacing: 8px;
children: [ prompt, entry ];
}
entry {
placeholder: "search";
}
listview {
margin: 12px 0 0;
lines: 8;
columns: 1;
fixed-height: false;
}
element {
padding: 8px 16px;
border-radius: 4px;
}

View file

@ -0,0 +1,13 @@
@import "~/.config/qtile/colors/colors.rasi"
/* default colors */
* {
background: #1E1E2E;
background-light:#313244;
background-dark: #11111b;
foreground: #cdd6f4;
foreground-light: #6c7086;
border-color: @bordercolor;
primary: var(theme-primary, #fab387);
}

View file

@ -0,0 +1,46 @@
@import "default.rasi"
@import "colors.rasi"
configuration {
disable-history: false;
sidebar-mode: false;
show-icons: false;
}
window {
width: 500px;
}
listview {
columns: 2;
lines: 1;
spacing: 12px;
cycle: true;
layout: vertical;
}
textbox-custom {
expand: false;
content: "Are you Sure?";
padding: 10px;
border: 2px;
border-radius: 10px;
border-color:@primary;
}
mainbox {
orientation: horizontal;
children: [ textbox-custom,listview ];
spacing: 20px;
margin: 20px;
}
element {
background-color: @background-light;
border-radius: 4px;
}
element-text {
horizontal-align: 0.5;
margin: 10px 5px;
}

View file

@ -0,0 +1,55 @@
* {
small-font: "FiraCode Nerd Font Propo 12";
big-font: "FiraCode Nerd Font Propo 50";
font: @small-font;
background-color: transparent;
text-color: @foreground;
margin: 0px;
padding: 0px;
spacing: 0px;
}
window {
border-radius: 4px;
location: center;
width: 30%;
background-color: @background;
border: 2px;
border-color:@theme-primary;
}
inputbar {
background-color: @background;
border-color: @primary;
border: 2px;
border-radius: 4px;
padding: 8px 16px;
spacing: 8px;
children: [ prompt, entry ];
}
prompt {
text-color: @foreground;
}
entry {
placeholder-color: @foreground-light;
}
element selected,
element selected normal,
element selected active {
text-color: @background;
background-color: @primary;
}
element-text {
text-color: inherit;
}
element-icon {
size: 1em;
vertical-align: 0.5;
}

View file

@ -0,0 +1,38 @@
@import "default.rasi"
@import "colors.rasi"
window {
border-radius: 4px;
location: center;
width: 60%;
background-color: @background;
border: 2px;
border-color:@theme-primary;
}
// TODO: add dotted item seperator?
mainbox {
padding: 12px;
}
entry {
placeholder-color: @foreground-light;
}
listview {
lines: 20;
fixed-height: false;
}
element {
padding: 2px 16px;
spacing: 8px;
border-radius: 4px;
}
element-icon {
size: 1em;
vertical-align: 0.5;
}

View file

@ -0,0 +1,48 @@
@import "default.rasi"
@import "colors.rasi"
window {
width: 50%;
}
inputbar {
border: 0 0 1px 0;
children: [prompt, entry];
}
prompt {
padding: 10px;
background-color: @primary;
text-color: @background;
font-weight: bold;
border: 0 1px 0 0;
}
textbox {
padding: 8px 16px;
}
entry {
padding: 10px;
}
listview {
cycle: false;
margin: 10 10 10 10;
scrollbar: false;
}
element {
border: 1;
padding: 5px;
}
element-text {
background-color: inherit;
text-color: inherit;
}
element selected {
background-color: @primary;
text-color: @background;
}

View file

@ -0,0 +1,29 @@
@import "default.rasi"
@import "colors.rasi"
mainbox {
padding: 12px;
}
entry {
placeholder: "search";
placeholder-color: @foreground-light;
}
listview {
margin: 12px 0 0;
lines: 8;
columns: 1;
fixed-height: false;
}
element {
padding: 8px 16px;
spacing: 8px;
border-radius: 4px;
}
element-icon {
size: 1em;
vertical-align: 0.5;
}

View file

@ -0,0 +1,8 @@
/* Confirm Dialog */
@import "default.rasi"
@import "colors.rasi"
window {
padding: 25px;
}

View file

@ -0,0 +1,50 @@
@import "default.rasi"
@import "colors.rasi"
configuration {
disable-history: false;
sidebar-mode: false;
show-icons: false;
}
window {
width: 800px;
}
prompt {
enabled: true;
padding: 10px;
background-color: @background-dark;
text-color: @primary;
border: 0px 2px 0px 2px;
border-radius: 10px;
border-color: @primary;
}
listview {
columns: 5;
lines: 1;
spacing: 12px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
children: [ prompt, listview ];
spacing: 20px;
margin: 20px;
}
element {
background-color: @background-dark;
border-radius: 10px;
}
element-text {
font: @big-font;
background-color: inherit;
text-color: inherit;
horizontal-align: 0.5;
margin: 20px;
}

View file

@ -0,0 +1,7 @@
@import "default.rasi"
@import "colors.rasi"
@import "launcher.rasi"
window {
width: 60%;
}