feat(rofi): power menu

This commit is contained in:
TheK4n 2023-11-20 13:29:57 +03:00
parent 6fb5909b35
commit 2d88a07309
6 changed files with 31 additions and 15 deletions

View File

@ -44,14 +44,15 @@ bindsym $mod+g exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Goto: '
focus_follows_mouse no focus_follows_mouse no
# start a terminal # start a terminal
bindsym $mod+Return exec alacritty --working-directory ~ bindsym $mod+Return exec alacritty
# kill focused window # kill focused window
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
bindsym $mod+d exec --no-startup-id rofi -show drun -show-icons bindsym $mod+d exec --no-startup-id rofi -show drun
bindsym $mod+i exec --no-startup-id ~/.local/bin/i3_switch_workspace.sh bindsym $mod+i exec --no-startup-id i3_switch_workspace.sh
bindsym $mod+n exec --no-startup-id ~/.local/bin/slm_rofi.sh bindsym $mod+o exec --no-startup-id slm_rofi.sh
bindsym $mod+p exec --no-startup-id power_rofi.sh
# change focus # change focus
bindsym $mod+h focus left bindsym $mod+h focus left
@ -174,7 +175,7 @@ mode $exitmode {
bindsym e exit bindsym e exit
bindsym r exec reboot bindsym r exec reboot
bindsym s exec shutdown -h now 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 l exec $i3lock_cmd; mode "default"
bindsym b exec convert canvas:none PNG:- | feh -YF -; mode "default" bindsym b exec convert canvas:none PNG:- | feh -YF -; mode "default"

View File

@ -1 +1,7 @@
configuration {
show-icons: true;
matching: "fuzzy";
terminal: "alacritty";
font: "xft:FiraCode 12";
}
@theme "Arc-Dark" @theme "Arc-Dark"

View File

@ -1,14 +1,13 @@
#!/bin/bash #!/bin/bash
function gen_workspaces() gen_workspaces()
{ {
i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g'
} }
choosed_workspace=$(gen_workspaces | rofi -dmenu -i -p "Select workspace")
WORKSPACE=$(gen_workspaces | rofi -dmenu -i -p "Select workspace") if [ -n "${choosed_workspace}" ]
if [ -n "${WORKSPACE}" ]
then then
i3-msg workspace "${WORKSPACE}" i3-msg workspace "${choosed_workspace}"
fi fi

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/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" kill -15 "$pidd"

View File

@ -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")"

View File

@ -1,5 +1,4 @@
#!/bin/bash
CHOOSED_SCREEN_LAYOUT="$(slm ls | rofi -dmenu -i -p "Select screen layout")" choosed_screen_layout="$(slm ls | rofi -dmenu -i -p "Select screen layout")"
slm load "$choosed_screen_layout"
slm load "$CHOOSED_SCREEN_LAYOUT"