Added power menu with Rofi
This commit is contained in:
@@ -10,6 +10,35 @@
|
||||
# layout, use the i3-config-wizard
|
||||
#
|
||||
|
||||
# use these keys for focus, movement, and resize directions when reaching for
|
||||
# the arrows is not convenient
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
set $term 'alacritty'
|
||||
set $editor 'emacs'
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
###############################################################
|
||||
###############################################################
|
||||
################## LOOK AND FEEL ##################
|
||||
###############################################################
|
||||
###############################################################
|
||||
|
||||
# Import Catppuccin theme defined colors
|
||||
set $rosewater #f5e0dc
|
||||
set $flamingo #f2cdcd
|
||||
@@ -49,9 +78,6 @@ client.background $base
|
||||
# Setting cursor
|
||||
# seat seat0 xcursor_theme catppuccin-mocha-lavender-cursors 25
|
||||
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font pango:Noto Sans Regular 10
|
||||
@@ -60,58 +86,18 @@ font pango:Noto Sans Regular 10
|
||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||
#font pango:DejaVu Sans Mono 8
|
||||
|
||||
# Start XDG autostart .desktop files using dex. See also
|
||||
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
||||
exec --no-startup-id dex --autostart --environment i3
|
||||
|
||||
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
|
||||
# they are included here as an example. Modify as you see fit.
|
||||
|
||||
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
||||
# screen before suspend. Use loginctl lock-session to lock your screen.
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||
|
||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||
exec --no-startup-id nm-applet
|
||||
|
||||
# Polkit Authentication agent
|
||||
exec --no-startup-id /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
set $refresh_i3status killall -SIGUSR1 i3status
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% # && $refresh_i3status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% # && $refresh_i3status
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # && $refresh_i3status
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle # && $refresh_i3status
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-
|
||||
bindsym $mod+Mod1+l exec ~/.config/i3/scripts/lockscreen.sh
|
||||
|
||||
# use these keys for focus, movement, and resize directions when reaching for
|
||||
# the arrows is not convenient
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
# use Mouse+Mod4 to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# move tiling windows via drag & drop by left-clicking into the title bar,
|
||||
# or left-clicking anywhere into the window while holding the floating modifier.
|
||||
tiling_drag modifier titlebar
|
||||
|
||||
set $term 'alacritty'
|
||||
set $browser 'firefox'
|
||||
set $editor 'emacs'
|
||||
|
||||
# Windows configuration
|
||||
default_border pixel 3
|
||||
default_floating_border pixel 3
|
||||
gaps inner 5
|
||||
gaps outer 5
|
||||
|
||||
###############################################################
|
||||
###############################################################
|
||||
################## WORKSPACES ##################
|
||||
###############################################################
|
||||
###############################################################
|
||||
|
||||
# Floating/sticky windows
|
||||
for_window [class="Pop-up"] floating enable
|
||||
for_window [class="Bubble"] floating enable
|
||||
@@ -127,29 +113,65 @@ for_window [class="Webconsole"] floating enable
|
||||
for_window [class="Authy"] floating enable
|
||||
for_window [class="Termfloat"] floating enable, resize set 960 540
|
||||
for_window [class="Mpv"] floating enable, resize set 960 540
|
||||
for_window [class="Spotify"] floating enable, move scratchpad
|
||||
|
||||
# Workspaces
|
||||
assign [class="Emacs"] 1
|
||||
assign [class="Firefox"] 2 # FIXME: change class name
|
||||
assign [class="firefox"] 2
|
||||
assign [class="Telegram"] 3
|
||||
|
||||
focus_follows_mouse no
|
||||
|
||||
###############################################################
|
||||
###############################################################
|
||||
################## KEYBINDINGS ##################
|
||||
###############################################################
|
||||
###############################################################
|
||||
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# start default menu application
|
||||
bindsym $mod+d exec "rofi -show drun"
|
||||
bindsym $mod+Shift+s exec "rofi -show ssh"
|
||||
bindsym $mod+Shift+w exec "rofi -show window"
|
||||
bindsym $mod+Shift+f exec "rofi -show filebrowser"
|
||||
# define mode for launcher
|
||||
mode "launcher" {
|
||||
bindsym d exec "rofi -show drun"
|
||||
bindsym s exec "rofi -show ssh"
|
||||
bindsym w exec "rofi -show window"
|
||||
bindsym f exec "rofi -show filebrowser"
|
||||
bindsym q exec ~/.config/i3/scripts/poweroff.sh
|
||||
|
||||
bindsym $mod+Shift+b exec $browser
|
||||
bindsym $mod+d mode "default"
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+d mode "launcher"
|
||||
|
||||
bindsym $mod+Shift+b exec "flatpak run org.mozilla.firefox"
|
||||
bindsym $mod+Shift+t exec "flatpak run org.telegram.desktop"
|
||||
bindsym Print exec flameshot gui
|
||||
# bindsym $mod+Shift+v exec xfce4-clipman-history
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-
|
||||
bindsym $mod+Mod1+l exec ~/.config/i3/scripts/lockscreen.sh
|
||||
|
||||
# use Mouse+Mod4 to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# move tiling windows via drag & drop by left-clicking into the title bar,
|
||||
# or left-clicking anywhere into the window while holding the floating modifier.
|
||||
tiling_drag modifier titlebar
|
||||
|
||||
# change focus
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
@@ -175,7 +197,7 @@ bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# split in horizontal orientation
|
||||
# bindsym $mod+h split h
|
||||
bindsym Mod1+h split h
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
@@ -198,7 +220,7 @@ bindsym $mod+space focus mode_toggle
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindsym Mod4+d focus child
|
||||
bindsym Mod1+d focus child
|
||||
|
||||
# move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
@@ -207,19 +229,6 @@ bindsym $mod+Shift+minus move scratchpad
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace number $ws1
|
||||
bindsym $mod+2 workspace number $ws2
|
||||
@@ -252,7 +261,7 @@ bindsym $mod+Shift+c reload
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
bindsym $mod+Shift+e exec ~/.config/i3/scripts/poweroff.sh
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
mode "resize" {
|
||||
@@ -281,23 +290,29 @@ mode "resize" {
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||
# finds out, if available)
|
||||
# bar {
|
||||
# status_command i3bar
|
||||
# }
|
||||
###############################################################
|
||||
###############################################################
|
||||
################## AUTOSTART ##################
|
||||
###############################################################
|
||||
###############################################################
|
||||
|
||||
#######################################################################
|
||||
# automatically start i3-config-wizard to offer the user to create a
|
||||
# keysym-based config which used their favorite modifier (alt or windows)
|
||||
#
|
||||
# i3-config-wizard will not launch if there already is a config file
|
||||
# in ~/.config/i3/config (or $XDG_CONFIG_HOME/i3/config if set) or
|
||||
# ~/.i3/config.
|
||||
#
|
||||
# Please remove the following exec line:
|
||||
#######################################################################
|
||||
# exec i3-config-wizard
|
||||
# Start XDG autostart .desktop files using dex. See also
|
||||
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
||||
exec --no-startup-id dex --autostart --environment i3
|
||||
|
||||
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
|
||||
# they are included here as an example. Modify as you see fit.
|
||||
|
||||
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
||||
# screen before suspend. Use loginctl lock-session to lock your screen.
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||
|
||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||
exec --no-startup-id nm-applet
|
||||
|
||||
# Polkit Authentication agent
|
||||
exec --no-startup-id /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
|
||||
|
||||
### Apply wallpaper
|
||||
exec_always feh --bg-scale ~/.config/i3/wallpaper.jpg
|
||||
@@ -314,5 +329,8 @@ exec_always $notification
|
||||
### Enable autolock
|
||||
exec_always xautolock -time 5 -locker ~/.config/i3/scripts/lockscreen.sh -detectsleep
|
||||
|
||||
### Screenshot tool
|
||||
### Run screenshot tool
|
||||
exec flameshot
|
||||
|
||||
### Run my preferred editor
|
||||
exec $editor
|
||||
|
||||
13
i3/.config/i3/scripts/poweroff.sh
Executable file
13
i3/.config/i3/scripts/poweroff.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Menu di power con rofi
|
||||
chosen=$(echo -e "⏻ Spegni\n Riavvia\n Logout\n Sospendi\n Iberna" | rofi -dmenu -p "Power Menu:" -theme-str 'window {width: 20%;}')
|
||||
|
||||
case "$chosen" in
|
||||
"⏻ Spegni") systemctl poweroff ;;
|
||||
" Riavvia") systemctl reboot ;;
|
||||
" Logout") loginctl terminate-session $XDG_SESSION_ID ;;
|
||||
" Sospendi") systemctl suspend ;;
|
||||
" Iberna") systemctl hibernate ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user