This commit is contained in:
Kopatz
2024-06-03 18:25:20 +02:00
parent de415c09a9
commit 3e21d41ff0
43 changed files with 3004 additions and 31 deletions

438
.config/i3/config Normal file
View File

@@ -0,0 +1,438 @@
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
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:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# 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@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $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 XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
# Use Mouse+$mod 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
# start a terminal
bindsym $mod+q exec kitty
bindsym $mod+e exec dolphin
bindsym Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
# kill focused window
bindsym $mod+c kill
#####################################
# Application menu handled by rofi: #
#####################################
## rofi bindings fancy application menu ($mod+d /F9 optional disabled)
bindsym $mod+space exec --no-startup-id rofi -modi drun -show drun \
-config ~/.config/rofi/rofidmenu.rasi
#bindsym F9 exec --no-startup-id rofi -modi drun -show drun \
# -config ~/.config/rofi/rofidmenu.rasi
## rofi bindings for window menu ($mod+t /F10 optional disabled)
bindsym $mod+a exec --no-startup-id rofi -show window \
-config ~/.config/rofi/rofidmenu.rasi
#bindsym F10 exec --no-startup-id rofi -show window \
# -config ~/.config/rofi/rofidmenu.rasi
## rofi bindings to manage clipboard (install rofi-greenclip from the AUR)
#exec --no-startup-id greenclip daemon>/dev/null
#bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \
# -config ~/.config/rofi/rofidmenu.rasi
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+n split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+s layout stacking
bindsym $mod+Shift+w layout tabbed
bindsym $mod+Shift+e layout toggle split
# toggle tiling / floating
bindsym $mod+v floating toggle
# change focus between tiling / floating windows
#bindsym $mod+space focus mode_toggle
# focus the parent container
#bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# 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
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
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+q 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'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}
##############################
# extra options for windows: #
##############################
default_border pixel 1
# Set inner/outer gaps
gaps inner 2
gaps outer 0
# show window title bars (not officially supported with i3gaps)
#default_border normal
default_border pixel 2
# window title alignment
#title_align center
##############
# compositor #
##############
# transparency
# uncomment one of them to be used
# options could need changes, related to used GPU and drivers.
# to find the right setting consult the archwiki or ask at the forum.
#
# xcompmgr: https://wiki.archlinux.org/title/Xcompmgr
# manpage: https://man.archlinux.org/man/xcompmgr.1.en
# install xcompmgr package to use it (yay -S xcompmgr)
#exec --no-startup-id xcompmgr -C -n &
# or an more specialized config like this:
#exec --no-startup-id xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &
#
# or:
#
# picom: https://wiki.archlinux.org/title/Picom
# manpage: https://man.archlinux.org/man/picom.1.en
# The default configuration is available in /etc/xdg/picom.conf
# For modifications, it can be copied to ~/.config/picom/picom.conf or ~/.config/picom.conf
# install picom package (yay -S picom)
# start using default config
#exec_always --no-startup-id picom -b
#
# for custom config:
#exec --no-startup-id picom --config ~/.config/picom/picom.conf
#############################################
# autostart applications/services on login: #
#############################################
exec_always autotiling
#fix monitor layout
exec --no-startup-id "xrandr --output HDMI-0 --left-of DP-0 && xrandr --output DP-0 --mode 2560x1440 --rate 165.00"
# 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_always --no-startup-id nm-tray
#exec --no-startup-id nm-applet
#get auth work with polkit-gnome
#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# dex execute .desktop files + apps using /etc/xdg/autostart.
# when second to i3 a DE is installed or mixed usage of i3 + xfce4 or GNOME
# in this cases better disable dex and use manual starting apps using xdg/autostart
# if enabled you should comment welcome app.
# https://github.com/jceb/dex
#exec --no-startup-id dex -a -s /etc/xdg/autostart/:~/.config/autostart/
#exec --no-startup-id dex --autostart --environment i3
#exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# start welcome app
#exec --no-startup-id sh /usr/share/endeavouros/scripts/welcome --startdelay=3
# num lock activated
#exec --no-startup-id numlockx on
# configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example)
#exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle'
# start conky:
#exec_always --no-startup-id conky
# start a script to setup displays
# uncomment the next line, use arandr to setup displays and save the file as monitor:
#exec --no-startup-id ~/.screenlayout/monitor.sh
# set wallpaper
# exec --no-startup-id sleep 2 && nitrogen --restore
exec_always --no-startup-id sleep 1 && feh --bg-fill $HOME/.config/wallpapers/yuyukowallpaper.png
# set powersavings for display:
# exec --no-startup-id xset s 480 dpms 600 600 600
#exec --no-startup-id xset s off
# disable power saving (for example if using xscreensaver)
#exec --no-startup-id xset -dpms
#blur enable
#blur_xray enable
#blur_passes 2
#blur_radius 5
# use xautolock to use autosuspend rules for mobile devices
# https://wiki.archlinux.org/title/Session_lock#xautolock
#exec --no-startup-id xautolock -time 60 -locker "systemctl suspend"
# xscreensaver
# https://www.jwz.org/xscreensaver
#exec --no-startup-id xscreensaver --no-splash
# Desktop notifications
# dunst config used ~/.config/dunst/dunstrc
# set alternative config if needed:
#exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc
# may need to run dbus-launch explicitly:
#exec --no-startup-id dbus-launch /usr/bin/dunst
#exec --no-startup-id /usr/bin/env dunst
# alternative if you installed aside with XFCE4:
# exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd &
# autotiling script
# https://github.com/nwg-piotr/autotiling
# `yay -S autotiling ;) (it is in AUR)
#exec_always --no-startup-id autotiling
# Autostart apps as you like
#exec --no-startup-id sleep 2 && xfce4-terminal
#exec --no-startup-id sleep 7 && firefox https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md
#exec --no-startup-id sleep 3 && thunar
###############
# system tray #
###############
# if you do not use dex: exec --no-startup-id dex --autostart --environment i3
# you need to have tray apps started manually one by one:
# start blueberry app for managing bluetooth devices from tray:
#exec_always --no-startup-id blueberry-tray
# networkmanager-applet
# clipman-applet
#exec --no-startup-id xfce4-clipman
######################################
# color settings for bar and windows #
######################################
# Define colors variables:
set $darkbluetrans #313244
set $darkblue #b4befe
set $lightblue #eba0ac
#set $urgentred #e53935
set $urgentred #f38ba8
set $white #cdd6f4
set $black #1e1e2e
set $purple #6870A1
set $darkgrey #383c4a
set $grey #b0b5bd
set $mediumgrey #8b8b8b
set $yellowbrown #e1b700
# define colors for windows:
#class border bground text indicator child_border
client.focused $darkblue $black $white $darkblue $darkblue
client.unfocused $purple $black $grey $darkgrey $darkgrey
client.focused_inactive $black $black $grey $darkgrey $darkgrey
client.urgent $urgentred $urgentred $white $darkblue $yellowbrown
############################################
# bar settings (input comes from i3blocks) #
############################################
# Start i3bar to display a workspace bar
# (plus the system information i3status finds out, if available)
#bar {
#id bar-primary
#mode dock
# font pango: FiraCode Nerd Font medium 11.3
# status_command i3blocks -c ~/.config/i3/i3blocks.conf
# position top
## i3bar_command i3bar --transparency
## it could be that you have no primary display set: set one (xrandr --output <output> --primary)
## reference: https://i3wm.org/docs/userguide.html#_tray_output
##tray_output primary
##tray_output none
#tray_output none
## When strip_workspace_numbers is set to yes,
## any workspace that has a name of the form
## “[n][:][NAME]” will display only the name.
#strip_workspace_numbers yes
###strip_workspace_name no
#
# colors {
# separator $purple
# # background $darkgrey
# background #1e1e2eD9
# statusline $white
## border bg txt
# focused_workspace #1e1e2eD9 #1e1e2eD9 #b4befe
# active_workspace #1e1e2eD9 #1e1e2eD9 #a6adc8
# inactive_workspace #1e1e2eD9 #1e1e2eD9 #7f849c
# urgent_workspace #1e1e2eD9 #1e1e2eD9 #a6e3a1
#
# }
#}
#
#bar {
#id bar-tray
#mode invisible
# font pango: FiraCode Nerd Font medium 11.3
# status_command i3blocks -c ~/.config/i3/i3blocks.conf
# position top
##modifier none
## i3bar_command i3bar --transparency
## it could be that you have no primary display set: set one (xrandr --output <output> --primary)
## reference: https://i3wm.org/docs/userguide.html#_tray_output
##tray_output primary
#
## When strip_workspace_numbers is set to yes,
## any workspace that has a name of the form
## “[n][:][NAME]” will display only the name.
#strip_workspace_numbers yes
###strip_workspace_name no
#
# colors {
# separator $purple
# # background $darkgrey
# background #1e1e2eD9
# statusline $white
## border bg txt
# focused_workspace #1e1e2eD9 #1e1e2eD9 #cdd6f4
# active_workspace #1e1e2eD9 #1e1e2eD9 #a6adc8
# inactive_workspace #1e1e2eD9 #1e1e2eD9 #7f849c
# urgent_workspace #1e1e2eD9 #1e1e2eD9 #a6e3a1
# }
#}
#bindsym $mod+p bar mode dock bar-tray; bar mode invisible bar-primary

184
.config/i3/i3blocks.conf Normal file
View File

@@ -0,0 +1,184 @@
# File configurazione i3block
separator=false
markup=pango
separator_block_width=6
color=#cdd6f4
[search]
full_text= 󰍉
color=#f38ba8
command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi
#[files]
#full_text= 
#color=#cba6f7
#command=i3-msg -q exec thunar ~/
[todo]
full_text= 
color=#89b4fa
command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo
[wallpaper]
full_text=󰸉
color=#fab387
command=~/.config/i3/scripts/miei/wallpaper.sh
[expander]
full_text= 
command=i3-msg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh"
color=#b4befe
[terminal]
full_text= 
color=#94e2d5
command=i3-msg -q exec kitty
[close]
full_text= 󰅙
color=#f38ba8
command=i3-msg -q kill
separator_block_width=0
[simple-2]
full_text=:
color=#717171
#[meteo]
#command=~/.config/i3/scripts/miei/meteo.sh
#interval=1000
[separator]
full_text="⟨"
color=#585b70
#[update]
#full_text=
#command=~/.config/i3/scripts/miei/update.sh
#interval=1800
[separator]
full_text="⟨"
color=#585b70
[cpu_usage]
full_text=
label=
command=~/.config/i3/scripts/miei/cpu.sh
interval=10
#[separator]
#full_text="⟨"
#color=#585b70
#[news]
#full_text=""
#command=~/.config/i3/scripts/miei/feed.sh
#interval=once
[separator]
full_text="⟨"
color=#585b70
#[pavucontrol]
#full_text=
#command=pavucontrol
[volume-pulseaudio]
command=~/.config/i3/scripts/volume
instance=Master
interval=1
#[timer]
#full_text=
#command=~/.config/i3/scripts/miei/timer.sh
#interval=1
[separator]
full_text="⟨"
color=#585b70
[pomodoro]
command=~/.config/i3/scripts/pomodoro.sh
interval=1
[separator]
full_text="⟨"
color=#585b70
#[gestione_energia]
#full_text=
#command=/home/flavio/.config/i3/scripts/miei/energia.sh
#interval=once
[separator]
full_text="⟨"
color=#585b70
#[battery]
#command=~/.config/i3/scripts/battery2
#label=
#interval=30
#[separator]
#full_text="|"
#[separator]
#full_text="|"
#color=#585b70
[icona]
full_text=󰁹
#[battery]
#command=~/.config/i3/scripts/miei/power.sh
#label=
#interval=1
[separator]
full_text="⟨"
color=#585b70
[time]
full_text=
label=
interval=1
command=~/.config/i3/scripts/miei/ora.sh
separator_block_width=10
color=#b4befe
#color=#f38ba8
[separator]
full_text=" "
separator_block_width=0
background=#272836
[shutdown_menu]
full_text=<span size="medium"> ⏼ </span>
#full_text=<span size="medium"> ⏼ </span>
command=~/.config/i3/scripts/powermenu
#color=#b4befe
#color=#f5e0dc
#background=#e71853
background=#313244
#separator_block_width=0
#color=#f38ba8
separator_block_width=0

BIN
.config/i3/scripts/bell.wav Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
PICTURE=/tmp/i3lock.png
SCREENSHOT="scrot -z $PICTURE"
BLUR="5x4"
$SCREENSHOT
convert $PICTURE -blur $BLUR $PICTURE
i3lock -i $PICTURE
rm $PICTURE

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
if [ -f /tmp/tray ]; then
var=$(cat /tmp/tray)
if [ $var == 1 ]; then
echo 0 > /tmp/tray
i3-msg -q "bar mode dock bar-tray"
i3-msg -q "bar mode invisible bar-primary"
fi
if [ $var == 0 ]; then
echo 1 > /tmp/tray
i3-msg -q "bar mode invisible bar-tray"
i3-msg -q "bar mode dock bar-primary"
fi
else
echo 0 > /tmp/tray
i3-msg -q "bar mode dock bar-tray"
i3-msg -q "bar mode invisible bar-primary"
fi

6
.config/i3/scripts/miei/cpu.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [ $BLOCK_BUTTON == 1 ]; then
kitty -e htop
fi
echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
a=0
path=~/.config/i3/scripts/miei/energia.sh
if [ $BLOCK_BUTTON == 1 ]
then
if [ $a == 0 ]
then
sed -i '2d' $path
sed -i '2ia=1' $path
a=1
else
sed -i '2d' $path
sed -i '2ia=0' $path
a=0
fi
fi
if [ $a == 1 ]; then
echo " Pro"
powerprofilesctl set balanced
fi
if [ $a == 0 ]; then
echo " Eco"
powerprofilesctl set power-saver
fi

29
.config/i3/scripts/miei/feed.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
a=0
path=~/.config/i3/scripts/miei/feed.sh
if [ $BLOCK_BUTTON == 1 ]
then
if [ $a == 0 ]
then
sed -i '2d' $path
sed -i '2ia=1' $path
a=1
else
sed -i '2d' $path
sed -i '2ia=0' $path
a=0
fi
fi
if [ $a == 1 ]
then
echo "$(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=</a>)')"
else
echo "󰈙 News"
fi
if [ $BLOCK_BUTTON == 3 ]; then
xdg-open https://www.lescienze.it/news/
fi

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# quando lo clicco mi ricarica il dispositivo fino al 100% e poi disabilita la feature
path="/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/VPC2004:00/conservation_mode"
value=$(cat $path)
if [ $value -eq "" ];then
echo "only ideapad"
fi
level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
if [ $BLOCK_BUTTON -eq 1 ] && [ $value -eq "1" ];then
echo "󱟡 full"
echo $PASSW | sudo -S sh -c "echo 0 > $path"
fi
if [ $level -ge "95" ] && [ $value -eq "0" ];then
echo "󱈑 Csv"
echo $PASSW | sudo -S sh -c "echo 1 > $path"
fi
if [ $value -eq 0 ];then
echo "󱟡 full"
else
echo "󱈑 Csv"
fi

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
meteo=$(curl wttr.in/Sedriano?format=1| xargs echo)
first="${meteo%% *}"
if [ "$meteo" == "" ] || [ "$first" == "Unknown" ]; then
echo " Off"
else
echo $meteo
fi

33
.config/i3/scripts/miei/ora.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/bash
a=1
path=~/.config/i3/scripts/miei/ora.sh
cambia_var () {
if [ $a == 0 ]; then
sed -i '2d' $path
sed -i '2ia=1' $path
# se non mostri la variabile subito ci sarà il delay di interval
a=1
return 1
fi
if [ $a == 1 ]; then
sed -i '2d' $path
sed -i '2ia=0' $path
a=0
return 0
fi
}
if [ $BLOCK_BUTTON == 1 ]; then
cambia_var
fi
if [ $a == 0 ]; then
date '+%a %d %b %H:%M'
fi
if [ $a == 1 ]; then
date '+%H:%M'
fi

View File

@@ -0,0 +1,52 @@
#!/usr/bin/bash
#echo " 󰣐 󰣐 󰣐 󰣐 󰋔 "
#echo ""
#echo "#a6e3a1"
#
if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then
~/.config/i3/scripts/miei/power_charge.sh
exit 1
fi
level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
unit=20
vite=$(($level/unit))
if [ $vite == 5 ]; then
echo ""
echo ""
echo "#cdd6f4"
fi
if [ $vite == 4 ]; then
echo ""
echo ""
echo "#a6e3a1"
fi
if [ $vite == 3 ]; then
echo ""
echo ""
echo "#a6e3a1"
fi
if [ $vite == 2 ]; then
echo ""
echo ""
echo "#fab387"
fi
if [ $vite == 1 ]; then
echo ""
echo ""
echo "#fab387"
fi
if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
echo ""
echo ""
echo "#f38ba8"
fi
if [ "$level" -lt "10" ]; then
echo "!"
echo ""
echo "#f38ba8"
fi

View File

@@ -0,0 +1,47 @@
#!/usr/bin/bash
#echo " 󰣐 󰣐 󰣐 󰣐 󰋔 "
#echo ""
#echo "#a6e3a1"
# 󰁹󱐋
level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
unit=20
vite=$(($level/unit))
if [ $vite == 5 ]; then
echo "󱐋 "
echo ""
echo "#cdd6f4"
fi
if [ $vite == 4 ]; then
echo "󱐋 "
echo ""
echo "#a6e3a1"
fi
if [ $vite == 3 ]; then
echo "󱐋 "
echo ""
echo "#a6e3a1"
fi
if [ $vite == 2 ]; then
echo "󱐋 "
echo ""
echo "#fab387"
fi
if [ $vite == 1 ]; then
echo "󱐋 "
echo ""
echo "#fab387"
fi
if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
echo "󱐋 "
echo ""
echo "#f38ba8"
fi
if [ "$level" -lt "10" ]; then
echo "󱐋 !"
echo ""
echo "#f38ba8"
fi

View File

@@ -0,0 +1,10 @@
#!/usr/bin/bash
a=$(date +"%Y-%m-%d-%T")-schermata.png
maim --select ~/Immagini/Schermate/$a
notify-send "Screenshot saved to ~/$a"
#kdialog --yesno "Screenshot salvato, vuoi aprirlo?"
#if [ $? == 0 ]; then
eog ~/Immagini/Schermate/$a
#fi

View File

@@ -0,0 +1,80 @@
#!/usr/bin/bash
#creazione meccanismo di cambiamento timer modalità m (modifica)
path=/tmp/miotimer
modifica () {
if [ $BLOCK_BUTTON == 4 ];then
current=$((current + 1))
echo $mode > $path
echo $current >> $path
fi
if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then
current=$((current - 1))
echo $mode > $path
echo $current >> $path
fi
if [ $current == 0 ];then
echo "󰔛 Tmr"
else
echo "$(sed '2!d' $path) m"
echo ""
echo "#f9e2af"
fi
}
timer () {
start=$(sed '2!d' $path)
start=$((start * 60))
now=$(date +%s)
first=$(sed '3!d' $path)
manca=$((start-now+first))
if [ $manca != 0 ];then
echo "󰄉 $((manca / 60)):$((manca % 60))"
echo ""
echo "#a6e3a1"
else
echo "󰔛 Tmr"
notify-send "Timer is over"
rm $path
fi
}
if [ -f $path ]
then
mode=$(sed '1!d' $path)
current=$(sed '2!d' $path)
if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then
if [ $mode == "w" ];then
rm $path
echo "󰔛 Tmr"
exit
fi
mode=w
echo $mode > $path
echo $current >> $path
echo $(date +%s) >> $path
fi
if [ $mode == "m" ];then
modifica
fi
if [ $mode == "w" ];then
timer
fi
else
echo m > $path
echo 0 >> $path
echo "󰔛 Tmr"
fi

View File

@@ -0,0 +1,16 @@
#!/usr/bin/bash
if [ $BLOCK_BUTTON -eq "1" ];then
kitty -e sudo dnf upgrade
kitty -e flatpak update
fi
numero=$(dnf check-update| grep -Ec ' updates$')
if [ $numero -eq "0" ];then
echo " "
else
echo "󰏕 $numero"
echo ""
echo "#f9e2af"
fi

View File

@@ -0,0 +1,26 @@
#!/usr/bin/bash
w_path=~/.config/wallpaper/
c_path=~/.config/wallpaper/current
config=~/.config/
current=$(cat $c_path)
if [ $BLOCK_BUTTON == 1 ];then
new=$((current+1))
if [ $new == 13 ]; then
new=0
fi
fi
if [ $BLOCK_BUTTON == 3 ];then
new=$((current - 1))
if [ $new == "-1" ]; then
new=12
fi
fi
rm "${config}sfondo.jpg"
cp "$w_path$new.jpg" $config
mv "$config$new.jpg" "${config}sfondo.jpg"
sed -i '1d' $c_path
echo $new >> $c_path
feh --bg-fill ~/.config/wallpaper/yuyukowallpaper.png

132
.config/i3/scripts/pomodoro.sh Executable file
View File

@@ -0,0 +1,132 @@
#!/usr/bin/env bash
if [ -f /tmp/pomo_timer ];then
pluto=$(cat /tmp/pomo_timer)
case $BLOCK_BUTTON in
3) if [ $pluto -eq "0" ];then
echo "1" > /tmp/pomo_timer
pluto=1
else
echo "0" > /tmp/pomo_timer
pluto=0
fi
;;
esac
if [ $pluto -eq "0" ];then
# Config variables
# 40min = 2400s
# 25min = 1500s
# 20min = 1200s
# 5min = 300s
# In secondi
work_time=2400
break_time=1200
msg_start=" Pom"
work_prefix=" "
break_prefix="󰅶 "
#start_color="#b39df3"
#start_color="#E06C75"
start_color="#cdd6f4"
break_color="#a6e3a1"
work_color="#f38ba8"
break_command="notify-send -t 2500 'Grab a tea'"
work_command="notify-send -t 2500 'Time to work!'"
pom_path="/tmp/pomodoro"
function display () {
min=$((s/60))
sek=$((s%60))
if [ $min -eq 0 ]
then
min=00
elif [ $min -lt 10 ]
then
min=0$min
fi
if [ $sek -lt 10 ]
then
sek=0$sek
fi
case $2 in # richiamo alla seconda variabile, t
w)
echo "$work_prefix$min:$sek"
echo $min:$sek
echo $work_color
;;
b)
echo "$break_prefix$min:$sek"
echo $min:$sek
echo $break_color
;;
esac
}
if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ]
then
p=$(sed '1 d' $pom_path) # time
t=$(sed '2 d' $pom_path) # mode
case $t in
w) dur=$work_time;;
b) dur=$break_time;;
esac
now=$(date +%s)
s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione
if [ $s -le 0 ] # if time less than 0 then switch mode
then
case $t in
w)
echo b > $pom_path
eval "$break_command"
paplay $HOME/.config/i3/scripts/bell.wav
;;
b)
echo w > $pom_path
eval "$work_command"
paplay $HOME/.config/i3/scripts/bell_end.wav
;;
esac
echo "$now" >> $pom_path
fi
display "$s" "$t"
else
echo "$msg_start"
echo "$msg_start"
echo "$start_color"
fi
case $BLOCK_BUTTON in
1)
if [ -f $pom_path ]; then # if file exists then stop reset timer
rm $pom_path
else
echo w > $pom_path # else start timer
date +%s >> $pom_path
fi
;;
esac
# è scritto in modo carino ma non ha sostanziali differenze rispetto al mio , per aggiornarsi sfrutta l'interval integrato. Inoltre è vincolato dalla stampa dell'orario effettivo che non gli permette di andare fuori dal taiming e rimanere sempre in orario. Dovrei evitare la funzione di chiamata e quella di sleep ed optare per un intervallo dentro il blocco. L'aggiornamento nel primo caso non cambia nulla nel secondo mostra secondi differenti ma si può fare.
fi
if [ $pluto -eq "1" ];then
~/.config/i3/scripts/miei/timer.sh
fi
else
echo "0" > /tmp/pomo_timer
fi

View File

@@ -0,0 +1,184 @@
#!/usr/bin/env bash
#
# Use rofi/zenity to change system runstate thanks to systemd.
#
# Note: this currently relies on associative array support in the shell.
#
# Inspired from i3pystatus wiki:
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
#
# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# modified to work with latest rofi update by joekamprad <joekamprad@endeavouros.com>
#######################################################################
# BEGIN CONFIG #
#######################################################################
# Use a custom lock script
#LOCKSCRIPT="i3lock-extra -m pixelize"
# Colors: FG (foreground), BG (background), HL (highlighted)
FG_COLOR="#bbbbbb"
BG_COLOR="#111111"
HLFG_COLOR="#111111"
HLBG_COLOR="#bbbbbb"
BORDER_COLOR="#222222"
# Options not related to colors (most rofi options do not work anymore)
ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi)
# Zenity options
ZENITY_TITLE="Power Menu"
ZENITY_TEXT="Action:"
ZENITY_OPTIONS=(--column= --hide-header)
#######################################################################
# END CONFIG #
#######################################################################
# Whether to ask for user's confirmation
enable_confirmation=false
# Preferred launcher if both are available
preferred_launcher="rofi"
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
where:
-h show this help text
-c ask for user confirmation
-p preferred launcher (rofi or zenity)
This script depends on:
- systemd,
- i3,
- rofi or zenity."
# Check whether the user-defined launcher is valid
launcher_list=(rofi zenity)
function check_launcher() {
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
echo "Supported launchers: ${launcher_list[*]}"
exit 1
else
# Get array with unique elements and preferred launcher first
# Note: uniq expects a sorted list, so we cannot use it
i=1
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
fi
}
# Parse CLI arguments
while getopts "hcp:" option; do
case "${option}" in
h) echo "${usage}"
exit 0
;;
c) enable_confirmation=true
;;
p) preferred_launcher="${OPTARG}"
check_launcher "${preferred_launcher}"
;;
*) exit 1
;;
esac
done
# Check whether a command exists
function command_exists() {
command -v "$1" &> /dev/null 2>&1
}
# systemctl required
if ! command_exists systemctl ; then
exit 1
fi
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[ Shutdown]="systemctl poweroff"
[ Reboot]="systemctl reboot"
[ Suspend]="systemctl suspend"
[ Lock]="~/.config/i3/scripts/blur-lock"
[ Logout]="i3-msg exit"
)
menu_nrows=${#menu[@]}
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher_exe=""
launcher_options=""
rofi_colors=""
function prepare_launcher() {
if [[ "$1" == "rofi" ]]; then
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
launcher_exe="rofi"
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
elif [[ "$1" == "zenity" ]]; then
launcher_exe="zenity"
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
"${ZENITY_OPTIONS[@]}")
fi
}
for l in "${launcher_list[@]}"; do
if command_exists "${l}" ; then
prepare_launcher "${l}"
break
fi
done
# No launcher available
if [[ -z "${launcher_exe}" ]]; then
exit 1
fi
launcher=(${launcher_exe} "${launcher_options[@]}")
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
function ask_confirmation() {
if [ "${launcher_exe}" == "rofi" ]; then
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
[ "${confirmed}" == "Yes" ] && confirmed=0
elif [ "${launcher_exe}" == "zenity" ]; then
zenity --question --text "Are you sure you want to ${selection,,}?"
confirmed=$?
fi
if [ "${confirmed}" == 0 ]; then
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
fi
}
if [[ $? -eq 0 && ! -z ${selection} ]]; then
if [[ "${enable_confirmation}" = true && \
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
ask_confirmation
else
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
fi
fi

112
.config/i3/scripts/volume Normal file
View File

@@ -0,0 +1,112 @@
#!/usr/bin/env bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
# check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
#------------------------------------------------------------------------
# The second parameter overrides the mixer selection
# For PulseAudio users, eventually use "pulse"
# For Jack/Jack2 users, use "jackplug"
# For ALSA users, you may use "default" for your primary card
# or you may use hw:# where # is the number of the card desired
if [[ -z "$MIXER" ]] ; then
MIXER="default"
if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
# pulseaudio is running, but not all installations use "pulse"
if amixer -D pulse info >/dev/null 2>&1 ; then
MIXER="pulse"
fi
fi
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
MIXER="${2:-$MIXER}"
fi
# The instance option sets the control to report and configure
# This defaults to the first control of your selected mixer
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
if [[ -z "$SCONTROL" ]] ; then
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
head -n1
)}"
fi
# The first parameter sets the step to change the volume by (and units to display)
# This may be in in % or dB (eg. 5% or 3dB)
if [[ -z "$STEP" ]] ; then
STEP="${1:-5%}"
fi
# AMIXER(1):
# "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
# more natural for human ear."
NATURAL_MAPPING=${NATURAL_MAPPING:-0}
if [[ "$NATURAL_MAPPING" != "0" ]] ; then
AMIXER_PARAMS="-M"
fi
#------------------------------------------------------------------------
capability() { # Return "Capture" if the device is a capture device
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
}
volume() {
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
}
format() {
perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
perl_filter+='{CORE::say $4 eq "off" ? "0%" : "'
# If dB was selected, print that instead
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
perl_filter+='"; exit}'
output=$(perl -ne "$perl_filter")
valore=${output::-1}
# basandomi sul valore di output cambio icona
if [ "$valore" -eq "0" ]; then
echo " "
echo ""
echo "#f38ba8"
else
if [ "$valore" -le "20" ]; then
echo " $output"
fi
if [ "$valore" -le "40" ] && [ "$valore" -gt "20" ]; then
echo " $output"
fi
if [ "$valore" -gt "40" ]; then
echo " $output"
fi
fi
}
#------------------------------------------------------------------------
case $BLOCK_BUTTON in
1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
3) pavucontrol;;
4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
esac
volume | format

View File

@@ -0,0 +1,98 @@
#!/usr/bin/env bash
# original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
# taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
# See README.md for usage instructions
bar_color="#a6da95"
volume_step=5
brightness_step=5%
max_volume=100
# Uses regex to get volume from pactl
function get_volume {
pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
}
# Uses regex to get mute status from pactl
function get_mute {
pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
}
# Uses regex to get brightness from xbacklight
function get_brightness {
brightnessctl g | grep -Po '[0-9]{1,3}' | head -n 1
}
# Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
function get_volume_icon {
volume=$(get_volume)
mute=$(get_mute)
if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
volume_icon="󰸈 "
elif [ "$volume" -lt 50 ]; then
volume_icon="󰕾 "
else
volume_icon=" "
fi
}
# Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
function get_brightness_icon {
brightness_icon=" "
}
# Displays a volume notification using dunstify
function show_volume_notif {
volume=$(get_mute)
get_volume_icon
dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
}
# Displays a brightness notification using dunstify
function show_brightness_notif {
massima=$(brightnessctl m)
brightness=$(($(get_brightness)*100/$massima))
get_brightness_icon
dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color
}
# Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
case $1 in
volume_up)
# Unmutes and increases volume, then displays the notification
pactl set-sink-mute @DEFAULT_SINK@ 0
volume=$(get_volume)
if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
else
pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
fi
show_volume_notif
;;
volume_down)
# Raises volume and displays the notification
pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
show_volume_notif
;;
volume_mute)
# Toggles mute and displays the notification
pactl set-sink-mute @DEFAULT_SINK@ toggle
show_volume_notif
;;
brightness_up)
# Increases brightness and displays the notification
brightnessctl s +$brightness_step
show_brightness_notif
;;
brightness_down)
# Decreases brightness and displays the notification
brightnessctl s $brightness_step-
show_brightness_notif
;;
esac