diff --git a/home/user/.config/i3/config b/home/user/.config/i3/config index 3980a9e..90d147a 100644 --- a/home/user/.config/i3/config +++ b/home/user/.config/i3/config @@ -49,8 +49,10 @@ bindsym $mod+Return exec alacritty # kill focused window bindsym $mod+Shift+q kill -# start dmenu (a program launcher) -bindsym $mod+d exec --no-startup-id dmenu_run -i -b -p "Program to run: " -fn xft:FiraCode:size=$font_size +bindsym $mod+d exec --no-startup-id rofi -show drun +bindsym $mod+i exec --no-startup-id i3_switch_workspace.sh +bindsym $mod+o exec --no-startup-id slm_rofi.sh +bindsym $mod+p exec --no-startup-id power_rofi.sh # change focus bindsym $mod+h focus left @@ -173,7 +175,7 @@ mode $exitmode { bindsym e exit bindsym r exec reboot bindsym s exec shutdown -h now - bindsym u exec exec systemctl suspend; mode "default" + bindsym u exec systemctl suspend; mode "default" bindsym l exec $i3lock_cmd; mode "default" bindsym b exec convert canvas:none PNG:- | feh -YF -; mode "default" diff --git a/home/user/.config/rofi/config.rasi b/home/user/.config/rofi/config.rasi new file mode 100644 index 0000000..ce66d11 --- /dev/null +++ b/home/user/.config/rofi/config.rasi @@ -0,0 +1,7 @@ +configuration { + show-icons: true; + matching: "fuzzy"; + terminal: "alacritty"; + font: "xft:FiraCode 12"; +} +@theme "Arc-Dark" diff --git a/home/user/.local/bin/bluetooth b/home/user/.local/bin/bluetooth index 1d0232b..b1ecda7 100755 --- a/home/user/.local/bin/bluetooth +++ b/home/user/.local/bin/bluetooth @@ -1,6 +1,6 @@ #!/bin/sh -bssid="$(bluetoothctl devices | dmenu -b -p "Devices: " -l 20 | cut -d' ' -f2)" +bssid="$(bluetoothctl devices | rofi -dmenu -p "Devices: " -l 20 | cut -d' ' -f2)" exit_counter=0 until bluetoothctl connect "$bssid" diff --git a/home/user/.local/bin/i3_switch_workspace.sh b/home/user/.local/bin/i3_switch_workspace.sh new file mode 100755 index 0000000..2b5919b --- /dev/null +++ b/home/user/.local/bin/i3_switch_workspace.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +gen_workspaces() +{ + i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' +} + +choosed_workspace=$(gen_workspaces | rofi -dmenu -i -p "Select workspace") + +if [ -n "${choosed_workspace}" ] +then + i3-msg workspace "${choosed_workspace}" +fi diff --git a/home/user/.local/bin/killer b/home/user/.local/bin/killer index f647204..ca9b1fe 100755 --- a/home/user/.local/bin/killer +++ b/home/user/.local/bin/killer @@ -1,4 +1,4 @@ #!/bin/sh -pidd="$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | dmenu -i -l 15 | awk '{print $1}')" +pidd="$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | rofi -dmenu -i -l 15 | awk '{print $1}')" kill -15 "$pidd" diff --git a/home/user/.local/bin/power_rofi.sh b/home/user/.local/bin/power_rofi.sh new file mode 100755 index 0000000..1a451a1 --- /dev/null +++ b/home/user/.local/bin/power_rofi.sh @@ -0,0 +1,11 @@ +#!/bin/bash + + +eval "$(echo "i3-msg exit +reboot +shutdown -h now +systemctl suspend +i3lock -enf -c 1e1e1e +convert canvas:none PNG:- | feh -YF -" | rofi -dmenu -i -p "Power")" + + diff --git a/home/user/.local/bin/slm b/home/user/.local/bin/slm index 4a5b88b..c45d3e8 100755 --- a/home/user/.local/bin/slm +++ b/home/user/.local/bin/slm @@ -27,7 +27,7 @@ die_if_invalid_path() { cmd_list() { - ls "$LAYOUTS_DIR" + find "$LAYOUTS_DIR" -type f -exec basename -s .sh {} \; } cmd_edit() { diff --git a/home/user/.local/bin/slm_rofi.sh b/home/user/.local/bin/slm_rofi.sh new file mode 100755 index 0000000..81ff55e --- /dev/null +++ b/home/user/.local/bin/slm_rofi.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +choosed_screen_layout="$(slm ls | rofi -dmenu -i -p "Select screen layout")" +slm load "$choosed_screen_layout" diff --git a/home/user/.local/bin/wifi b/home/user/.local/bin/wifi index 8077ecd..bf7de6e 100755 --- a/home/user/.local/bin/wifi +++ b/home/user/.local/bin/wifi @@ -2,6 +2,6 @@ set -eo pipefail -bssid="$(nmcli -f BSSID,SSID,SIGNAL,RATE,BARS,SECURITY dev wifi list | sed -n '1!p' | dmenu -b -p "WiFi: " -l 20 | cut -d' ' -f1)" -pass="$(echo "" | dmenu -b -p "Password: ")" +bssid="$(nmcli -f BSSID,SSID,SIGNAL,RATE,BARS,SECURITY dev wifi list | sed -n '1!p' | rofi -dmenu -p "WiFi: " -l 20 | cut -d' ' -f1)" +pass="$(echo "" | rofi -dmenu -p "Password: ")" nmcli device wifi connect "$bssid" "password" "$pass" diff --git a/install b/install index ad643e8..aff3caf 100755 --- a/install +++ b/install @@ -20,7 +20,7 @@ declare -A TARGETS=( ["git"]=".config/git" ["ranger"]=".config/ranger" ["gpg"]="" - ["i3"]=".xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/picom .local/bin/slm .local/bin/wifi .local/bin/bluetooth" + ["i3"]=".xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/wifi .local/bin/bluetooth .local/bin/i3_switch_workspace.sh" ["bat"]=".config/bat" ["font"]="" ["termux"]=""