├── README.md
├── Swayfx_port (not maintained)
├── dunst
│ └── dunstrc
├── i3
│ ├── config
│ ├── i3blocks.conf
│ └── scripts
│ │ ├── bell.wav
│ │ ├── bell_end.wav
│ │ ├── blur-lock
│ │ ├── miei
│ │ ├── active.sh
│ │ ├── cpu.sh
│ │ ├── energia.sh
│ │ ├── feed.sh
│ │ ├── meteo.sh
│ │ ├── ora.sh
│ │ ├── power.sh
│ │ ├── power_charge.sh
│ │ ├── schermata.sh
│ │ ├── timer.sh
│ │ └── wallpaper.sh
│ │ ├── pomodoro.sh
│ │ ├── powermenu
│ │ ├── volume
│ │ └── volume_brightness.sh
└── rofi
│ ├── arc_dark_colors.rasi
│ ├── arc_dark_transparent_colors.rasi
│ ├── pw.rasi
│ ├── rofidmenu.rasi
│ ├── rofitodo.sh
│ └── todo.rasi
├── bar.png
├── barpc.png
├── combined.png
├── dunst
└── dunstrc
├── i3
├── config
├── i3blocks.conf
└── scripts
│ ├── bell.wav
│ ├── bell_end.wav
│ ├── blur-lock
│ ├── miei
│ ├── active.sh
│ ├── cpu.sh
│ ├── energia.sh
│ ├── energia_3mode.sh
│ ├── feed.sh
│ ├── full_charge.sh
│ ├── meteo.sh
│ ├── ora.sh
│ ├── power.sh
│ ├── power_charge.sh
│ ├── schermata.sh
│ ├── timer.sh
│ ├── update.sh
│ └── wallpaper.sh
│ ├── pomodoro.sh
│ ├── powermenu
│ ├── volume
│ └── volume_brightness.sh
├── i3_pc
├── config
├── i3blocks.conf
└── scripts
│ ├── bell.wav
│ ├── bell_end.wav
│ ├── blur-lock
│ ├── miei
│ ├── active.sh
│ ├── cpu.sh
│ ├── energia.sh
│ ├── feed.sh
│ ├── full_charge.sh
│ ├── meteo.sh
│ ├── ora.sh
│ ├── power.sh
│ ├── power_charge.sh
│ ├── schermata.sh
│ ├── timer.sh
│ ├── update.sh
│ ├── volcolor.sh
│ └── wallpaper.sh
│ ├── pomodoro.sh
│ ├── powermenu
│ ├── volume
│ └── volume_brightness.sh
├── i3_polybar
├── config
├── i3blocks.conf
└── scripts
│ ├── bell.wav
│ ├── bell_end.wav
│ ├── blur-lock
│ ├── miei
│ ├── active.sh
│ ├── cpu.sh
│ ├── energia.sh
│ ├── feed.sh
│ ├── full_charge.sh
│ ├── meteo.sh
│ ├── ora.sh
│ ├── power.sh
│ ├── power_charge.sh
│ ├── schermata.sh
│ ├── timer.sh
│ ├── update.sh
│ ├── volcolor.sh
│ └── wallpaper.sh
│ ├── pomodoro.sh
│ ├── powermenu
│ ├── volume
│ └── volume_brightness.sh
├── kitty
└── kitty.conf
├── picom
└── picom.conf
├── polybar.png
├── polybar
├── config.ini
└── script
│ ├── lofi
│ ├── active
│ ├── lofi.sh
│ └── stop.sh
│ ├── meteo.sh
│ ├── pomodoro
│ ├── appo
│ ├── pomo.sh
│ └── toggle.sh
│ ├── timer
│ ├── appo
│ ├── timer.sh
│ └── toggle.sh
│ ├── wallpaper.sh
│ └── wallpaperun.sh
├── rofi
├── arc_dark_colors.rasi
├── arc_dark_transparent_colors.rasi
├── pw.rasi
├── rofidmenu.rasi
├── rofitodo.sh
└── todo.rasi
├── vuoto.png
└── wallpaper
├── 0.jpg
├── 1.jpg
├── 10.jpg
├── 11.jpg
├── 12.jpg
├── 2.jpg
├── 3.jpg
├── 4.jpg
├── 5.jpg
├── 6.jpg
├── 7.jpg
├── 8.jpg
├── 9.jpg
└── current
/README.md:
--------------------------------------------------------------------------------
1 | # Cattendeavour 🐈
2 | 
3 | ## Setup:
4 | 
5 |
6 | **EndeavourOs i3** is the base of my setup (or install mpv, i3-blocks, feh, maim, scrot, rofi, power-profiles-daemon,pulseaudio,networkmanager, polkit-kde-agent ,blueman, kitty, picom, dunst)
7 | * Install [FiraCode Nerd Fonts](https://www.nerdfonts.com/font-downloads), **pacman -S ttf-firacode-nerd**
8 | * Make all files on i3/scripts , i3/scripts/miei, rofi/rofitodo.sh executable (chmod +x [file])
9 | * Click wallpaper icon on bar. To make wallpaper button work: move wallpaper folder to **~/.config**
10 | * Timer (for i3blocks): right click pomodoro, use scroll weel to change => left click to start => left to stop
11 | * gtk theme [Catppuccin](https://aur.archlinux.org/packages/catppuccin-gtk-theme-mocha)
12 | * [icons](https://github.com/ljmill/catppuccin-icons)
13 | * use Thunar for file, firefox for web.
14 | * [cursor](https://github.com/catppuccin/cursors) pick on release " Catppuccin-Mocha-Lavender-Cursors.zip "
15 | ### If you have a pc
16 | 
17 | * Delete i3, rename i3_pc -> i3
18 | ---
19 | ### Polybar version
20 | 
21 |
22 | * Install Noto Color Emoji
23 | * Make polybar/script/* executable
24 | * Delete i3, rename i3_polybar -> i3
25 |
26 | ## News:
27 |
28 | new
29 | * Lofi-girl button created for polybar
30 | * Created custom polybar pomodoro and timer modules
31 | * energia_3mode.sh script for all powerprofilesctl
32 |
33 | old
34 | * Volume icon more interactive (right click for pavcontroll)
35 | * Brightness from 0-100%
36 | * I tried moving to swayfx but nm-applet not work
37 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/i3blocks.conf:
--------------------------------------------------------------------------------
1 | # File configurazione i3block
2 |
3 |
4 | separator=false
5 | markup=pango
6 | separator_block_width=6
7 | color=#cdd6f4
8 |
9 |
10 |
11 | [search]
12 | full_text=
13 | color=#f38ba8
14 | command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi
15 |
16 | #[files]
17 | #full_text=
18 | #color=#cba6f7
19 | #command=i3-msg -q exec thunar ~/
20 |
21 | [todo]
22 | full_text=
23 | color=#89b4fa
24 | command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo
25 |
26 | [wallpaper]
27 | full_text=
28 | color=#fab387
29 | command=~/.config/i3/scripts/miei/wallpaper.sh
30 |
31 | [expander]
32 | full_text=
33 | command=swaymsg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh"
34 | color=#b4befe
35 |
36 | [terminal]
37 | full_text=
38 | color=#94e2d5
39 | command=swaymsg -q exec kitty
40 |
41 |
42 | [close]
43 | full_text=
44 | color=#f38ba8
45 | command=swaymsg -q kill
46 | separator_block_width=0
47 |
48 |
49 | [simple-2]
50 | full_text=:
51 | color=#717171
52 |
53 |
54 | [meteo]
55 | command=~/.config/i3/scripts/miei/meteo.sh
56 | interval=1000
57 |
58 |
59 | [separator]
60 | full_text="⟨"
61 | color=#585b70
62 |
63 | [cpu_usage]
64 | full_text=
65 | label=
66 | command=~/.config/i3/scripts/miei/cpu.sh
67 | interval=10
68 |
69 | #[separator]
70 | #full_text="⟨"
71 | #color=#585b70
72 |
73 | #[news]
74 | #full_text=""
75 | #command=~/.config/i3/scripts/miei/feed.sh
76 | #interval=once
77 |
78 | [separator]
79 | full_text="⟨"
80 | color=#585b70
81 |
82 | [pavucontrol]
83 | full_text=
84 | command=pavucontrol
85 |
86 | [volume-pulseaudio]
87 | command=~/.config/i3/scripts/volume
88 | instance=Master
89 | interval=1
90 |
91 | [separator]
92 | full_text="⟨"
93 | color=#585b70
94 |
95 | [timer]
96 | full_text=
97 | command=~/.config/i3/scripts/miei/timer.sh
98 | interval=1
99 |
100 |
101 | [separator]
102 | full_text="⟨"
103 | color=#585b70
104 |
105 | [pomodoro]
106 | command=~/.config/i3/scripts/pomodoro.sh
107 | interval=1
108 |
109 | [separator]
110 | full_text="⟨"
111 | color=#585b70
112 |
113 | [gestione_energia]
114 | full_text=
115 | command=/home/flavio/.config/i3/scripts/miei/energia.sh
116 | interval=once
117 |
118 |
119 |
120 | [separator]
121 | full_text="⟨"
122 | color=#585b70
123 |
124 | #[battery]
125 | #command=~/.config/i3/scripts/battery2
126 | #label=
127 | #interval=30
128 |
129 | #[separator]
130 | #full_text="|"
131 |
132 | #[separator]
133 | #full_text="|"
134 | #color=#585b70
135 | [icona]
136 | full_text=
137 |
138 | [battery]
139 | command=~/.config/i3/scripts/miei/power.sh
140 | label=
141 | interval=1
142 |
143 | [separator]
144 | full_text="⟨"
145 | color=#585b70
146 |
147 | [time]
148 | full_text=
149 | label=
150 | interval=1
151 | command=~/.config/i3/scripts/miei/ora.sh
152 | separator_block_width=10
153 | color=#b4befe
154 |
155 | #color=#f38ba8
156 |
157 |
158 |
159 |
160 |
161 |
162 | [shutdown_menu]
163 | full_text= ⏼
164 | #full_text= ⏼
165 | command=~/.config/i3/scripts/powermenu
166 | color=#b4befe
167 |
168 | #color=#f5e0dc
169 | #background=#e71853
170 | #separator_block_width=0
171 | #color=#f38ba8
172 | separator_block_width=0
173 |
174 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/bell.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/Swayfx_port (not maintained)/i3/scripts/bell.wav
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/bell_end.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/Swayfx_port (not maintained)/i3/scripts/bell_end.wav
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/blur-lock:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | PICTURE=/tmp/i3lock.png
4 | SCREENSHOT="grim $PICTURE"
5 |
6 | BLUR="5x4"
7 |
8 | $SCREENSHOT
9 | convert $PICTURE -blur $BLUR $PICTURE
10 | swaylock -i $PICTURE
11 | rm $PICTURE
12 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/active.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ -f /tmp/tray ]; then
3 | var=$(cat /tmp/tray)
4 | if [ $var == 1 ]; then
5 | echo 0 > /tmp/tray
6 | i3-msg -q "bar mode dock bar-tray"
7 | i3-msg -q "bar mode invisible bar-primary"
8 | fi
9 |
10 | if [ $var == 0 ]; then
11 | echo 1 > /tmp/tray
12 | i3-msg -q "bar mode invisible bar-tray"
13 | i3-msg -q "bar mode dock bar-primary"
14 |
15 | fi
16 | else
17 | echo 0 > /tmp/tray
18 | i3-msg -q "bar mode dock bar-tray"
19 | i3-msg -q "bar mode invisible bar-primary"
20 | fi
21 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/cpu.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ $BLOCK_BUTTON == 1 ]; then
3 | kitty -e htop
4 | fi
5 |
6 | echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"
7 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/energia.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/energia.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]; then
20 |
21 | echo " Pro"
22 | powerprofilesctl set balanced
23 |
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | echo " Eco"
28 | powerprofilesctl set power-saver
29 | fi
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/feed.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/feed.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]
20 | then
21 | echo " $(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=)')"
22 | else
23 | echo " News"
24 | fi
25 |
26 | if [ $BLOCK_BUTTON == 3 ]; then
27 | xdg-open https://www.lescienze.it/news/
28 | fi
29 |
30 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/meteo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | meteo=$(curl wttr.in/Sedriano?format=1| xargs echo)
3 | if [ "$meteo" == "" ]; then
4 | echo " Off"
5 |
6 | else
7 | echo $meteo
8 | fi
9 |
10 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/ora.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=1
3 |
4 | path=~/.config/i3/scripts/miei/ora.sh
5 |
6 | cambia_var () {
7 | if [ $a == 0 ]; then
8 | sed -i '2d' $path
9 | sed -i '2ia=1' $path
10 | # se non mostri la variabile subito ci sarà il delay di interval
11 | a=1
12 | return 1
13 | fi
14 | if [ $a == 1 ]; then
15 | sed -i '2d' $path
16 | sed -i '2ia=0' $path
17 | a=0
18 | return 0
19 | fi
20 | }
21 |
22 | if [ $BLOCK_BUTTON == 1 ]; then
23 | cambia_var
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | date '+%a %d %b %H:%M'
28 | fi
29 |
30 | if [ $a == 1 ]; then
31 | date '+%H:%M'
32 | fi
33 |
34 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/power.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then
8 | ~/.config/i3/scripts/miei/power_charge.sh
9 | exit 1
10 | fi
11 |
12 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
13 |
14 | unit=20
15 | vite=$(($level/unit))
16 |
17 | if [ $vite == 5 ]; then
18 | echo ""
19 | echo ""
20 | echo "#cdd6f4"
21 | fi
22 |
23 | if [ $vite == 4 ]; then
24 | echo ""
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 3 ]; then
29 | echo ""
30 | echo ""
31 | echo "#a6e3a1"
32 | fi
33 | if [ $vite == 2 ]; then
34 | echo ""
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ $vite == 1 ]; then
39 | echo ""
40 | echo ""
41 | echo "#fab387"
42 | fi
43 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
44 | echo ""
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 | if [ "$level" -lt "10" ]; then
49 | echo "!"
50 | echo ""
51 | echo "#f38ba8"
52 | fi
53 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/power_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
8 |
9 | unit=20
10 | vite=$(($level/unit))
11 | if [ $vite == 5 ]; then
12 | echo " "
13 | echo ""
14 | echo "#cdd6f4"
15 | fi
16 |
17 | if [ $vite == 4 ]; then
18 | echo " "
19 | echo ""
20 | echo "#a6e3a1"
21 | fi
22 | if [ $vite == 3 ]; then
23 | echo " "
24 | echo ""
25 | echo "#a6e3a1"
26 | fi
27 | if [ $vite == 2 ]; then
28 | echo " "
29 | echo ""
30 | echo "#fab387"
31 | fi
32 | if [ $vite == 1 ]; then
33 | echo " "
34 | echo ""
35 | echo "#fab387"
36 | fi
37 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
38 | echo " "
39 | echo ""
40 | echo "#f38ba8"
41 | fi
42 | if [ "$level" -lt "10" ]; then
43 | echo " !"
44 | echo ""
45 | echo "#f38ba8"
46 | fi
47 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/schermata.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=$(date +"%Y-%m-%d-%T")-schermata.png
3 |
4 | grim -g "$(slurp)" ~/Immagini/Schermate/$a
5 | notify-send "Screenshot saved to ~/$a"
6 | #kdialog --yesno "Screenshot salvato, vuoi aprirlo?"
7 | #if [ $? == 0 ]; then
8 | eog ~/Immagini/Schermate/$a
9 | #fi
10 |
11 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/timer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #creazione meccanismo di cambiamento timer modalità m (modifica)
3 | path=/tmp/miotimer
4 |
5 | modifica () {
6 | if [ $BLOCK_BUTTON == 4 ];then
7 | current=$((current + 1))
8 | echo $mode > $path
9 | echo $current >> $path
10 | fi
11 | if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then
12 | current=$((current - 1))
13 | echo $mode > $path
14 | echo $current >> $path
15 | fi
16 | if [ $current == 0 ];then
17 | echo " Tmr"
18 | else
19 | echo " $(sed '2!d' $path) m"
20 | echo ""
21 | echo "#f9e2af"
22 | fi
23 | }
24 |
25 | timer () {
26 | start=$(sed '2!d' $path)
27 | start=$((start * 60))
28 | now=$(date +%s)
29 | first=$(sed '3!d' $path)
30 | manca=$((start-now+first))
31 | if [ $manca != 0 ];then
32 | echo " $((manca / 60)):$((manca % 60))"
33 | echo ""
34 | echo "#a6e3a1"
35 |
36 | else
37 | echo " Tmr"
38 | notify-send "Timer is over"
39 | rm $path
40 | fi
41 | }
42 |
43 |
44 |
45 |
46 | if [ -f $path ]
47 | then
48 |
49 |
50 | mode=$(sed '1!d' $path)
51 | current=$(sed '2!d' $path)
52 |
53 | if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then
54 | if [ $mode == "w" ];then
55 | rm $path
56 | echo " Tmr"
57 | exit
58 | fi
59 | mode=w
60 | echo $mode > $path
61 | echo $current >> $path
62 | echo $(date +%s) >> $path
63 | fi
64 |
65 |
66 | if [ $mode == "m" ];then
67 | modifica
68 | fi
69 |
70 | if [ $mode == "w" ];then
71 | timer
72 | fi
73 |
74 |
75 |
76 | else
77 | echo m > $path
78 | echo 0 >> $path
79 | echo " Tmr"
80 | fi
81 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/miei/wallpaper.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | w_path=~/.config/wallpaper/
3 | c_path=~/.config/wallpaper/current
4 | config=~/.config/
5 | current=$(cat $c_path)
6 |
7 | if [ $BLOCK_BUTTON == 1 ];then
8 | new=$((current+1))
9 | if [ $new == 13 ]; then
10 | new=0
11 | fi
12 | fi
13 |
14 | if [ $BLOCK_BUTTON == 3 ];then
15 | new=$((current - 1))
16 | if [ $new == "-1" ]; then
17 | new=12
18 | fi
19 | fi
20 |
21 | rm "${config}sfondo.jpg"
22 | cp "$w_path$new.jpg" $config
23 | mv "$config$new.jpg" "${config}sfondo.jpg"
24 | sed -i '1d' $c_path
25 | echo $new >> $c_path
26 | swww img --transition-type grow ~/.config/sfondo.jpg
27 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/pomodoro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 |
5 | # Config variables
6 | # 40min = 2400s
7 | # 25min = 1500s
8 | # 20min = 1200s
9 | # 5min = 300s
10 |
11 | # In secondi
12 | work_time=2400
13 | break_time=1200
14 |
15 | msg_start=" Pom"
16 | work_prefix=" "
17 | break_prefix=" "
18 |
19 | #start_color="#b39df3"
20 | #start_color="#E06C75"
21 | start_color="#cdd6f4"
22 |
23 | break_color="#a6e3a1"
24 | work_color="#f38ba8"
25 |
26 | break_command="notify-send -t 2500 'Grab a tea'"
27 | work_command="notify-send -t 2500 'Time to work!'"
28 |
29 | pom_path="/tmp/pomodoro"
30 |
31 | function display () {
32 | min=$((s/60))
33 | sek=$((s%60))
34 | if [ $min -eq 0 ]
35 | then
36 | min=00
37 | elif [ $min -lt 10 ]
38 | then
39 | min=0$min
40 | fi
41 | if [ $sek -lt 10 ]
42 | then
43 | sek=0$sek
44 | fi
45 | case $2 in # richiamo alla seconda variabile, t
46 | w)
47 | echo "$work_prefix$min:$sek"
48 | echo $min:$sek
49 | echo $work_color
50 | ;;
51 | b)
52 | echo "$break_prefix$min:$sek"
53 | echo $min:$sek
54 | echo $break_color
55 | ;;
56 | esac
57 | }
58 |
59 | if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ]
60 | then
61 | p=$(sed '1 d' $pom_path) # time
62 | t=$(sed '2 d' $pom_path) # mode
63 | case $t in
64 | w) dur=$work_time;;
65 | b) dur=$break_time;;
66 | esac
67 | now=$(date +%s)
68 | s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione
69 | if [ $s -le 0 ] # if time less than 0 then switch mode
70 | then
71 | case $t in
72 | w)
73 | echo b > $pom_path
74 | eval "$break_command"
75 | paplay $HOME/.config/i3/scripts/bell.wav
76 | ;;
77 | b)
78 | echo w > $pom_path
79 | eval "$work_command"
80 | paplay $HOME/.config/i3/scripts/bell_end.wav
81 |
82 | ;;
83 | esac
84 | echo "$now" >> $pom_path
85 | fi
86 | display "$s" "$t"
87 | else
88 | echo "$msg_start"
89 | echo "$msg_start"
90 | echo "$start_color"
91 | fi
92 |
93 | case $BLOCK_BUTTON in
94 | 1)
95 | if [ -f $pom_path ]; then # if file exists then stop reset timer
96 | rm $pom_path
97 | else
98 | echo w > $pom_path # else start timer
99 | date +%s >> $pom_path
100 | fi
101 | ;;
102 | esac
103 | # è 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.
104 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/powermenu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Use rofi/zenity to change system runstate thanks to systemd.
4 | #
5 | # Note: this currently relies on associative array support in the shell.
6 | #
7 | # Inspired from i3pystatus wiki:
8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
9 | #
10 | # Copyright 2015 Benjamin Chrétien
11 | #
12 | # This program is free software: you can redistribute it and/or modify
13 | # it under the terms of the GNU General Public License as published by
14 | # the Free Software Foundation, either version 3 of the License, or
15 | # (at your option) any later version.
16 |
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 |
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program. If not, see .
24 |
25 | # modified to work with latest rofi update by joekamprad
26 |
27 | #######################################################################
28 | # BEGIN CONFIG #
29 | #######################################################################
30 |
31 | # Use a custom lock script
32 | #LOCKSCRIPT="i3lock-extra -m pixelize"
33 |
34 | # Colors: FG (foreground), BG (background), HL (highlighted)
35 | FG_COLOR="#bbbbbb"
36 | BG_COLOR="#111111"
37 | HLFG_COLOR="#111111"
38 | HLBG_COLOR="#bbbbbb"
39 | BORDER_COLOR="#222222"
40 |
41 | # Options not related to colors (most rofi options do not work anymore)
42 | ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi)
43 | # Zenity options
44 | ZENITY_TITLE="Power Menu"
45 | ZENITY_TEXT="Action:"
46 | ZENITY_OPTIONS=(--column= --hide-header)
47 |
48 | #######################################################################
49 | # END CONFIG #
50 | #######################################################################
51 |
52 | # Whether to ask for user's confirmation
53 | enable_confirmation=false
54 |
55 | # Preferred launcher if both are available
56 | preferred_launcher="rofi"
57 |
58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
59 |
60 | where:
61 | -h show this help text
62 | -c ask for user confirmation
63 | -p preferred launcher (rofi or zenity)
64 |
65 | This script depends on:
66 | - systemd,
67 | - i3,
68 | - rofi or zenity."
69 |
70 | # Check whether the user-defined launcher is valid
71 | launcher_list=(rofi zenity)
72 | function check_launcher() {
73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
74 | echo "Supported launchers: ${launcher_list[*]}"
75 | exit 1
76 | else
77 | # Get array with unique elements and preferred launcher first
78 | # Note: uniq expects a sorted list, so we cannot use it
79 | i=1
80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
82 | fi
83 | }
84 |
85 | # Parse CLI arguments
86 | while getopts "hcp:" option; do
87 | case "${option}" in
88 | h) echo "${usage}"
89 | exit 0
90 | ;;
91 | c) enable_confirmation=true
92 | ;;
93 | p) preferred_launcher="${OPTARG}"
94 | check_launcher "${preferred_launcher}"
95 | ;;
96 | *) exit 1
97 | ;;
98 | esac
99 | done
100 |
101 | # Check whether a command exists
102 | function command_exists() {
103 | command -v "$1" &> /dev/null 2>&1
104 | }
105 |
106 | # systemctl required
107 | if ! command_exists systemctl ; then
108 | exit 1
109 | fi
110 |
111 | # menu defined as an associative array
112 | typeset -A menu
113 |
114 | # Menu with keys/commands
115 |
116 | menu=(
117 | [ Shutdown]="systemctl poweroff"
118 | [ Reboot]="systemctl reboot"
119 | [ Suspend]="systemctl suspend"
120 | [ Lock]="~/.config/i3/scripts/blur-lock"
121 | [ Logout]="i3-msg exit"
122 | )
123 |
124 | menu_nrows=${#menu[@]}
125 |
126 | # Menu entries that may trigger a confirmation message
127 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
128 |
129 | launcher_exe=""
130 | launcher_options=""
131 | rofi_colors=""
132 |
133 | function prepare_launcher() {
134 | if [[ "$1" == "rofi" ]]; then
135 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
136 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
137 | launcher_exe="rofi"
138 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
139 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
140 | elif [[ "$1" == "zenity" ]]; then
141 | launcher_exe="zenity"
142 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
143 | "${ZENITY_OPTIONS[@]}")
144 | fi
145 | }
146 |
147 | for l in "${launcher_list[@]}"; do
148 | if command_exists "${l}" ; then
149 | prepare_launcher "${l}"
150 | break
151 | fi
152 | done
153 |
154 | # No launcher available
155 | if [[ -z "${launcher_exe}" ]]; then
156 | exit 1
157 | fi
158 |
159 | launcher=(${launcher_exe} "${launcher_options[@]}")
160 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
161 |
162 | function ask_confirmation() {
163 | if [ "${launcher_exe}" == "rofi" ]; then
164 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
165 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
166 | [ "${confirmed}" == "Yes" ] && confirmed=0
167 | elif [ "${launcher_exe}" == "zenity" ]; then
168 | zenity --question --text "Are you sure you want to ${selection,,}?"
169 | confirmed=$?
170 | fi
171 |
172 | if [ "${confirmed}" == 0 ]; then
173 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
174 | fi
175 | }
176 |
177 | if [[ $? -eq 0 && ! -z ${selection} ]]; then
178 | if [[ "${enable_confirmation}" = true && \
179 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
180 | ask_confirmation
181 | else
182 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
183 | fi
184 | fi
185 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/volume:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Copyright (C) 2014 Julien Bonjean
3 | # Copyright (C) 2014 Alexander Keller
4 |
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 3 of the License, or
8 | # (at your option) any later version.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 |
15 | # You should have received a copy of the GNU General Public License
16 | # along with this program. If not, see .
17 |
18 | # original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
19 | # check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
20 | #------------------------------------------------------------------------
21 |
22 | # The second parameter overrides the mixer selection
23 | # For PulseAudio users, eventually use "pulse"
24 | # For Jack/Jack2 users, use "jackplug"
25 | # For ALSA users, you may use "default" for your primary card
26 | # or you may use hw:# where # is the number of the card desired
27 | if [[ -z "$MIXER" ]] ; then
28 | MIXER="default"
29 | if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
30 | # pulseaudio is running, but not all installations use "pulse"
31 | if amixer -D pulse info >/dev/null 2>&1 ; then
32 | MIXER="pulse"
33 | fi
34 | fi
35 | [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
36 | MIXER="${2:-$MIXER}"
37 | fi
38 |
39 | # The instance option sets the control to report and configure
40 | # This defaults to the first control of your selected mixer
41 | # For a list of the available, use `amixer -D $Your_Mixer scontrols`
42 | if [[ -z "$SCONTROL" ]] ; then
43 | SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
44 | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
45 | head -n1
46 | )}"
47 | fi
48 |
49 | # The first parameter sets the step to change the volume by (and units to display)
50 | # This may be in in % or dB (eg. 5% or 3dB)
51 | if [[ -z "$STEP" ]] ; then
52 | STEP="${1:-5%}"
53 | fi
54 |
55 | # AMIXER(1):
56 | # "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
57 | # more natural for human ear."
58 | NATURAL_MAPPING=${NATURAL_MAPPING:-0}
59 | if [[ "$NATURAL_MAPPING" != "0" ]] ; then
60 | AMIXER_PARAMS="-M"
61 | fi
62 |
63 | #------------------------------------------------------------------------
64 |
65 | capability() { # Return "Capture" if the device is a capture device
66 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
67 | sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
68 | }
69 |
70 | volume() {
71 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
72 | }
73 |
74 | format() {
75 |
76 | perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
77 | perl_filter+='{CORE::say $4 eq "off" ? "no " : "'
78 | # If dB was selected, print that instead
79 | perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
80 | perl_filter+='"; exit}'
81 | output=$(perl -ne "$perl_filter")
82 | echo "$LABEL $output"
83 | }
84 |
85 | #------------------------------------------------------------------------
86 |
87 | case $BLOCK_BUTTON in
88 | 1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
89 | 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
90 | 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
91 | esac
92 |
93 | volume | format
94 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/i3/scripts/volume_brightness.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
3 |
4 | # taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
5 |
6 | # See README.md for usage instructions
7 | bar_color="#a6da95"
8 | volume_step=5
9 | brightness_step=5%
10 | max_volume=100
11 |
12 | # Uses regex to get volume from pactl
13 | function get_volume {
14 | pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
15 | }
16 |
17 | # Uses regex to get mute status from pactl
18 | function get_mute {
19 | pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
20 | }
21 |
22 | # Uses regex to get brightness from xbacklight
23 | function get_brightness {
24 | brightnessctl g
25 |
26 | }
27 |
28 | # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
29 | function get_volume_icon {
30 | volume=$(get_volume)
31 | mute=$(get_mute)
32 | if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
33 | volume_icon=" "
34 | elif [ "$volume" -lt 50 ]; then
35 | volume_icon=" "
36 | else
37 | volume_icon=" "
38 | fi
39 | }
40 |
41 | # Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
42 | function get_brightness_icon {
43 | brightness_icon=" "
44 | }
45 |
46 | # Displays a volume notification using dunstify
47 | function show_volume_notif {
48 | volume=$(get_mute)
49 | get_volume_icon
50 | dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
51 | }
52 |
53 | # Displays a brightness notification using dunstify
54 | function show_brightness_notif {
55 | brightness=$(echo "$(get_brightness)*100/255"| bc)
56 | get_brightness_icon
57 | dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color
58 | }
59 |
60 | # Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
61 | case $1 in
62 | volume_up)
63 | # Unmutes and increases volume, then displays the notification
64 | pactl set-sink-mute @DEFAULT_SINK@ 0
65 | volume=$(get_volume)
66 | if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
67 | pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
68 | else
69 | pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
70 | fi
71 | show_volume_notif
72 | ;;
73 |
74 | volume_down)
75 | # Raises volume and displays the notification
76 | pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
77 | show_volume_notif
78 | ;;
79 |
80 | volume_mute)
81 | # Toggles mute and displays the notification
82 | pactl set-sink-mute @DEFAULT_SINK@ toggle
83 | show_volume_notif
84 | ;;
85 |
86 | brightness_up)
87 | # Increases brightness and displays the notification
88 | brightnessctl s +$brightness_step
89 | show_brightness_notif
90 | ;;
91 |
92 | brightness_down)
93 | # Decreases brightness and displays the notification
94 | brightnessctl s $brightness_step-
95 | show_brightness_notif
96 | ;;
97 | esac
98 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/arc_dark_colors.rasi:
--------------------------------------------------------------------------------
1 | /*******************************************************
2 | * ROFI Arc Dark colors for EndeavourOS
3 | * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
4 | *******************************************************/
5 | * {
6 | selected-normal-foreground: rgba ( 249, 249, 249, 100 % );
7 | foreground: rgba ( 196, 203, 212, 100 % );
8 | normal-foreground: @foreground;
9 | alternate-normal-background: rgba ( 64, 69, 82, 59 % );
10 | red: rgba ( 220, 50, 47, 100 % );
11 | selected-urgent-foreground: rgba ( 249, 249, 249, 100 % );
12 | blue: rgba ( 38, 139, 210, 100 % );
13 | urgent-foreground: rgba ( 204, 102, 102, 100 % );
14 | alternate-urgent-background: rgba ( 75, 81, 96, 90 % );
15 | active-foreground: rgba ( 101, 172, 255, 100 % );
16 | lightbg: rgba ( 238, 232, 213, 100 % );
17 | selected-active-foreground: rgba ( 249, 249, 249, 100 % );
18 | alternate-active-background: rgba ( 75, 81, 96, 89 % );
19 | background: rgba ( 45, 48, 59, 95 % );
20 | alternate-normal-foreground: @foreground;
21 | normal-background: @background;
22 | lightfg: rgba ( 88, 104, 117, 100 % );
23 | selected-normal-background: rgba ( 64, 132, 214, 100 % );
24 | border-color: rgba ( 124, 131, 137, 100 % );
25 | spacing: 2;
26 | separatorcolor: rgba ( 29, 31, 33, 100 % );
27 | urgent-background: rgba ( 29, 31, 33, 17 % );
28 | selected-urgent-background: rgba ( 165, 66, 66, 100 % );
29 | alternate-urgent-foreground: @urgent-foreground;
30 | background-color: rgba ( 0, 0, 0, 0 % );
31 | alternate-active-foreground: @active-foreground;
32 | active-background: rgba ( 29, 31, 33, 17 % );
33 | selected-active-background: rgba ( 68, 145, 237, 100 % );
34 | }
35 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/arc_dark_transparent_colors.rasi:
--------------------------------------------------------------------------------
1 | /*******************************************************
2 | * ROFI Arch Dark Transparent colors for EndeavourOS
3 | * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
4 | *******************************************************/
5 | * {
6 | selected-normal-foreground: rgba(243 139 168 / 1);
7 | foreground: rgba ( 196, 203, 212, 100 % );
8 | normal-foreground: @foreground;
9 | alternate-normal-background: rgba ( 45, 48, 59, 1 % );
10 | red: rgba(203 166 247 / 1);
11 | selected-urgent-foreground: rgba(203 166 247 / 1);
12 | blue: rgba(203 166 247 / 1);
13 | urgent-foreground: rgba(203 166 247 / 1);
14 | alternate-urgent-background: rgba ( 75, 81, 96, 90 % );
15 | active-foreground: rgba(203 166 247 / 1);
16 | lightbg: rgba ( 238, 232, 213, 100 % );
17 | selected-active-foreground: rgba(203 166 247 / 1);
18 | alternate-active-background: rgba ( 45, 48, 59, 88 % );
19 | background: rgba(30 30 46 / 97 % );
20 | alternate-normal-foreground: @foreground;
21 | normal-background: rgba ( 45, 48, 59, 1 % );
22 | lightfg: rgba(203 166 247 / 1);
23 | selected-normal-background: rgba ( 24, 26, 32, 100 % );
24 | border-color: rgba ( 124, 131, 137, 100 % );
25 | spacing: 2;
26 | separatorcolor: rgba ( 45, 48, 59, 1 % );
27 | urgent-background: rgba ( 45, 48, 59, 15 % );
28 | selected-urgent-background: rgba ( 165, 66, 66, 100 % );
29 | alternate-urgent-foreground: @urgent-foreground;
30 | background-color: rgba ( 0, 0, 0, 0 % );
31 | alternate-active-foreground: @active-foreground;
32 | active-background: rgba ( 29, 31, 33, 17 % );
33 | selected-active-background: rgba ( 26, 28, 35, 100 % );
34 | }
35 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/pw.rasi:
--------------------------------------------------------------------------------
1 | /*******************************************************
2 | * ROFI configs i3 Apps menu for EndeavourOS
3 | * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
4 | *******************************************************/
5 | configuration {
6 | font: "FiraCode Nerd Font medium 10";
7 | show-icons: true;
8 | icon-theme: "Qogir";
9 | display-drun: "Apps";
10 | drun-display-format: "{name}";
11 | scroll-method: 0;
12 | disable-history: false;
13 | sidebar-mode: false;
14 | location: 3;
15 |
16 | }
17 |
18 | @import "~/.config/rofi/arc_dark_transparent_colors.rasi"
19 |
20 | window {
21 | background-color: @background;
22 | border: 2;
23 | padding: 5;
24 | width: 220px;
25 | border-color:#b4befe;
26 | border-radius: 10;
27 | x-offset: -20px;
28 | y-offset: 20px;
29 | }
30 | listview {
31 | lines: 5;
32 | columns: 1;
33 | }
34 | mainbox {
35 | border: 0;
36 | padding: 0;
37 | }
38 | message {
39 | border: 2px 0px 0px;
40 | border-color: @separatorcolor;
41 | padding: 1px;
42 | }
43 | textbox {
44 | text-color: @foreground;
45 | }
46 | listview {
47 | fixed-height: 0;
48 | border: 8px 0px 0px;
49 | border-color: @separatorcolor;
50 | spacing: 8px;
51 | scrollbar: false;
52 | padding: 2px 0px 0px;
53 | }
54 | element {
55 | border: 0;
56 | padding: 1px;
57 | }
58 | element-text {
59 | background-color: inherit;
60 | text-color: inherit;
61 | horizontal-align: 0.4;
62 | }
63 | element.normal.normal {
64 | background-color: @normal-background;
65 | text-color: @normal-foreground;
66 | }
67 | element.normal.urgent {
68 | background-color: @urgent-background;
69 | text-color: @urgent-foreground;
70 | }
71 | element.normal.active {
72 | background-color: @active-background;
73 | text-color: #b4befe;
74 | }
75 | element.selected.normal {
76 | background-color: @selected-normal-background;
77 | text-color: #b4befe;
78 | }
79 | element.selected.urgent {
80 | background-color: @selected-urgent-background;
81 | text-color: @selected-urgent-foreground;
82 | }
83 | element.selected.active {
84 | background-color: @selected-active-background;
85 | text-color: @selected-active-foreground;
86 | }
87 | element.alternate.normal {
88 | background-color: @alternate-normal-background;
89 | text-color: @alternate-normal-foreground;
90 | }
91 | element.alternate.urgent {
92 | background-color: @alternate-urgent-background;
93 | text-color: @alternate-urgent-foreground;
94 | }
95 | element.alternate.active {
96 | background-color: @alternate-active-background;
97 | text-color: @alternate-active-foreground;
98 | }
99 | scrollbar {
100 | width: 4px;
101 | border: 0;
102 | handle-color: @normal-foreground;
103 | handle-width: 8px;
104 | padding: 0;
105 | }
106 | mode-switcher {
107 | border: 2px 0px 0px;
108 | border-color: @separatorcolor;
109 | }
110 | button {
111 | spacing: 0;
112 | text-color: @normal-foreground;
113 | }
114 | button.selected {
115 | background-color: @selected-normal-background;
116 | text-color: @selected-normal-foreground;
117 | }
118 | inputbar {
119 | enabled: false;
120 | spacing: 0;
121 | text-color: @normal-foreground;
122 | padding: 1px;
123 | }
124 | case-indicator {
125 | spacing: 0;
126 | text-color: @normal-foreground;
127 | }
128 | entry {
129 | spacing: 0;
130 | text-color: @normal-foreground;
131 | }
132 | prompt {
133 | spacing: 0;
134 | text-color: @normal-foreground;
135 | }
136 | inputbar {
137 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
138 | }
139 | textbox-prompt-colon {
140 | expand: false;
141 | str: ":";
142 | margin: 0px 0.3em 0em 0em;
143 | text-color: @normal-foreground;
144 | }
145 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/rofidmenu.rasi:
--------------------------------------------------------------------------------
1 | /*******************************************************
2 | * ROFI configs i3 Apps menu for EndeavourOS
3 | * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
4 | *******************************************************/
5 | configuration {
6 | font: "FiraCode Nerd Font medium 10";
7 | show-icons: true;
8 | icon-theme: "Qogir";
9 | display-drun: "Apps";
10 | drun-display-format: "{name}";
11 | scroll-method: 0;
12 | disable-history: false;
13 | sidebar-mode: false;
14 | }
15 |
16 | @import "~/.config/rofi/arc_dark_transparent_colors.rasi"
17 |
18 | window {
19 | transparency: "real";
20 | background-color: @background;
21 | border: 2;
22 | border-color: #585b70;
23 | padding: 30;
24 | border-radius: 10;
25 | }
26 | listview {
27 | lines: 10;
28 | columns: 3;
29 | }
30 | mainbox {
31 | border: 0;
32 | padding: 0;
33 | }
34 | message {
35 | border: 2px 0px 0px;
36 | border-color: @separatorcolor;
37 | padding: 1px;
38 | }
39 | textbox {
40 | text-color: @foreground;
41 | }
42 | listview {
43 | fixed-height: 0;
44 | border: 8px 0px 0px;
45 | border-color: @separatorcolor;
46 | spacing: 8px;
47 | scrollbar: false;
48 | padding: 2px 0px 0px;
49 | }
50 | element {
51 | border: 0;
52 | padding: 1px;
53 | }
54 | element-text {
55 | background-color: inherit;
56 | text-color: inherit;
57 | }
58 | element.normal.normal {
59 | background-color: @normal-background;
60 | text-color: @normal-foreground;
61 | }
62 | element.normal.urgent {
63 | background-color: @urgent-background;
64 | text-color: @urgent-foreground;
65 | }
66 | element.normal.active {
67 | background-color: @active-background;
68 | text-color: @active-foreground;
69 | }
70 | element.selected.normal {
71 | background-color: @selected-normal-background;
72 | text-color: @selected-normal-foreground;
73 | }
74 | element.selected.urgent {
75 | background-color: @selected-urgent-background;
76 | text-color: @selected-urgent-foreground;
77 | }
78 | element.selected.active {
79 | background-color: @selected-active-background;
80 | text-color: @selected-active-foreground;
81 | }
82 | element.alternate.normal {
83 | background-color: @alternate-normal-background;
84 | text-color: @alternate-normal-foreground;
85 | }
86 | element.alternate.urgent {
87 | background-color: @alternate-urgent-background;
88 | text-color: @alternate-urgent-foreground;
89 | }
90 | element.alternate.active {
91 | background-color: @alternate-active-background;
92 | text-color: @alternate-active-foreground;
93 | }
94 | scrollbar {
95 | width: 4px;
96 | border: 0;
97 | handle-color: @normal-foreground;
98 | handle-width: 8px;
99 | padding: 0;
100 | }
101 | mode-switcher {
102 | border: 2px 0px 0px;
103 | border-color: @separatorcolor;
104 | }
105 | button {
106 | spacing: 0;
107 | text-color: @normal-foreground;
108 | }
109 | button.selected {
110 | background-color: @selected-normal-background;
111 | text-color: @selected-normal-foreground;
112 | }
113 | inputbar {
114 | spacing: 0;
115 | text-color: @normal-foreground;
116 | padding: 1px;
117 | }
118 | case-indicator {
119 | spacing: 0;
120 | text-color: @normal-foreground;
121 | }
122 | entry {
123 | placeholder: " Cerca ";
124 | spacing: 0;
125 | text-color: @normal-foreground;
126 | }
127 | prompt {
128 | spacing: 0;
129 | text-color: @normal-foreground;
130 | }
131 | inputbar {
132 | children: [ textbox-prompt-colon,entry,case-indicator ];
133 | }
134 | textbox-prompt-colon {
135 | expand: false;
136 | str: " " ;
137 | margin: 0px 0.3em 0em 0em;
138 | text-color: #f38ba8;
139 | }
140 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/rofitodo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TODO_FILE=~/.rofi_todos
3 |
4 | if [[ ! -a "${TODO_FILE}" ]]; then
5 | touch "${TODO_FILE}"
6 | fi
7 |
8 | function add_todo() {
9 | echo -e "$*" >> "${TODO_FILE}"
10 | }
11 |
12 | function remove_todo() {
13 | if [[ ! -z "$DONE_FILE" ]]; then
14 | echo "${*}" >> "${DONE_FILE}"
15 | fi
16 | wl-copy ${*}
17 | sed -i "/^${*}$/d" "${TODO_FILE}"
18 | }
19 |
20 | function get_todos() {
21 | echo "$(cat "${TODO_FILE}")"
22 | }
23 |
24 | if [ -z "$@" ]; then
25 | get_todos
26 | else
27 | LINE=$(echo "${@}" | sed "s/\([^a-zA-Z0-9]\)/\\\\\\1/g")
28 | LINE_UNESCAPED=${@}
29 | if [[ $LINE_UNESCAPED == +* ]]; then
30 | LINE_UNESCAPED=$(echo $LINE_UNESCAPED | sed s/^+//g |sed s/^\s+//g )
31 | add_todo ${LINE_UNESCAPED}
32 | else
33 | MATCHING=$(grep "^${LINE_UNESCAPED}$" "${TODO_FILE}")
34 | if [[ -n "${MATCHING}" ]]; then
35 | remove_todo ${LINE_UNESCAPED}
36 | fi
37 | fi
38 | get_todos
39 | fi
40 |
--------------------------------------------------------------------------------
/Swayfx_port (not maintained)/rofi/todo.rasi:
--------------------------------------------------------------------------------
1 | /*******************************************************
2 | * ROFI configs i3 Apps menu for EndeavourOS
3 | * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
4 | *******************************************************/
5 | configuration {
6 | font: "Firacode Nerd Font medium 10";
7 | show-icons: true;
8 | icon-theme: "Qogir";
9 | display-drun: "Apps";
10 | drun-display-format: "{name}";
11 | scroll-method: 0;
12 | disable-history: false;
13 | sidebar-mode: false;
14 | location: 3;
15 | }
16 |
17 | @import "~/.config/rofi/arc_dark_transparent_colors.rasi"
18 |
19 | window {
20 | background-color: @background;
21 | border: 2;
22 | padding: 5;
23 | width: 300px;
24 | border-color: #89b4fa;
25 | border-radius: 10;
26 | x-offset: -20px;
27 | y-offset: 20px;
28 | }
29 | listview {
30 | lines: 5;
31 | columns: 1;
32 | }
33 | mainbox {
34 | border: 0;
35 | padding: 0;
36 | }
37 | message {
38 | border: 2px 0px 0px;
39 | border-color: @separatorcolor;
40 | padding: 1px;
41 | }
42 | textbox {
43 | text-color: @foreground;
44 | }
45 | listview {
46 | fixed-height: 0;
47 | border: 8px 0px 0px;
48 | border-color: @separatorcolor;
49 | spacing: 8px;
50 | scrollbar: false;
51 | padding: 2px 0px 0px;
52 | }
53 | element {
54 | border: 0;
55 | padding: 1px;
56 | }
57 | element-text {
58 | background-color: inherit;
59 | text-color: inherit;
60 | }
61 | element.normal.normal {
62 | background-color: @normal-background;
63 | text-color: @normal-foreground;
64 | }
65 | element.normal.urgent {
66 | background-color: @urgent-background;
67 | text-color: @urgent-foreground;
68 | }
69 | element.normal.active {
70 | background-color: @active-background;
71 | text-color: #89b4fa;
72 | }
73 | element.selected.normal {
74 | background-color: #181825;
75 | text-color: #89b4fa;
76 | }
77 | element.selected.urgent {
78 | background-color: @selected-urgent-background;
79 | text-color: @selected-urgent-foreground;
80 | }
81 | element.selected.active {
82 | background-color: @selected-active-background;
83 | text-color: #89b4fa;
84 | }
85 | element.alternate.normal {
86 | background-color: @alternate-normal-background;
87 | text-color: @alternate-normal-foreground;
88 | }
89 | element.alternate.urgent {
90 | background-color: @alternate-urgent-background;
91 | text-color: @alternate-urgent-foreground;
92 | }
93 | element.alternate.active {
94 | background-color: @alternate-active-background;
95 | text-color: @alternate-active-foreground;
96 | }
97 | scrollbar {
98 | width: 4px;
99 | border: 0;
100 | handle-color: @normal-foreground;
101 | handle-width: 8px;
102 | padding: 0;
103 | }
104 | mode-switcher {
105 | border: 2px 0px 0px;
106 | border-color: @separatorcolor;
107 | }
108 | button {
109 | spacing: 0;
110 | text-color: @normal-foreground;
111 | }
112 | button.selected {
113 | background-color: @selected-normal-background;
114 | text-color: @selected-normal-foreground;
115 | }
116 | inputbar {
117 | spacing: 0;
118 | text-color: @normal-foreground;
119 | padding: 1px;
120 | }
121 | case-indicator {
122 | spacing: 0;
123 | text-color: @normal-foreground;
124 | }
125 | entry {
126 | placeholder: " + Todo";
127 | spacing: 0;
128 | text-color: @normal-foreground;
129 | }
130 | prompt {
131 | enabled: false;
132 | spacing: 0;
133 | text-color: @normal-foreground;
134 | }
135 | inputbar {
136 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
137 | }
138 | textbox-prompt-colon {
139 | expand: false;
140 | str: " ";
141 | margin: 0px 0.3em 0em 0em;
142 | text-color: #89b4fa;
143 | }
144 |
--------------------------------------------------------------------------------
/bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/bar.png
--------------------------------------------------------------------------------
/barpc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/barpc.png
--------------------------------------------------------------------------------
/combined.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/combined.png
--------------------------------------------------------------------------------
/dunst/dunstrc:
--------------------------------------------------------------------------------
1 | # See dunst(5) for all configuration options
2 |
3 | [global]
4 | ### Display ###
5 |
6 | # Which monitor should the notifications be displayed on.
7 | monitor = 0
8 |
9 | # Display notification on focused monitor. Possible modes are:
10 | # mouse: follow mouse pointer
11 | # keyboard: follow window with keyboard focus
12 | # none: don't follow anything
13 | #
14 | # "keyboard" needs a window manager that exports the
15 | # _NET_ACTIVE_WINDOW property.
16 | # This should be the case for almost all modern window managers.
17 | #
18 | # If this option is set to mouse or keyboard, the monitor option
19 | # will be ignored.
20 | follow = none
21 |
22 | ### Geometry ###
23 |
24 | # dynamic width from 0 to 300
25 | # width = (0, 300)
26 | # constant width of 300
27 | width = 300
28 |
29 | # The maximum height of a single notification, excluding the frame.
30 | height = 300
31 |
32 | # Position the notification in the top right corner
33 | origin = top-right
34 |
35 | # Offset from the origin
36 | offset = 40x60
37 |
38 | # Scale factor. It is auto-detected if value is 0.
39 | scale = 0
40 |
41 | # Maximum number of notification (0 means no limit)
42 | notification_limit = 5
43 | ### Progress bar ###
44 |
45 | # Turn on the progress bar. It appears when a progress hint is passed with
46 | # for example dunstify -h int:value:12
47 | progress_bar = true
48 |
49 | # Set the progress bar height. This includes the frame, so make sure
50 | # it's at least twice as big as the frame width.
51 | progress_bar_height = 10
52 |
53 | # Set the frame width of the progress bar
54 | progress_bar_frame_width = 1
55 |
56 | # Set the minimum width for the progress bar
57 | progress_bar_min_width = 150
58 |
59 | # Set the maximum width for the progress bar
60 | progress_bar_max_width = 300
61 |
62 |
63 | # Show how many messages are currently hidden (because of
64 | # notification_limit).
65 | indicate_hidden = yes
66 |
67 | # The transparency of the window. Range: [0; 100].
68 | # This option will only work if a compositing window manager is
69 | # present (e.g. xcompmgr, compiz, etc.). (X11 only)
70 | transparency = 15
71 |
72 | # Draw a line of "separator_height" pixel height between two
73 | # notifications.
74 | # Set to 0 to disable.
75 | separator_height = 2
76 |
77 | # Padding between text and separator.
78 | padding = 8
79 |
80 | # Horizontal padding.
81 | horizontal_padding = 8
82 |
83 | # Padding between text and icon.
84 | text_icon_padding = 0
85 |
86 | # Defines width in pixels of frame around the notification window.
87 | # Set to 0 to disable.
88 | frame_width = 2
89 |
90 | # Defines color of the frame around the notification window.
91 | frame_color = "#a6e3a1"
92 |
93 | # Define a color for the separator.
94 | # possible values are:
95 | # * auto: dunst tries to find a color fitting to the background;
96 | # * foreground: use the same color as the foreground;
97 | # * frame: use the same color as the frame;
98 | # * anything else will be interpreted as a X color.
99 | separator_color = auto
100 |
101 | # Sort messages by urgency.
102 | sort = yes
103 |
104 | # Don't remove messages, if the user is idle (no mouse or keyboard input)
105 | # for longer than idle_threshold seconds.
106 | # Set to 0 to disable.
107 | # A client can set the 'transient' hint to bypass this. See the rules
108 | # section for how to disable this if necessary
109 | idle_threshold = 0
110 |
111 | ### Text ###
112 |
113 | font = Noto Sans Regular 9
114 |
115 | # The spacing between lines. If the height is smaller than the
116 | # font height, it will get raised to the font height.
117 | line_height = 0
118 |
119 | # Possible values are:
120 | # full: Allow a small subset of html markup in notifications:
121 | # bold
122 | # italic
123 | # strikethrough
124 | # underline
125 | #
126 | # For a complete reference see
127 | # .
128 | #
129 | # strip: This setting is provided for compatibility with some broken
130 | # clients that send markup even though it's not enabled on the
131 | # server. Dunst will try to strip the markup but the parsing is
132 | # simplistic so using this option outside of matching rules for
133 | # specific applications *IS GREATLY DISCOURAGED*.
134 | #
135 | # no: Disable markup parsing, incoming notifications will be treated as
136 | # plain text. Dunst will not advertise that it has the body-markup
137 | # capability if this is set as a global setting.
138 | #
139 | # It's important to note that markup inside the format option will be parsed
140 | # regardless of what this is set to.
141 | markup = full
142 |
143 | # The format of the message. Possible variables are:
144 | # %a appname
145 | # %s summary
146 | # %b body
147 | # %i iconname (including its path)
148 | # %I iconname (without its path)
149 | # %p progress value if set ([ 0%] to [100%]) or nothing
150 | # %n progress value if set without any extra characters
151 | # %% Literal %
152 | # Markup is allowed
153 | format = "%s\n%b"
154 |
155 | # Alignment of message text.
156 | # Possible values are "left", "center" and "right".
157 | alignment = left
158 |
159 | # Vertical alignment of message text and icon.
160 | # Possible values are "top", "center" and "bottom".
161 | vertical_alignment = center
162 |
163 | # Show age of message if message is older than show_age_threshold
164 | # seconds.
165 | # Set to -1 to disable.
166 | show_age_threshold = 60
167 |
168 | # Specify where to make an ellipsis in long lines.
169 | # Possible values are "start", "middle" and "end".
170 | ellipsize = middle
171 |
172 | # Ignore newlines '\n' in notifications.
173 | ignore_newline = no
174 |
175 | # Stack together notifications with the same content
176 | stack_duplicates = true
177 |
178 | # Hide the count of stacked notifications with the same content
179 | hide_duplicate_count = true
180 |
181 | # Display indicators for URLs (U) and actions (A).
182 | show_indicators = yes
183 |
184 | ### Icons ###
185 |
186 | # Align icons left/right/off
187 | icon_position = left
188 |
189 | # Scale small icons up to this size, set to 0 to disable. Helpful
190 | # for e.g. small files or high-dpi screens. In case of conflict,
191 | # max_icon_size takes precedence over this.
192 | min_icon_size = 0
193 |
194 | # Scale larger icons down to this size, set to 0 to disable
195 | max_icon_size = 32
196 |
197 | # Paths to default icons.
198 | #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
199 | icon_path = /usr/share/icons/Qogir/16/status:/usr/share/icons/Qogir/16/devices/:/usr/share/icons/Qogir/24/panel/:/usr/share/icons/Qogir/16/apps/:/usr/share/pixmaps/
200 | ### History ###
201 |
202 | # Should a notification popped up from history be sticky or timeout
203 | # as if it would normally do.
204 | sticky_history = false
205 |
206 | # Maximum amount of notifications kept in history
207 | history_length = 0
208 |
209 | ### Misc/Advanced ###
210 |
211 | # dmenu path.
212 | dmenu = /usr/bin/dmenu -p dunst:
213 |
214 | # Browser for opening urls in context menu.
215 | browser = /usr/bin/xdg-open
216 |
217 | # Always run rule-defined scripts, even if the notification is suppressed
218 | always_run_script = true
219 |
220 | # Define the title of the windows spawned by dunst
221 | title = Dunst
222 |
223 | # Define the class of the windows spawned by dunst
224 | class = Dunst
225 |
226 | # Define the corner radius of the notification window
227 | # in pixel size. If the radius is 0, you have no rounded
228 | # corners.
229 | # The radius will be automatically lowered if it exceeds half of the
230 | # notification height to avoid clipping text and/or icons.
231 | #corner_radius = 10
232 |
233 | # Ignore the dbus closeNotification message.
234 | # Useful to enforce the timeout set by dunst configuration. Without this
235 | # parameter, an application may close the notification sent before the
236 | # user defined timeout.
237 | ignore_dbusclose = false
238 |
239 | ### Wayland ###
240 | # These settings are Wayland-specific. They have no effect when using X11
241 |
242 | # Uncomment this if you want to let notications appear under fullscreen
243 | # applications (default: overlay)
244 | # layer = top
245 |
246 | # Set this to true to use X11 output on Wayland.
247 | force_xwayland = false
248 |
249 | ### Legacy
250 |
251 | # Use the Xinerama extension instead of RandR for multi-monitor support.
252 | # This setting is provided for compatibility with older nVidia drivers that
253 | # do not support RandR and using it on systems that support RandR is highly
254 | # discouraged.
255 | #
256 | # By enabling this setting dunst will not be able to detect when a monitor
257 | # is connected or disconnected which might break follow mode if the screen
258 | # layout changes.
259 | force_xinerama = false
260 |
261 | ### mouse
262 |
263 | # Defines list of actions for each mouse event
264 | # Possible values are:
265 | # * none: Don't do anything.
266 | # * do_action: Invoke the action determined by the action_name rule. If there is no
267 | # such action, open the context menu.
268 | # * open_url: If the notification has exactly one url, open it. If there are multiple
269 | # ones, open the context menu.
270 | # * close_current: Close current notification.
271 | # * close_all: Close all notifications.
272 | # * context: Open context menu for the notification.
273 | # * context_all: Open context menu for all notifications.
274 | # These values can be strung together for each mouse event, and
275 | # will be executed in sequence.
276 | mouse_left_click = close_current
277 | mouse_middle_click = do_action, close_current
278 | mouse_right_click = close_all
279 |
280 | # Experimental features that may or may not work correctly. Do not expect them
281 | # to have a consistent behaviour across releases.
282 | [experimental]
283 | # Calculate the dpi to use on a per-monitor basis.
284 | # If this setting is enabled the Xft.dpi value will be ignored and instead
285 | # dunst will attempt to calculate an appropriate dpi value for each monitor
286 | # using the resolution and physical size. This might be useful in setups
287 | # where there are multiple screens with very different dpi values.
288 | per_monitor_dpi = false
289 |
290 |
291 | [urgency_low]
292 | # IMPORTANT: colors have to be defined in quotation marks.
293 | # Otherwise the "#" and following would be interpreted as a comment.
294 | background = "#313244"
295 | foreground = "#ffffff"
296 | timeout = 5
297 | # Icon for notifications with low urgency, uncomment to enable
298 | icon = /usr/share/icons/Arc-X-D/status/16/dialog-information.png
299 |
300 | [urgency_normal]
301 | background = "#313244"
302 | foreground = "#ffffff"
303 | timeout = 5
304 | # Icon for notifications with normal urgency, uncomment to enable
305 | icon = /usr/share/icons/Arc-X-D/status/16/dialog-question.png
306 |
307 | [urgency_critical]
308 | background = "#313244"
309 | foreground = "#ffffff"
310 | frame_color = "#f38ba8"
311 | timeout = 120
312 | # Icon for notifications with critical urgency, uncomment to enable
313 | icon = /usr/share/icons/Arc-X-D/status/16/dialog-warning.png
314 |
315 | # Every section that isn't one of the above is interpreted as a rules to
316 | # override settings for certain messages.
317 | #
318 | # Messages can be matched by
319 | # appname (discouraged, see desktop_entry)
320 | # body
321 | # category
322 | # desktop_entry
323 | # icon
324 | # match_transient
325 | # msg_urgency
326 | # stack_tag
327 | # summary
328 | #
329 | # and you can override the
330 | # background
331 | # foreground
332 | # format
333 | # frame_color
334 | # fullscreen
335 | # new_icon
336 | # set_stack_tag
337 | # set_transient
338 | # set_category
339 | # timeout
340 | # urgency
341 | # skip_display
342 | # history_ignore
343 | # action_name
344 | # word_wrap
345 | # ellipsize
346 | # alignment
347 | #
348 | # Shell-like globing will get expanded.
349 | #
350 | # Instead of the appname filter, it's recommended to use the desktop_entry filter.
351 | # GLib based applications export their desktop-entry name. In comparison to the appname,
352 | # the desktop-entry won't get localized.
353 | #
354 | # SCRIPTING
355 | # You can specify a script that gets run when the rule matches by
356 | # setting the "script" option.
357 | # The script will be called as follows:
358 | # script appname summary body icon urgency
359 | # where urgency can be "LOW", "NORMAL" or "CRITICAL".
360 | #
361 | # NOTE: It might be helpful to run dunst -print in a terminal in order
362 | # to find fitting options for rules.
363 |
364 | # Disable the transient hint so that idle_threshold cannot be bypassed from the
365 | # client
366 | #[transient_disable]
367 | # match_transient = yes
368 | # set_transient = no
369 | #
370 | # Make the handling of transient notifications more strict by making them not
371 | # be placed in history.
372 | #[transient_history_ignore]
373 | # match_transient = yes
374 | # history_ignore = yes
375 |
376 | # fullscreen values
377 | # show: show the notifications, regardless if there is a fullscreen window opened
378 | # delay: displays the new notification, if there is no fullscreen window active
379 | # If the notification is already drawn, it won't get undrawn.
380 | # pushback: same as delay, but when switching into fullscreen, the notification will get
381 | # withdrawn from screen again and will get delayed like a new notification
382 | #[fullscreen_delay_everything]
383 | # fullscreen = delay
384 | #[fullscreen_show_critical]
385 | # msg_urgency = critical
386 | # fullscreen = show
387 |
388 | #[espeak]
389 | # summary = "*"
390 | # script = dunst_espeak.sh
391 |
392 | #[script-test]
393 | # summary = "*script*"
394 | # script = dunst_test.sh
395 |
396 | #[ignore]
397 | # # This notification will not be displayed
398 | # summary = "foobar"
399 | # skip_display = true
400 |
401 | #[history-ignore]
402 | # # This notification will not be saved in history
403 | # summary = "foobar"
404 | # history_ignore = yes
405 |
406 | #[skip-display]
407 | # # This notification will not be displayed, but will be included in the history
408 | # summary = "foobar"
409 | # skip_display = yes
410 |
411 | #[signed_on]
412 | # appname = Pidgin
413 | # summary = "*signed on*"
414 | # urgency = low
415 | #
416 | #[signed_off]
417 | # appname = Pidgin
418 | # summary = *signed off*
419 | # urgency = low
420 | #
421 | #[says]
422 | # appname = Pidgin
423 | # summary = *says*
424 | # urgency = critical
425 | #
426 | #[twitter]
427 | # appname = Pidgin
428 | # summary = *twitter.com*
429 | # urgency = normal
430 | #
431 | [stack-volumes]
432 | appname = "some_volume_notifiers"
433 | set_stack_tag = "volume"
434 | #
435 | # vim: ft=cfg
436 |
--------------------------------------------------------------------------------
/i3/i3blocks.conf:
--------------------------------------------------------------------------------
1 | # File configurazione i3block
2 |
3 |
4 | separator=false
5 | markup=pango
6 | separator_block_width=6
7 | color=#cdd6f4
8 |
9 |
10 |
11 | [search]
12 | full_text=
13 | color=#f38ba8
14 | command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi
15 |
16 | #[files]
17 | #full_text=
18 | #color=#cba6f7
19 | #command=i3-msg -q exec thunar ~/
20 |
21 | [todo]
22 | full_text=
23 | color=#89b4fa
24 | command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo
25 |
26 | [wallpaper]
27 | full_text=
28 | color=#fab387
29 | command=~/.config/i3/scripts/miei/wallpaper.sh
30 |
31 | [expander]
32 | full_text=
33 | command=i3-msg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh"
34 | color=#b4befe
35 |
36 | [terminal]
37 | full_text=
38 | color=#94e2d5
39 | command=i3-msg -q exec kitty
40 |
41 |
42 | [close]
43 | full_text=
44 | color=#f38ba8
45 | command=i3-msg -q kill
46 | separator_block_width=0
47 |
48 | [simple-2]
49 | full_text=:
50 | color=#717171
51 |
52 | [meteo]
53 | command=~/.config/i3/scripts/miei/meteo.sh
54 | interval=1000
55 |
56 | [separator]
57 | full_text="⟨"
58 | color=#585b70
59 |
60 | [cpu_usage]
61 | full_text=
62 | label=
63 | command=~/.config/i3/scripts/miei/cpu.sh
64 | interval=10
65 |
66 | #[separator]
67 | #full_text="⟨"
68 | #color=#585b70
69 |
70 | #[news]
71 | #full_text=""
72 | #command=~/.config/i3/scripts/miei/feed.sh
73 | #interval=once
74 |
75 |
76 | [separator]
77 | full_text="⟨"
78 | color=#585b70
79 |
80 | #[pavucontrol]
81 | #full_text=
82 | #command=pavucontrol
83 |
84 | [volume-pulseaudio]
85 | command=~/.config/i3/scripts/volume
86 | instance=Master
87 | interval=1
88 |
89 |
90 | #[timer]
91 | #full_text=
92 | #command=~/.config/i3/scripts/miei/timer.sh
93 | #interval=1
94 |
95 |
96 | [separator]
97 | full_text="⟨"
98 | color=#585b70
99 |
100 | [pomodoro]
101 | command=~/.config/i3/scripts/pomodoro.sh
102 | interval=1
103 |
104 | [separator]
105 | full_text="⟨"
106 | color=#585b70
107 |
108 | [gestione_energia]
109 | full_text=
110 | command=/home/flavio/.config/i3/scripts/miei/energia_3mode.sh
111 | interval=once
112 |
113 |
114 |
115 | [separator]
116 | full_text="⟨"
117 | color=#585b70
118 |
119 | #[battery]
120 | #command=~/.config/i3/scripts/battery2
121 | #label=
122 | #interval=30
123 |
124 | #[separator]
125 | #full_text="|"
126 |
127 | #[separator]
128 | #full_text="|"
129 | #color=#585b70
130 | [icona]
131 | full_text=
132 |
133 | [battery]
134 | command=~/.config/i3/scripts/miei/power.sh
135 | label=
136 | interval=1
137 |
138 | [separator]
139 | full_text="⟨"
140 | color=#585b70
141 |
142 | [time]
143 | full_text=
144 | label=
145 | interval=1
146 | command=~/.config/i3/scripts/miei/ora.sh
147 | separator_block_width=10
148 | color=#b4befe
149 |
150 | #color=#f38ba8
151 |
152 | [separator]
153 | full_text=" "
154 | separator_block_width=0
155 | background=#272836
156 |
157 |
158 |
159 |
160 | [shutdown_menu]
161 | full_text= ⏼
162 | #full_text= ⏼
163 | command=~/.config/i3/scripts/powermenu
164 | #color=#b4befe
165 |
166 | #color=#f5e0dc
167 | #background=#e71853
168 | background=#313244
169 | #separator_block_width=0
170 | #color=#f38ba8
171 | separator_block_width=0
172 |
173 |
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/i3/scripts/bell.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3/scripts/bell.wav
--------------------------------------------------------------------------------
/i3/scripts/bell_end.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3/scripts/bell_end.wav
--------------------------------------------------------------------------------
/i3/scripts/blur-lock:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | PICTURE=/tmp/i3lock.png
4 | SCREENSHOT="scrot -z $PICTURE"
5 |
6 | BLUR="5x4"
7 |
8 | $SCREENSHOT
9 | convert $PICTURE -blur $BLUR $PICTURE
10 | i3lock -i $PICTURE
11 | rm $PICTURE
12 |
--------------------------------------------------------------------------------
/i3/scripts/miei/active.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ -f /tmp/tray ]; then
3 | var=$(cat /tmp/tray)
4 | if [ $var == 1 ]; then
5 | echo 0 > /tmp/tray
6 | i3-msg -q "bar mode dock bar-tray"
7 | i3-msg -q "bar mode invisible bar-primary"
8 | fi
9 |
10 | if [ $var == 0 ]; then
11 | echo 1 > /tmp/tray
12 | i3-msg -q "bar mode invisible bar-tray"
13 | i3-msg -q "bar mode dock bar-primary"
14 |
15 | fi
16 | else
17 | echo 0 > /tmp/tray
18 | i3-msg -q "bar mode dock bar-tray"
19 | i3-msg -q "bar mode invisible bar-primary"
20 | fi
21 |
--------------------------------------------------------------------------------
/i3/scripts/miei/cpu.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ $BLOCK_BUTTON == 1 ]; then
3 | kitty -e htop
4 | fi
5 |
6 | echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"
7 |
--------------------------------------------------------------------------------
/i3/scripts/miei/energia.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/energia.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]; then
20 |
21 | echo " Pro"
22 | powerprofilesctl set balanced
23 |
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | echo " Eco"
28 | powerprofilesctl set power-saver
29 | fi
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/i3/scripts/miei/energia_3mode.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | file=/tmp/powerprofile
3 |
4 | if ! test -f $file; then
5 | echo 0 > $file
6 | powerprofilesctl set power-saver
7 | fi
8 |
9 | a=$(cat $file)
10 |
11 | if [ $BLOCK_BUTTON == 1 ]
12 | then
13 | if [ $a == 0 ]
14 | then
15 | echo 1 > $file
16 | echo " Blc"
17 | powerprofilesctl set balanced
18 | fi
19 |
20 | if [ $a == 1 ]
21 | then
22 | echo 2 > $file
23 | echo " Pro"
24 | powerprofilesctl set performance
25 | fi
26 |
27 | if [ $a == 2 ]
28 | then
29 | echo 0 > $file
30 | echo " Eco"
31 | powerprofilesctl set power-saver
32 | fi
33 | fi
34 |
35 | if [ $a == 1 ]; then
36 | echo " Blc"
37 | fi
38 |
39 | if [ $a == 0 ]; then
40 | echo " Eco"
41 | fi
42 |
43 | if [ $a == 2 ]; then
44 | echo " Pro"
45 | fi
46 |
--------------------------------------------------------------------------------
/i3/scripts/miei/feed.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/feed.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]
20 | then
21 | echo " $(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=)')"
22 | else
23 | echo " News"
24 | fi
25 |
26 | if [ $BLOCK_BUTTON == 3 ]; then
27 | xdg-open https://www.lescienze.it/news/
28 | fi
29 |
30 |
--------------------------------------------------------------------------------
/i3/scripts/miei/full_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # quando lo clicco mi ricarica il dispositivo fino al 100% e poi disabilita la feature
4 | path="/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/VPC2004:00/conservation_mode"
5 | value=$(cat $path)
6 | if [ $value -eq "" ];then
7 | echo "only ideapad"
8 | fi
9 |
10 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
11 |
12 | if [ $BLOCK_BUTTON -eq 1 ] && [ $value -eq "1" ];then
13 | echo " full"
14 | echo $PASSW | sudo -S sh -c "echo 0 > $path"
15 | fi
16 |
17 |
18 | if [ $level -ge "95" ] && [ $value -eq "0" ];then
19 | echo " Csv"
20 | echo $PASSW | sudo -S sh -c "echo 1 > $path"
21 | fi
22 |
23 | if [ $value -eq 0 ];then
24 | echo " full"
25 | else
26 | echo " Csv"
27 | fi
28 |
29 |
30 |
--------------------------------------------------------------------------------
/i3/scripts/miei/meteo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | meteo=$(curl wttr.in/Sedriano?format=1| xargs echo)
3 | first="${meteo%% *}"
4 | if [ "$meteo" == "" ] || [ "$first" == "Unknown" ]; then
5 | echo " Off"
6 |
7 | else
8 | echo $meteo
9 | fi
10 |
--------------------------------------------------------------------------------
/i3/scripts/miei/ora.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=1
3 |
4 | path=~/.config/i3/scripts/miei/ora.sh
5 |
6 | cambia_var () {
7 | if [ $a == 0 ]; then
8 | sed -i '2d' $path
9 | sed -i '2ia=1' $path
10 | # se non mostri la variabile subito ci sarà il delay di interval
11 | a=1
12 | return 1
13 | fi
14 | if [ $a == 1 ]; then
15 | sed -i '2d' $path
16 | sed -i '2ia=0' $path
17 | a=0
18 | return 0
19 | fi
20 | }
21 |
22 | if [ $BLOCK_BUTTON == 1 ]; then
23 | cambia_var
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | date '+%a %d %b %H:%M'
28 | fi
29 |
30 | if [ $a == 1 ]; then
31 | date '+%H:%M'
32 | fi
33 |
34 |
--------------------------------------------------------------------------------
/i3/scripts/miei/power.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then
8 | ~/.config/i3/scripts/miei/power_charge.sh
9 | exit 1
10 | fi
11 |
12 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
13 |
14 | unit=20
15 | vite=$(($level/unit))
16 |
17 | if [ $vite == 5 ]; then
18 | echo ""
19 | echo ""
20 | echo "#cdd6f4"
21 | fi
22 |
23 | if [ $vite == 4 ]; then
24 | echo ""
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 3 ]; then
29 | echo ""
30 | echo ""
31 | echo "#a6e3a1"
32 | fi
33 | if [ $vite == 2 ]; then
34 | echo ""
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ $vite == 1 ]; then
39 | echo ""
40 | echo ""
41 | echo "#fab387"
42 | fi
43 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
44 | echo ""
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 | if [ "$level" -lt "10" ]; then
49 | echo "!"
50 | echo ""
51 | echo "#f38ba8"
52 | fi
53 |
--------------------------------------------------------------------------------
/i3/scripts/miei/power_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
8 |
9 | unit=20
10 | vite=$(($level/unit))
11 |
12 | if [ $vite == 5 ]; then
13 | echo " "
14 | echo ""
15 | echo "#cdd6f4"
16 | fi
17 |
18 | if [ $vite == 4 ]; then
19 | echo " "
20 | echo ""
21 | echo "#a6e3a1"
22 | fi
23 | if [ $vite == 3 ]; then
24 | echo " "
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 2 ]; then
29 | echo " "
30 | echo ""
31 | echo "#fab387"
32 | fi
33 | if [ $vite == 1 ]; then
34 | echo " "
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
39 | echo " "
40 | echo ""
41 | echo "#f38ba8"
42 | fi
43 | if [ "$level" -lt "10" ]; then
44 | echo " !"
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 |
--------------------------------------------------------------------------------
/i3/scripts/miei/schermata.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=$(date +"%Y-%m-%d-%T")-schermata.png
3 |
4 | maim --select ~/Immagini/Schermate/$a
5 | notify-send "Screenshot saved to ~/$a"
6 | #kdialog --yesno "Screenshot salvato, vuoi aprirlo?"
7 | #if [ $? == 0 ]; then
8 | eog ~/Immagini/Schermate/$a
9 | #fi
10 |
11 |
--------------------------------------------------------------------------------
/i3/scripts/miei/timer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #creazione meccanismo di cambiamento timer modalità m (modifica)
3 | path=/tmp/miotimer
4 |
5 | modifica () {
6 | if [ $BLOCK_BUTTON == 4 ];then
7 | current=$((current + 1))
8 | echo $mode > $path
9 | echo $current >> $path
10 | fi
11 | if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then
12 | current=$((current - 1))
13 | echo $mode > $path
14 | echo $current >> $path
15 | fi
16 | if [ $current == 0 ];then
17 | echo " Tmr"
18 | else
19 | echo " $(sed '2!d' $path) m"
20 | echo ""
21 | echo "#f9e2af"
22 | fi
23 | }
24 |
25 | timer () {
26 | start=$(sed '2!d' $path)
27 | start=$((start * 60))
28 | now=$(date +%s)
29 | first=$(sed '3!d' $path)
30 | manca=$((start-now+first))
31 | if [ $manca != 0 ];then
32 | echo " $((manca / 60)):$((manca % 60))"
33 | echo ""
34 | echo "#a6e3a1"
35 |
36 | else
37 | echo " Tmr"
38 | notify-send "Timer is over"
39 | rm $path
40 | fi
41 | }
42 |
43 |
44 |
45 |
46 | if [ -f $path ]
47 | then
48 |
49 |
50 | mode=$(sed '1!d' $path)
51 | current=$(sed '2!d' $path)
52 |
53 | if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then
54 | if [ $mode == "w" ];then
55 | rm $path
56 | echo " Tmr"
57 | exit
58 | fi
59 | mode=w
60 | echo $mode > $path
61 | echo $current >> $path
62 | echo $(date +%s) >> $path
63 | fi
64 |
65 |
66 | if [ $mode == "m" ];then
67 | modifica
68 | fi
69 |
70 | if [ $mode == "w" ];then
71 | timer
72 | fi
73 |
74 |
75 |
76 | else
77 | echo m > $path
78 | echo 0 >> $path
79 | echo " Tmr"
80 | fi
81 |
--------------------------------------------------------------------------------
/i3/scripts/miei/update.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | if [ $BLOCK_BUTTON -eq "1" ];then
4 | kitty -e sudo dnf upgrade
5 | kitty -e flatpak update
6 | fi
7 |
8 |
9 | numero=$(dnf check-update| grep -Ec ' updates$')
10 | if [ $numero -eq "0" ];then
11 | echo " "
12 | else
13 | echo " $numero"
14 | echo ""
15 | echo "#f9e2af"
16 | fi
17 |
--------------------------------------------------------------------------------
/i3/scripts/miei/wallpaper.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | w_path=~/.config/wallpaper/
3 | c_path=~/.config/wallpaper/current
4 | config=~/.config/
5 | current=$(cat $c_path)
6 |
7 | if [ $BLOCK_BUTTON == 1 ];then
8 | new=$((current+1))
9 | if [ $new == 13 ]; then
10 | new=0
11 | fi
12 | fi
13 |
14 | if [ $BLOCK_BUTTON == 3 ];then
15 | new=$((current - 1))
16 | if [ $new == "-1" ]; then
17 | new=12
18 | fi
19 | fi
20 |
21 | rm "${config}sfondo.jpg"
22 | cp "$w_path$new.jpg" $config
23 | mv "$config$new.jpg" "${config}sfondo.jpg"
24 | sed -i '1d' $c_path
25 | echo $new >> $c_path
26 | feh --bg-fill ~/.config/sfondo.jpg
27 |
--------------------------------------------------------------------------------
/i3/scripts/pomodoro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ -f /tmp/pomo_timer ];then
3 | pluto=$(cat /tmp/pomo_timer)
4 |
5 | case $BLOCK_BUTTON in
6 | 3) if [ $pluto -eq "0" ];then
7 | echo "1" > /tmp/pomo_timer
8 | pluto=1
9 | else
10 | echo "0" > /tmp/pomo_timer
11 | pluto=0
12 | fi
13 |
14 | ;;
15 | esac
16 |
17 |
18 |
19 | if [ $pluto -eq "0" ];then
20 |
21 | # Config variables
22 | # 40min = 2400s
23 | # 25min = 1500s
24 | # 20min = 1200s
25 | # 5min = 300s
26 |
27 | # In secondi
28 | work_time=2400
29 | break_time=1200
30 |
31 | msg_start=" Pom"
32 | work_prefix=" "
33 | break_prefix=" "
34 |
35 | #start_color="#b39df3"
36 | #start_color="#E06C75"
37 | start_color="#cdd6f4"
38 |
39 | break_color="#a6e3a1"
40 | work_color="#f38ba8"
41 |
42 | break_command="notify-send -t 2500 'Grab a tea'"
43 | work_command="notify-send -t 2500 'Time to work!'"
44 |
45 | pom_path="/tmp/pomodoro"
46 |
47 | function display () {
48 | min=$((s/60))
49 | sek=$((s%60))
50 | if [ $min -eq 0 ]
51 | then
52 | min=00
53 | elif [ $min -lt 10 ]
54 | then
55 | min=0$min
56 | fi
57 | if [ $sek -lt 10 ]
58 | then
59 | sek=0$sek
60 | fi
61 | case $2 in # richiamo alla seconda variabile, t
62 | w)
63 | echo "$work_prefix$min:$sek"
64 | echo $min:$sek
65 | echo $work_color
66 | ;;
67 | b)
68 | echo "$break_prefix$min:$sek"
69 | echo $min:$sek
70 | echo $break_color
71 | ;;
72 | esac
73 | }
74 |
75 | if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ]
76 | then
77 | p=$(sed '1 d' $pom_path) # time
78 | t=$(sed '2 d' $pom_path) # mode
79 | case $t in
80 | w) dur=$work_time;;
81 | b) dur=$break_time;;
82 | esac
83 | now=$(date +%s)
84 | s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione
85 | if [ $s -le 0 ] # if time less than 0 then switch mode
86 | then
87 | case $t in
88 | w)
89 | echo b > $pom_path
90 | eval "$break_command"
91 | paplay $HOME/.config/i3/scripts/bell.wav
92 | ;;
93 | b)
94 | echo w > $pom_path
95 | eval "$work_command"
96 | paplay $HOME/.config/i3/scripts/bell_end.wav
97 |
98 | ;;
99 | esac
100 | echo "$now" >> $pom_path
101 | fi
102 | display "$s" "$t"
103 | else
104 | echo "$msg_start"
105 | echo "$msg_start"
106 | echo "$start_color"
107 | fi
108 |
109 | case $BLOCK_BUTTON in
110 | 1)
111 | if [ -f $pom_path ]; then # if file exists then stop reset timer
112 | rm $pom_path
113 | else
114 | echo w > $pom_path # else start timer
115 | date +%s >> $pom_path
116 | fi
117 | ;;
118 | esac
119 | # è 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.
120 |
121 | fi
122 |
123 |
124 | if [ $pluto -eq "1" ];then
125 | ~/.config/i3/scripts/miei/timer.sh
126 | fi
127 |
128 | else
129 | echo "0" > /tmp/pomo_timer
130 | fi
131 |
132 |
133 |
--------------------------------------------------------------------------------
/i3/scripts/powermenu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Use rofi/zenity to change system runstate thanks to systemd.
4 | #
5 | # Note: this currently relies on associative array support in the shell.
6 | #
7 | # Inspired from i3pystatus wiki:
8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
9 | #
10 | # Copyright 2015 Benjamin Chrétien
11 | #
12 | # This program is free software: you can redistribute it and/or modify
13 | # it under the terms of the GNU General Public License as published by
14 | # the Free Software Foundation, either version 3 of the License, or
15 | # (at your option) any later version.
16 |
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 |
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program. If not, see .
24 |
25 | # modified to work with latest rofi update by joekamprad
26 |
27 | #######################################################################
28 | # BEGIN CONFIG #
29 | #######################################################################
30 |
31 | # Use a custom lock script
32 | #LOCKSCRIPT="i3lock-extra -m pixelize"
33 |
34 | # Colors: FG (foreground), BG (background), HL (highlighted)
35 | FG_COLOR="#bbbbbb"
36 | BG_COLOR="#111111"
37 | HLFG_COLOR="#111111"
38 | HLBG_COLOR="#bbbbbb"
39 | BORDER_COLOR="#222222"
40 |
41 | # Options not related to colors (most rofi options do not work anymore)
42 | ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi)
43 | # Zenity options
44 | ZENITY_TITLE="Power Menu"
45 | ZENITY_TEXT="Action:"
46 | ZENITY_OPTIONS=(--column= --hide-header)
47 |
48 | #######################################################################
49 | # END CONFIG #
50 | #######################################################################
51 |
52 | # Whether to ask for user's confirmation
53 | enable_confirmation=false
54 |
55 | # Preferred launcher if both are available
56 | preferred_launcher="rofi"
57 |
58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
59 |
60 | where:
61 | -h show this help text
62 | -c ask for user confirmation
63 | -p preferred launcher (rofi or zenity)
64 |
65 | This script depends on:
66 | - systemd,
67 | - i3,
68 | - rofi or zenity."
69 |
70 | # Check whether the user-defined launcher is valid
71 | launcher_list=(rofi zenity)
72 | function check_launcher() {
73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
74 | echo "Supported launchers: ${launcher_list[*]}"
75 | exit 1
76 | else
77 | # Get array with unique elements and preferred launcher first
78 | # Note: uniq expects a sorted list, so we cannot use it
79 | i=1
80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
82 | fi
83 | }
84 |
85 | # Parse CLI arguments
86 | while getopts "hcp:" option; do
87 | case "${option}" in
88 | h) echo "${usage}"
89 | exit 0
90 | ;;
91 | c) enable_confirmation=true
92 | ;;
93 | p) preferred_launcher="${OPTARG}"
94 | check_launcher "${preferred_launcher}"
95 | ;;
96 | *) exit 1
97 | ;;
98 | esac
99 | done
100 |
101 | # Check whether a command exists
102 | function command_exists() {
103 | command -v "$1" &> /dev/null 2>&1
104 | }
105 |
106 | # systemctl required
107 | if ! command_exists systemctl ; then
108 | exit 1
109 | fi
110 |
111 | # menu defined as an associative array
112 | typeset -A menu
113 |
114 | # Menu with keys/commands
115 |
116 | menu=(
117 | [ Shutdown]="systemctl poweroff"
118 | [ Reboot]="systemctl reboot"
119 | [ Suspend]="systemctl suspend"
120 | [ Lock]="~/.config/i3/scripts/blur-lock"
121 | [ Logout]="i3-msg exit"
122 | )
123 |
124 | menu_nrows=${#menu[@]}
125 |
126 | # Menu entries that may trigger a confirmation message
127 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
128 |
129 | launcher_exe=""
130 | launcher_options=""
131 | rofi_colors=""
132 |
133 | function prepare_launcher() {
134 | if [[ "$1" == "rofi" ]]; then
135 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
136 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
137 | launcher_exe="rofi"
138 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
139 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
140 | elif [[ "$1" == "zenity" ]]; then
141 | launcher_exe="zenity"
142 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
143 | "${ZENITY_OPTIONS[@]}")
144 | fi
145 | }
146 |
147 | for l in "${launcher_list[@]}"; do
148 | if command_exists "${l}" ; then
149 | prepare_launcher "${l}"
150 | break
151 | fi
152 | done
153 |
154 | # No launcher available
155 | if [[ -z "${launcher_exe}" ]]; then
156 | exit 1
157 | fi
158 |
159 | launcher=(${launcher_exe} "${launcher_options[@]}")
160 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
161 |
162 | function ask_confirmation() {
163 | if [ "${launcher_exe}" == "rofi" ]; then
164 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
165 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
166 | [ "${confirmed}" == "Yes" ] && confirmed=0
167 | elif [ "${launcher_exe}" == "zenity" ]; then
168 | zenity --question --text "Are you sure you want to ${selection,,}?"
169 | confirmed=$?
170 | fi
171 |
172 | if [ "${confirmed}" == 0 ]; then
173 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
174 | fi
175 | }
176 |
177 | if [[ $? -eq 0 && ! -z ${selection} ]]; then
178 | if [[ "${enable_confirmation}" = true && \
179 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
180 | ask_confirmation
181 | else
182 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
183 | fi
184 | fi
185 |
--------------------------------------------------------------------------------
/i3/scripts/volume:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Copyright (C) 2014 Julien Bonjean
3 | # Copyright (C) 2014 Alexander Keller
4 |
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 3 of the License, or
8 | # (at your option) any later version.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 |
15 | # You should have received a copy of the GNU General Public License
16 | # along with this program. If not, see .
17 |
18 | # original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
19 | # check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
20 | #------------------------------------------------------------------------
21 |
22 | # The second parameter overrides the mixer selection
23 | # For PulseAudio users, eventually use "pulse"
24 | # For Jack/Jack2 users, use "jackplug"
25 | # For ALSA users, you may use "default" for your primary card
26 | # or you may use hw:# where # is the number of the card desired
27 | if [[ -z "$MIXER" ]] ; then
28 | MIXER="default"
29 | if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
30 | # pulseaudio is running, but not all installations use "pulse"
31 | if amixer -D pulse info >/dev/null 2>&1 ; then
32 | MIXER="pulse"
33 | fi
34 | fi
35 | [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
36 | MIXER="${2:-$MIXER}"
37 | fi
38 |
39 | # The instance option sets the control to report and configure
40 | # This defaults to the first control of your selected mixer
41 | # For a list of the available, use `amixer -D $Your_Mixer scontrols`
42 | if [[ -z "$SCONTROL" ]] ; then
43 | SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
44 | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
45 | head -n1
46 | )}"
47 | fi
48 |
49 | # The first parameter sets the step to change the volume by (and units to display)
50 | # This may be in in % or dB (eg. 5% or 3dB)
51 | if [[ -z "$STEP" ]] ; then
52 | STEP="${1:-5%}"
53 | fi
54 |
55 | # AMIXER(1):
56 | # "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
57 | # more natural for human ear."
58 | NATURAL_MAPPING=${NATURAL_MAPPING:-0}
59 | if [[ "$NATURAL_MAPPING" != "0" ]] ; then
60 | AMIXER_PARAMS="-M"
61 | fi
62 |
63 | #------------------------------------------------------------------------
64 |
65 | capability() { # Return "Capture" if the device is a capture device
66 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
67 | sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
68 | }
69 |
70 | volume() {
71 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
72 | }
73 |
74 | format() {
75 |
76 | perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
77 | perl_filter+='{CORE::say $4 eq "off" ? "0%" : "'
78 | # If dB was selected, print that instead
79 | perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
80 | perl_filter+='"; exit}'
81 | output=$(perl -ne "$perl_filter")
82 | valore=${output::-1}
83 | # basandomi sul valore di output cambio icona
84 | if [ "$valore" -eq "0" ]; then
85 | echo " "
86 | echo ""
87 | echo "#f38ba8"
88 | else
89 |
90 | if [ "$valore" -le "20" ]; then
91 | echo " $output"
92 | fi
93 | if [ "$valore" -le "40" ] && [ "$valore" -gt "20" ]; then
94 | echo " $output"
95 | fi
96 | if [ "$valore" -gt "40" ]; then
97 | echo " $output"
98 | fi
99 | fi
100 | }
101 |
102 | #------------------------------------------------------------------------
103 |
104 | case $BLOCK_BUTTON in
105 | 1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
106 | 3) pavucontrol;;
107 |
108 | 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
109 | 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
110 | esac
111 |
112 | volume | format
113 |
--------------------------------------------------------------------------------
/i3/scripts/volume_brightness.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
3 |
4 | # taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
5 |
6 | # See README.md for usage instructions
7 | bar_color="#a6da95"
8 | volume_step=5
9 | brightness_step=5%
10 | max_volume=100
11 |
12 | # Uses regex to get volume from pactl
13 | function get_volume {
14 | pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
15 | }
16 |
17 | # Uses regex to get mute status from pactl
18 | function get_mute {
19 | pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
20 | }
21 |
22 | # Uses regex to get brightness from xbacklight
23 | function get_brightness {
24 | brightnessctl g | grep -Po '[0-9]{1,3}' | head -n 1
25 |
26 | }
27 |
28 | # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
29 | function get_volume_icon {
30 | volume=$(get_volume)
31 | mute=$(get_mute)
32 | if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
33 | volume_icon=" "
34 | elif [ "$volume" -lt 50 ]; then
35 | volume_icon=" "
36 | else
37 | volume_icon=" "
38 | fi
39 | }
40 |
41 | # Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
42 | function get_brightness_icon {
43 | brightness_icon=" "
44 | }
45 |
46 | # Displays a volume notification using dunstify
47 | function show_volume_notif {
48 | volume=$(get_mute)
49 | get_volume_icon
50 | dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
51 | }
52 |
53 | # Displays a brightness notification using dunstify
54 | function show_brightness_notif {
55 | massima=$(brightnessctl m)
56 | brightness=$(($(get_brightness)*100/$massima))
57 | get_brightness_icon
58 | dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color
59 | }
60 |
61 | # Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
62 | case $1 in
63 | volume_up)
64 | # Unmutes and increases volume, then displays the notification
65 | pactl set-sink-mute @DEFAULT_SINK@ 0
66 | volume=$(get_volume)
67 | if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
68 | pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
69 | else
70 | pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
71 | fi
72 | show_volume_notif
73 | ;;
74 |
75 | volume_down)
76 | # Raises volume and displays the notification
77 | pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
78 | show_volume_notif
79 | ;;
80 |
81 | volume_mute)
82 | # Toggles mute and displays the notification
83 | pactl set-sink-mute @DEFAULT_SINK@ toggle
84 | show_volume_notif
85 | ;;
86 |
87 | brightness_up)
88 | # Increases brightness and displays the notification
89 | brightnessctl s +$brightness_step
90 | show_brightness_notif
91 | ;;
92 |
93 | brightness_down)
94 | # Decreases brightness and displays the notification
95 | brightnessctl s $brightness_step-
96 | show_brightness_notif
97 | ;;
98 | esac
99 |
--------------------------------------------------------------------------------
/i3_pc/i3blocks.conf:
--------------------------------------------------------------------------------
1 | # File configurazione i3block
2 |
3 |
4 | separator=false
5 | markup=pango
6 | separator_block_width=6
7 | color=#cdd6f4
8 |
9 |
10 |
11 | [search]
12 | full_text=
13 | color=#f38ba8
14 | command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi
15 |
16 | #[files]
17 | #full_text=
18 | #color=#cba6f7
19 | #command=i3-msg -q exec thunar ~/
20 |
21 | [todo]
22 | full_text=
23 | color=#89b4fa
24 | command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo
25 |
26 | [wallpaper]
27 | full_text=
28 | color=#fab387
29 | command=~/.config/i3/scripts/miei/wallpaper.sh
30 |
31 | [expander]
32 | full_text=
33 | command=i3-msg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh"
34 | color=#b4befe
35 |
36 | [terminal]
37 | full_text=
38 | color=#94e2d5
39 | command=i3-msg -q exec kitty
40 |
41 |
42 | [close]
43 | full_text=
44 | color=#f38ba8
45 | command=i3-msg -q kill
46 | separator_block_width=0
47 |
48 |
49 | [simple-2]
50 | full_text=:
51 | color=#717171
52 |
53 |
54 | [meteo]
55 | command=~/.config/i3/scripts/miei/meteo.sh
56 | interval=1000
57 |
58 | [separator]
59 | full_text="⟨"
60 | color=#585b70
61 |
62 | #[update]
63 | #full_text=
64 | #command=~/.config/i3/scripts/miei/update.sh
65 | #interval=1800
66 |
67 |
68 |
69 | #[separator]
70 | #full_text="⟨"
71 | #color=#585b70
72 |
73 | [cpu_usage]
74 | full_text=
75 | label=
76 | command=~/.config/i3/scripts/miei/cpu.sh
77 | interval=10
78 |
79 | #[separator]
80 | #full_text="⟨"
81 | #color=#585b70
82 |
83 | #[news]
84 | #full_text=""
85 | #command=~/.config/i3/scripts/miei/feed.sh
86 | #interval=once
87 |
88 |
89 | #[separator]
90 | #full_text="⟨"
91 | #color=#585b70
92 |
93 | #[pavucontrol]
94 | #full_text=
95 | #command=pavucontrol
96 |
97 |
98 |
99 | #[timer]
100 | #full_text=
101 | #command=~/.config/i3/scripts/miei/timer.sh
102 | #interval=1
103 |
104 |
105 | [separator]
106 | full_text="⟨"
107 | color=#585b70
108 |
109 | [pomodoro]
110 | command=~/.config/i3/scripts/pomodoro.sh
111 | interval=1
112 |
113 | [separator]
114 | full_text="⟨"
115 | color=#585b70
116 |
117 | [gestione_energia]
118 | full_text=
119 | command=/home/flavio/.config/i3/scripts/miei/energia.sh
120 | interval=once
121 |
122 |
123 |
124 | [separator]
125 | full_text="⟨"
126 | color=#585b70
127 | [volume-pulseaudio]
128 | command=~/.config/i3/scripts/volume
129 | instance=Master
130 | interval=1
131 |
132 | #[battery]
133 | #command=~/.config/i3/scripts/battery2
134 | #label=
135 | #interval=30
136 |
137 | #[separator]
138 | #full_text="|"
139 |
140 | #[separator]
141 | #full_text="|"
142 | #color=#585b70
143 | #[icona]
144 | #full_text=
145 |
146 | #[battery]
147 | #command=~/.config/i3/scripts/miei/power.sh
148 | #label=
149 | #interval=1
150 |
151 |
152 |
153 |
154 | [separator]
155 | full_text="⟨"
156 | color=#585b70
157 |
158 | [time]
159 | full_text=
160 | label=
161 | interval=1
162 | command=~/.config/i3/scripts/miei/ora.sh
163 | separator_block_width=10
164 | color=#b4befe
165 |
166 | #color=#f38ba8
167 |
168 | [separator]
169 | full_text=" "
170 | separator_block_width=0
171 | background=#272836
172 |
173 |
174 |
175 |
176 | [shutdown_menu]
177 | full_text= ⏼
178 | #full_text= ⏼
179 | command=~/.config/i3/scripts/powermenu
180 | #color=#b4befe
181 |
182 | #color=#f5e0dc
183 | #background=#e71853
184 | background=#313244
185 | #separator_block_width=0
186 | #color=#f38ba8
187 | separator_block_width=0
188 |
189 |
190 |
191 |
192 |
193 |
194 |
--------------------------------------------------------------------------------
/i3_pc/scripts/bell.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3_pc/scripts/bell.wav
--------------------------------------------------------------------------------
/i3_pc/scripts/bell_end.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3_pc/scripts/bell_end.wav
--------------------------------------------------------------------------------
/i3_pc/scripts/blur-lock:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | PICTURE=/tmp/i3lock.png
4 | SCREENSHOT="scrot -z $PICTURE"
5 |
6 | BLUR="5x4"
7 |
8 | $SCREENSHOT
9 | convert $PICTURE -blur $BLUR $PICTURE
10 | i3lock -i $PICTURE
11 | rm $PICTURE
12 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/active.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ -f /tmp/tray ]; then
3 | var=$(cat /tmp/tray)
4 | if [ $var == 1 ]; then
5 | echo 0 > /tmp/tray
6 | i3-msg -q "bar mode dock bar-tray"
7 | i3-msg -q "bar mode invisible bar-primary"
8 | fi
9 |
10 | if [ $var == 0 ]; then
11 | echo 1 > /tmp/tray
12 | i3-msg -q "bar mode invisible bar-tray"
13 | i3-msg -q "bar mode dock bar-primary"
14 |
15 | fi
16 | else
17 | echo 0 > /tmp/tray
18 | i3-msg -q "bar mode dock bar-tray"
19 | i3-msg -q "bar mode invisible bar-primary"
20 | fi
21 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/cpu.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ $BLOCK_BUTTON == 1 ]; then
3 | kitty -e htop
4 | fi
5 |
6 | echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"
7 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/energia.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | file=/tmp/powerprofile
3 |
4 | if ! test -f $file; then
5 | echo 0 > $file
6 | powerprofilesctl set power-saver
7 | fi
8 |
9 | a=$(cat $file)
10 |
11 | if [ $BLOCK_BUTTON == 1 ]
12 | then
13 | if [ $a == 0 ]
14 | then
15 | echo 1 > $file
16 | echo " Blc"
17 | powerprofilesctl set balanced
18 | fi
19 |
20 | if [ $a == 1 ]
21 | then
22 | echo 2 > $file
23 | echo " Pro"
24 | powerprofilesctl set performance
25 | fi
26 |
27 | if [ $a == 2 ]
28 | then
29 | echo 0 > $file
30 | echo " Eco"
31 | powerprofilesctl set power-saver
32 | fi
33 | fi
34 |
35 | if [ $a == 1 ]; then
36 | echo " Blc"
37 | fi
38 |
39 | if [ $a == 0 ]; then
40 | echo " Eco"
41 | fi
42 |
43 | if [ $a == 2 ]; then
44 | echo " Pro"
45 | fi
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/feed.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/feed.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]
20 | then
21 | echo " $(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=)')"
22 | else
23 | echo " News"
24 | fi
25 |
26 | if [ $BLOCK_BUTTON == 3 ]; then
27 | xdg-open https://www.lescienze.it/news/
28 | fi
29 |
30 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/full_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # quando lo clicco mi ricarica il dispositivo fino al 100% e poi disabilita la feature
4 | path="/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/VPC2004:00/conservation_mode"
5 | value=$(cat $path)
6 | if [ $value -eq "" ];then
7 | echo "only ideapad"
8 | fi
9 |
10 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
11 |
12 | if [ $BLOCK_BUTTON -eq 1 ] && [ $value -eq "1" ];then
13 | echo " full"
14 | echo $PASSW | sudo -S sh -c "echo 0 > $path"
15 | fi
16 |
17 |
18 | if [ $level -ge "95" ] && [ $value -eq "0" ];then
19 | echo " Csv"
20 | echo $PASSW | sudo -S sh -c "echo 1 > $path"
21 | fi
22 |
23 | if [ $value -eq 0 ];then
24 | echo " full"
25 | else
26 | echo " Csv"
27 | fi
28 |
29 |
30 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/meteo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | meteo=$(curl wttr.in/Sedriano?format=1| xargs echo)
3 | first="${meteo%% *}"
4 | if [ "$meteo" == "" ] || [ "$first" == "Unknown" ]; then
5 | echo " Off"
6 |
7 | else
8 | echo $meteo
9 | fi
10 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/ora.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=1
3 |
4 | path=~/.config/i3/scripts/miei/ora.sh
5 |
6 | cambia_var () {
7 | if [ $a == 0 ]; then
8 | sed -i '2d' $path
9 | sed -i '2ia=1' $path
10 | # se non mostri la variabile subito ci sarà il delay di interval
11 | a=1
12 | return 1
13 | fi
14 | if [ $a == 1 ]; then
15 | sed -i '2d' $path
16 | sed -i '2ia=0' $path
17 | a=0
18 | return 0
19 | fi
20 | }
21 |
22 | if [ $BLOCK_BUTTON == 1 ]; then
23 | cambia_var
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | date '+%a %d %b %H:%M'
28 | fi
29 |
30 | if [ $a == 1 ]; then
31 | date '+%H:%M'
32 | fi
33 |
34 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/power.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then
8 | ~/.config/i3/scripts/miei/power_charge.sh
9 | exit 1
10 | fi
11 |
12 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
13 |
14 | unit=20
15 | vite=$(($level/unit))
16 |
17 | if [ $vite == 5 ]; then
18 | echo ""
19 | echo ""
20 | echo "#cdd6f4"
21 | fi
22 |
23 | if [ $vite == 4 ]; then
24 | echo ""
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 3 ]; then
29 | echo ""
30 | echo ""
31 | echo "#a6e3a1"
32 | fi
33 | if [ $vite == 2 ]; then
34 | echo ""
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ $vite == 1 ]; then
39 | echo ""
40 | echo ""
41 | echo "#fab387"
42 | fi
43 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
44 | echo ""
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 | if [ "$level" -lt "10" ]; then
49 | echo "!"
50 | echo ""
51 | echo "#f38ba8"
52 | fi
53 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/power_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
8 |
9 | unit=20
10 | vite=$(($level/unit))
11 |
12 | if [ $vite == 5 ]; then
13 | echo " "
14 | echo ""
15 | echo "#cdd6f4"
16 | fi
17 |
18 | if [ $vite == 4 ]; then
19 | echo " "
20 | echo ""
21 | echo "#a6e3a1"
22 | fi
23 | if [ $vite == 3 ]; then
24 | echo " "
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 2 ]; then
29 | echo " "
30 | echo ""
31 | echo "#fab387"
32 | fi
33 | if [ $vite == 1 ]; then
34 | echo " "
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
39 | echo " "
40 | echo ""
41 | echo "#f38ba8"
42 | fi
43 | if [ "$level" -lt "10" ]; then
44 | echo " !"
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/schermata.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=$(date +"%Y-%m-%d-%T")-schermata.png
3 |
4 | maim --select ~/Immagini/Schermate/$a
5 | notify-send "Screenshot saved to ~/$a"
6 | #kdialog --yesno "Screenshot salvato, vuoi aprirlo?"
7 | #if [ $? == 0 ]; then
8 | eog ~/Immagini/Schermate/$a
9 | #fi
10 |
11 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/timer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #creazione meccanismo di cambiamento timer modalità m (modifica)
3 | path=/tmp/miotimer
4 |
5 | modifica () {
6 | if [ $BLOCK_BUTTON == 4 ];then
7 | current=$((current + 1))
8 | echo $mode > $path
9 | echo $current >> $path
10 | fi
11 | if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then
12 | current=$((current - 1))
13 | echo $mode > $path
14 | echo $current >> $path
15 | fi
16 | if [ $current == 0 ];then
17 | echo " Tmr"
18 | else
19 | echo " $(sed '2!d' $path) m"
20 | echo ""
21 | echo "#f9e2af"
22 | fi
23 | }
24 |
25 | timer () {
26 | start=$(sed '2!d' $path)
27 | start=$((start * 60))
28 | now=$(date +%s)
29 | first=$(sed '3!d' $path)
30 | manca=$((start-now+first))
31 | if [ $manca != 0 ];then
32 | echo " $((manca / 60)):$((manca % 60))"
33 | echo ""
34 | echo "#a6e3a1"
35 |
36 | else
37 | echo " Tmr"
38 | notify-send "Timer is over"
39 | rm $path
40 | fi
41 | }
42 |
43 |
44 |
45 |
46 | if [ -f $path ]
47 | then
48 |
49 |
50 | mode=$(sed '1!d' $path)
51 | current=$(sed '2!d' $path)
52 |
53 | if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then
54 | if [ $mode == "w" ];then
55 | rm $path
56 | echo " Tmr"
57 | exit
58 | fi
59 | mode=w
60 | echo $mode > $path
61 | echo $current >> $path
62 | echo $(date +%s) >> $path
63 | fi
64 |
65 |
66 | if [ $mode == "m" ];then
67 | modifica
68 | fi
69 |
70 | if [ $mode == "w" ];then
71 | timer
72 | fi
73 |
74 |
75 |
76 | else
77 | echo m > $path
78 | echo 0 >> $path
79 | echo " Tmr"
80 | fi
81 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/update.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | if [ $BLOCK_BUTTON -eq "1" ];then
4 | kitty -e sudo dnf upgrade
5 | kitty -e flatpak update
6 | fi
7 |
8 |
9 | numero=$(dnf check-update| grep -Ec ' updates$')
10 | if [ $numero -eq "0" ];then
11 | echo " "
12 | else
13 | echo " $numero"
14 | echo ""
15 | echo "#f9e2af"
16 | fi
17 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/volcolor.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | level=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1 )
4 |
5 | unit=10
6 | vite=$(($level/unit))
7 | mute=$(pactl get-sink-mute @DEFAULT_SINK@)
8 |
9 | if [ "$mute" == "Mute: sì" ] || [ "$mute" == "Mute: yes" ]; then
10 | echo " "
11 | echo ""
12 | echo "#cdd6f4"
13 | else
14 | if [ $vite == 10 ]; then
15 | echo " "
16 | echo ""
17 | echo "#f38ba8"
18 | fi
19 |
20 | if [ $vite == 9 ]; then
21 | echo " "
22 | echo ""
23 | echo "#f38ba8"
24 | fi
25 | if [ $vite == 8 ]; then
26 | echo " "
27 | echo ""
28 | echo "#f38ba8"
29 | fi
30 | if [ $vite == 7 ]; then
31 | echo " "
32 | echo ""
33 | echo "#f38ba8"
34 | fi
35 | if [ $vite == 6 ]; then
36 | echo " "
37 | echo ""
38 | echo "#fab387"
39 | fi
40 | if [ $vite == 5 ]; then
41 | echo " "
42 | echo ""
43 | echo "#fab387"
44 | fi
45 | if [ $vite == 4 ]; then
46 | echo " "
47 | echo ""
48 | echo "#a6e3a1"
49 | fi
50 | if [ $vite == 3 ]; then
51 | echo " "
52 | echo ""
53 | echo "#a6e3a1"
54 | fi
55 | if [ $vite == 2 ]; then
56 | echo " "
57 | echo ""
58 | echo "#a6e3a1"
59 | fi
60 | if [ $vite == 1 ]; then
61 | echo " "
62 | echo ""
63 | echo "#a6e3a1"
64 | fi
65 | if [ $vite == 0 ] && [ $level != 0 ]; then
66 | echo " "
67 | echo ""
68 | echo "#a6e3a1"
69 | fi
70 | if [ $vite == 0 ] && [ $level == 0 ]; then
71 | echo " "
72 | echo ""
73 | echo "#cdd6f4"
74 | fi
75 |
76 |
77 | fi
78 |
79 |
--------------------------------------------------------------------------------
/i3_pc/scripts/miei/wallpaper.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | w_path=~/.config/wallpaper/
3 | c_path=~/.config/wallpaper/current
4 | config=~/.config/
5 | current=$(cat $c_path)
6 |
7 | if [ $BLOCK_BUTTON == 1 ];then
8 | new=$((current+1))
9 | if [ $new == 13 ]; then
10 | new=0
11 | fi
12 | fi
13 |
14 | if [ $BLOCK_BUTTON == 3 ];then
15 | new=$((current - 1))
16 | if [ $new == "-1" ]; then
17 | new=12
18 | fi
19 | fi
20 |
21 | rm "${config}sfondo.jpg"
22 | cp "$w_path$new.jpg" $config
23 | mv "$config$new.jpg" "${config}sfondo.jpg"
24 | sed -i '1d' $c_path
25 | echo $new >> $c_path
26 | feh --bg-fill ~/.config/sfondo.jpg
27 |
--------------------------------------------------------------------------------
/i3_pc/scripts/pomodoro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ -f /tmp/pomo_timer ];then
3 | pluto=$(cat /tmp/pomo_timer)
4 |
5 | case $BLOCK_BUTTON in
6 | 3) if [ $pluto -eq "0" ];then
7 | echo "1" > /tmp/pomo_timer
8 | pluto=1
9 | else
10 | echo "0" > /tmp/pomo_timer
11 | pluto=0
12 | fi
13 |
14 | ;;
15 | esac
16 |
17 |
18 |
19 | if [ $pluto -eq "0" ];then
20 |
21 | # Config variables
22 | # 40min = 2400s
23 | # 25min = 1500s
24 | # 20min = 1200s
25 | # 5min = 300s
26 |
27 | # In secondi
28 | work_time=2400
29 | break_time=1200
30 |
31 | msg_start=" Pom"
32 | work_prefix=" "
33 | break_prefix=" "
34 |
35 | #start_color="#b39df3"
36 | #start_color="#E06C75"
37 | start_color="#cdd6f4"
38 |
39 | break_color="#a6e3a1"
40 | work_color="#f38ba8"
41 |
42 | break_command="notify-send -t 2500 'Grab a tea'"
43 | work_command="notify-send -t 2500 'Time to work!'"
44 |
45 | pom_path="/tmp/pomodoro"
46 |
47 | function display () {
48 | min=$((s/60))
49 | sek=$((s%60))
50 | if [ $min -eq 0 ]
51 | then
52 | min=00
53 | elif [ $min -lt 10 ]
54 | then
55 | min=0$min
56 | fi
57 | if [ $sek -lt 10 ]
58 | then
59 | sek=0$sek
60 | fi
61 | case $2 in # richiamo alla seconda variabile, t
62 | w)
63 | echo "$work_prefix$min:$sek"
64 | echo $min:$sek
65 | echo $work_color
66 | ;;
67 | b)
68 | echo "$break_prefix$min:$sek"
69 | echo $min:$sek
70 | echo $break_color
71 | ;;
72 | esac
73 | }
74 |
75 | if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ]
76 | then
77 | p=$(sed '1 d' $pom_path) # time
78 | t=$(sed '2 d' $pom_path) # mode
79 | case $t in
80 | w) dur=$work_time;;
81 | b) dur=$break_time;;
82 | esac
83 | now=$(date +%s)
84 | s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione
85 | if [ $s -le 0 ] # if time less than 0 then switch mode
86 | then
87 | case $t in
88 | w)
89 | echo b > $pom_path
90 | eval "$break_command"
91 | paplay $HOME/.config/i3/scripts/bell.wav
92 | ;;
93 | b)
94 | echo w > $pom_path
95 | eval "$work_command"
96 | paplay $HOME/.config/i3/scripts/bell_end.wav
97 |
98 | ;;
99 | esac
100 | echo "$now" >> $pom_path
101 | fi
102 | display "$s" "$t"
103 | else
104 | echo "$msg_start"
105 | echo "$msg_start"
106 | echo "$start_color"
107 | fi
108 |
109 | case $BLOCK_BUTTON in
110 | 1)
111 | if [ -f $pom_path ]; then # if file exists then stop reset timer
112 | rm $pom_path
113 | else
114 | echo w > $pom_path # else start timer
115 | date +%s >> $pom_path
116 | fi
117 | ;;
118 | esac
119 | # è 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.
120 |
121 | fi
122 |
123 |
124 | if [ $pluto -eq "1" ];then
125 | ~/.config/i3/scripts/miei/timer.sh
126 | fi
127 |
128 | else
129 | echo "0" > /tmp/pomo_timer
130 | fi
131 |
132 |
133 |
--------------------------------------------------------------------------------
/i3_pc/scripts/powermenu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Use rofi/zenity to change system runstate thanks to systemd.
4 | #
5 | # Note: this currently relies on associative array support in the shell.
6 | #
7 | # Inspired from i3pystatus wiki:
8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
9 | #
10 | # Copyright 2015 Benjamin Chrétien
11 | #
12 | # This program is free software: you can redistribute it and/or modify
13 | # it under the terms of the GNU General Public License as published by
14 | # the Free Software Foundation, either version 3 of the License, or
15 | # (at your option) any later version.
16 |
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 |
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program. If not, see .
24 |
25 | # modified to work with latest rofi update by joekamprad
26 |
27 | #######################################################################
28 | # BEGIN CONFIG #
29 | #######################################################################
30 |
31 | # Use a custom lock script
32 | #LOCKSCRIPT="i3lock-extra -m pixelize"
33 |
34 | # Colors: FG (foreground), BG (background), HL (highlighted)
35 | FG_COLOR="#bbbbbb"
36 | BG_COLOR="#111111"
37 | HLFG_COLOR="#111111"
38 | HLBG_COLOR="#bbbbbb"
39 | BORDER_COLOR="#222222"
40 |
41 | # Options not related to colors (most rofi options do not work anymore)
42 | ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi)
43 | # Zenity options
44 | ZENITY_TITLE="Power Menu"
45 | ZENITY_TEXT="Action:"
46 | ZENITY_OPTIONS=(--column= --hide-header)
47 |
48 | #######################################################################
49 | # END CONFIG #
50 | #######################################################################
51 |
52 | # Whether to ask for user's confirmation
53 | enable_confirmation=false
54 |
55 | # Preferred launcher if both are available
56 | preferred_launcher="rofi"
57 |
58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
59 |
60 | where:
61 | -h show this help text
62 | -c ask for user confirmation
63 | -p preferred launcher (rofi or zenity)
64 |
65 | This script depends on:
66 | - systemd,
67 | - i3,
68 | - rofi or zenity."
69 |
70 | # Check whether the user-defined launcher is valid
71 | launcher_list=(rofi zenity)
72 | function check_launcher() {
73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
74 | echo "Supported launchers: ${launcher_list[*]}"
75 | exit 1
76 | else
77 | # Get array with unique elements and preferred launcher first
78 | # Note: uniq expects a sorted list, so we cannot use it
79 | i=1
80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
82 | fi
83 | }
84 |
85 | # Parse CLI arguments
86 | while getopts "hcp:" option; do
87 | case "${option}" in
88 | h) echo "${usage}"
89 | exit 0
90 | ;;
91 | c) enable_confirmation=true
92 | ;;
93 | p) preferred_launcher="${OPTARG}"
94 | check_launcher "${preferred_launcher}"
95 | ;;
96 | *) exit 1
97 | ;;
98 | esac
99 | done
100 |
101 | # Check whether a command exists
102 | function command_exists() {
103 | command -v "$1" &> /dev/null 2>&1
104 | }
105 |
106 | # systemctl required
107 | if ! command_exists systemctl ; then
108 | exit 1
109 | fi
110 |
111 | # menu defined as an associative array
112 | typeset -A menu
113 |
114 | # Menu with keys/commands
115 |
116 | menu=(
117 | [ Shutdown]="systemctl poweroff"
118 | [ Reboot]="systemctl reboot"
119 | [ Suspend]="systemctl suspend"
120 | [ Lock]="~/.config/i3/scripts/blur-lock"
121 | [ Logout]="i3-msg exit"
122 | )
123 |
124 | menu_nrows=${#menu[@]}
125 |
126 | # Menu entries that may trigger a confirmation message
127 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
128 |
129 | launcher_exe=""
130 | launcher_options=""
131 | rofi_colors=""
132 |
133 | function prepare_launcher() {
134 | if [[ "$1" == "rofi" ]]; then
135 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
136 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
137 | launcher_exe="rofi"
138 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
139 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
140 | elif [[ "$1" == "zenity" ]]; then
141 | launcher_exe="zenity"
142 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
143 | "${ZENITY_OPTIONS[@]}")
144 | fi
145 | }
146 |
147 | for l in "${launcher_list[@]}"; do
148 | if command_exists "${l}" ; then
149 | prepare_launcher "${l}"
150 | break
151 | fi
152 | done
153 |
154 | # No launcher available
155 | if [[ -z "${launcher_exe}" ]]; then
156 | exit 1
157 | fi
158 |
159 | launcher=(${launcher_exe} "${launcher_options[@]}")
160 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
161 |
162 | function ask_confirmation() {
163 | if [ "${launcher_exe}" == "rofi" ]; then
164 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
165 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
166 | [ "${confirmed}" == "Yes" ] && confirmed=0
167 | elif [ "${launcher_exe}" == "zenity" ]; then
168 | zenity --question --text "Are you sure you want to ${selection,,}?"
169 | confirmed=$?
170 | fi
171 |
172 | if [ "${confirmed}" == 0 ]; then
173 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
174 | fi
175 | }
176 |
177 | if [[ $? -eq 0 && ! -z ${selection} ]]; then
178 | if [[ "${enable_confirmation}" = true && \
179 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
180 | ask_confirmation
181 | else
182 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
183 | fi
184 | fi
185 |
--------------------------------------------------------------------------------
/i3_pc/scripts/volume:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Copyright (C) 2014 Julien Bonjean
3 | # Copyright (C) 2014 Alexander Keller
4 |
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 3 of the License, or
8 | # (at your option) any later version.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 |
15 | # You should have received a copy of the GNU General Public License
16 | # along with this program. If not, see .
17 |
18 | # original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
19 | # check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
20 | #------------------------------------------------------------------------
21 |
22 | # The second parameter overrides the mixer selection
23 | # For PulseAudio users, eventually use "pulse"
24 | # For Jack/Jack2 users, use "jackplug"
25 | # For ALSA users, you may use "default" for your primary card
26 | # or you may use hw:# where # is the number of the card desired
27 | if [[ -z "$MIXER" ]] ; then
28 | MIXER="default"
29 | if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
30 | # pulseaudio is running, but not all installations use "pulse"
31 | if amixer -D pulse info >/dev/null 2>&1 ; then
32 | MIXER="pulse"
33 | fi
34 | fi
35 | [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
36 | MIXER="${2:-$MIXER}"
37 | fi
38 |
39 | # The instance option sets the control to report and configure
40 | # This defaults to the first control of your selected mixer
41 | # For a list of the available, use `amixer -D $Your_Mixer scontrols`
42 | if [[ -z "$SCONTROL" ]] ; then
43 | SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
44 | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
45 | head -n1
46 | )}"
47 | fi
48 |
49 | # The first parameter sets the step to change the volume by (and units to display)
50 | # This may be in in % or dB (eg. 5% or 3dB)
51 | if [[ -z "$STEP" ]] ; then
52 | STEP="${1:-5%}"
53 | fi
54 |
55 | # AMIXER(1):
56 | # "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
57 | # more natural for human ear."
58 | NATURAL_MAPPING=${NATURAL_MAPPING:-0}
59 | if [[ "$NATURAL_MAPPING" != "0" ]] ; then
60 | AMIXER_PARAMS="-M"
61 | fi
62 |
63 | #------------------------------------------------------------------------
64 |
65 | capability() { # Return "Capture" if the device is a capture device
66 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
67 | sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
68 | }
69 |
70 | volume() {
71 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
72 | }
73 |
74 | format() {
75 |
76 | perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
77 | perl_filter+='{CORE::say $4 eq "off" ? "0%" : "'
78 | # If dB was selected, print that instead
79 | perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
80 | perl_filter+='"; exit}'
81 | # output=$(/home/flavio/.config/i3/scripts/miei/volcolor.sh)
82 | # valore=${output::-1}
83 | # basandomi sul valore di output cambio icona
84 | ~/.config/i3/scripts/miei/volcolor.sh
85 | }
86 |
87 | #------------------------------------------------------------------------
88 |
89 | case $BLOCK_BUTTON in
90 | 1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
91 | 3) pavucontrol;;
92 |
93 | 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
94 | 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
95 | esac
96 |
97 | volume | format
98 |
--------------------------------------------------------------------------------
/i3_pc/scripts/volume_brightness.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
3 |
4 | # taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
5 |
6 | # See README.md for usage instructions
7 | bar_color="#a6da95"
8 | volume_step=5
9 | brightness_step=5%
10 | max_volume=100
11 |
12 | # Uses regex to get volume from pactl
13 | function get_volume {
14 | pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
15 | }
16 |
17 | # Uses regex to get mute status from pactl
18 | function get_mute {
19 | pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
20 | }
21 |
22 | # Uses regex to get brightness from xbacklight
23 | function get_brightness {
24 | brightnessctl g | grep -Po '[0-9]{1,3}' | head -n 1
25 |
26 | }
27 |
28 | # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
29 | function get_volume_icon {
30 | volume=$(get_volume)
31 | mute=$(get_mute)
32 | if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
33 | volume_icon=" "
34 | elif [ "$volume" -lt 50 ]; then
35 | volume_icon=" "
36 | else
37 | volume_icon=" "
38 | fi
39 | }
40 |
41 | # Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
42 | function get_brightness_icon {
43 | brightness_icon=" "
44 | }
45 |
46 | # Displays a volume notification using dunstify
47 | function show_volume_notif {
48 | volume=$(get_mute)
49 | get_volume_icon
50 | dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
51 | }
52 |
53 | # Displays a brightness notification using dunstify
54 | function show_brightness_notif {
55 | massima=$(brightnessctl m)
56 | brightness=$(($(get_brightness)*100/$massima))
57 | get_brightness_icon
58 | dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color
59 | }
60 |
61 | # Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
62 | case $1 in
63 | volume_up)
64 | # Unmutes and increases volume, then displays the notification
65 | pactl set-sink-mute @DEFAULT_SINK@ 0
66 | volume=$(get_volume)
67 | if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
68 | pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
69 | else
70 | pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
71 | fi
72 | show_volume_notif
73 | ;;
74 |
75 | volume_down)
76 | # Raises volume and displays the notification
77 | pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
78 | show_volume_notif
79 | ;;
80 |
81 | volume_mute)
82 | # Toggles mute and displays the notification
83 | pactl set-sink-mute @DEFAULT_SINK@ toggle
84 | show_volume_notif
85 | ;;
86 |
87 | brightness_up)
88 | # Increases brightness and displays the notification
89 | brightnessctl s +$brightness_step
90 | show_brightness_notif
91 | ;;
92 |
93 | brightness_down)
94 | # Decreases brightness and displays the notification
95 | brightnessctl s $brightness_step-
96 | show_brightness_notif
97 | ;;
98 | esac
99 |
--------------------------------------------------------------------------------
/i3_polybar/i3blocks.conf:
--------------------------------------------------------------------------------
1 | # File configurazione i3block
2 |
3 |
4 | separator=false
5 | markup=pango
6 | separator_block_width=6
7 | color=#cdd6f4
8 |
9 |
10 |
11 | [search]
12 | full_text=
13 | color=#f38ba8
14 | command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi
15 |
16 | #[files]
17 | #full_text=
18 | #color=#cba6f7
19 | #command=i3-msg -q exec thunar ~/
20 |
21 | [todo]
22 | full_text=
23 | color=#89b4fa
24 | command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo
25 |
26 | [wallpaper]
27 | full_text=
28 | color=#fab387
29 | command=~/.config/i3/scripts/miei/wallpaper.sh
30 |
31 | [expander]
32 | full_text=
33 | command=i3-msg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh"
34 | color=#b4befe
35 |
36 | [terminal]
37 | full_text=
38 | color=#94e2d5
39 | command=i3-msg -q exec kitty
40 |
41 |
42 | [close]
43 | full_text=
44 | color=#f38ba8
45 | command=i3-msg -q kill
46 | separator_block_width=0
47 |
48 |
49 | [simple-2]
50 | full_text=:
51 | color=#717171
52 |
53 |
54 | [meteo]
55 | command=~/.config/i3/scripts/miei/meteo.sh
56 | interval=1000
57 |
58 | [separator]
59 | full_text="⟨"
60 | color=#585b70
61 |
62 | #[update]
63 | #full_text=
64 | #command=~/.config/i3/scripts/miei/update.sh
65 | #interval=1800
66 |
67 |
68 |
69 | #[separator]
70 | #full_text="⟨"
71 | #color=#585b70
72 |
73 | [cpu_usage]
74 | full_text=
75 | label=
76 | command=~/.config/i3/scripts/miei/cpu.sh
77 | interval=10
78 |
79 | #[separator]
80 | #full_text="⟨"
81 | #color=#585b70
82 |
83 | #[news]
84 | #full_text=""
85 | #command=~/.config/i3/scripts/miei/feed.sh
86 | #interval=once
87 |
88 |
89 | #[separator]
90 | #full_text="⟨"
91 | #color=#585b70
92 |
93 | #[pavucontrol]
94 | #full_text=
95 | #command=pavucontrol
96 |
97 |
98 |
99 | #[timer]
100 | #full_text=
101 | #command=~/.config/i3/scripts/miei/timer.sh
102 | #interval=1
103 |
104 |
105 | [separator]
106 | full_text="⟨"
107 | color=#585b70
108 |
109 | [pomodoro]
110 | command=~/.config/i3/scripts/pomodoro.sh
111 | interval=1
112 |
113 | [separator]
114 | full_text="⟨"
115 | color=#585b70
116 |
117 | [gestione_energia]
118 | full_text=
119 | command=/home/flavio/.config/i3/scripts/miei/energia.sh
120 | interval=once
121 |
122 |
123 |
124 | [separator]
125 | full_text="⟨"
126 | color=#585b70
127 | [volume-pulseaudio]
128 | command=~/.config/i3/scripts/volume
129 | instance=Master
130 | interval=1
131 |
132 | #[battery]
133 | #command=~/.config/i3/scripts/battery2
134 | #label=
135 | #interval=30
136 |
137 | #[separator]
138 | #full_text="|"
139 |
140 | #[separator]
141 | #full_text="|"
142 | #color=#585b70
143 | #[icona]
144 | #full_text=
145 |
146 | #[battery]
147 | #command=~/.config/i3/scripts/miei/power.sh
148 | #label=
149 | #interval=1
150 |
151 |
152 |
153 |
154 | [separator]
155 | full_text="⟨"
156 | color=#585b70
157 |
158 | [time]
159 | full_text=
160 | label=
161 | interval=1
162 | command=~/.config/i3/scripts/miei/ora.sh
163 | separator_block_width=10
164 | color=#b4befe
165 |
166 | #color=#f38ba8
167 |
168 | [separator]
169 | full_text=" "
170 | separator_block_width=0
171 | background=#272836
172 |
173 |
174 |
175 |
176 | [shutdown_menu]
177 | full_text= ⏼
178 | #full_text= ⏼
179 | command=~/.config/i3/scripts/powermenu
180 | #color=#b4befe
181 |
182 | #color=#f5e0dc
183 | #background=#e71853
184 | background=#313244
185 | #separator_block_width=0
186 | #color=#f38ba8
187 | separator_block_width=0
188 |
189 |
190 |
191 |
192 |
193 |
194 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/bell.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3_polybar/scripts/bell.wav
--------------------------------------------------------------------------------
/i3_polybar/scripts/bell_end.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/i3_polybar/scripts/bell_end.wav
--------------------------------------------------------------------------------
/i3_polybar/scripts/blur-lock:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | PICTURE=/tmp/i3lock.png
4 | SCREENSHOT="scrot -z $PICTURE"
5 |
6 | BLUR="5x4"
7 |
8 | $SCREENSHOT
9 | convert $PICTURE -blur $BLUR $PICTURE
10 | i3lock -i $PICTURE
11 | rm $PICTURE
12 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/active.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ -f /tmp/tray ]; then
3 | var=$(cat /tmp/tray)
4 | if [ $var == 1 ]; then
5 | echo 0 > /tmp/tray
6 | i3-msg -q "bar mode dock bar-tray"
7 | i3-msg -q "bar mode invisible bar-primary"
8 | fi
9 |
10 | if [ $var == 0 ]; then
11 | echo 1 > /tmp/tray
12 | i3-msg -q "bar mode invisible bar-tray"
13 | i3-msg -q "bar mode dock bar-primary"
14 |
15 | fi
16 | else
17 | echo 0 > /tmp/tray
18 | i3-msg -q "bar mode dock bar-tray"
19 | i3-msg -q "bar mode invisible bar-primary"
20 | fi
21 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/cpu.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | if [ $BLOCK_BUTTON == 1 ]; then
3 | kitty -e htop
4 | fi
5 |
6 | echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"
7 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/energia.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | file=/tmp/powerprofile
3 |
4 | if ! test -f $file; then
5 | echo 0 > $file
6 | powerprofilesctl set power-saver
7 | fi
8 |
9 | a=$(cat $file)
10 |
11 | if [ $BLOCK_BUTTON == 1 ]
12 | then
13 | if [ $a == 0 ]
14 | then
15 | echo 1 > $file
16 | echo " Blc"
17 | powerprofilesctl set balanced
18 | fi
19 |
20 | if [ $a == 1 ]
21 | then
22 | echo 2 > $file
23 | echo " Pro"
24 | powerprofilesctl set performance
25 | fi
26 |
27 | if [ $a == 2 ]
28 | then
29 | echo 0 > $file
30 | echo " Eco"
31 | powerprofilesctl set power-saver
32 | fi
33 | fi
34 |
35 | if [ $a == 1 ]; then
36 | echo " Blc"
37 | fi
38 |
39 | if [ $a == 0 ]; then
40 | echo " Eco"
41 | fi
42 |
43 | if [ $a == 2 ]; then
44 | echo " Pro"
45 | fi
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/feed.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=0
3 | path=~/.config/i3/scripts/miei/feed.sh
4 |
5 | if [ $BLOCK_BUTTON == 1 ]
6 | then
7 | if [ $a == 0 ]
8 | then
9 | sed -i '2d' $path
10 | sed -i '2ia=1' $path
11 | a=1
12 | else
13 | sed -i '2d' $path
14 | sed -i '2ia=0' $path
15 | a=0
16 | fi
17 | fi
18 |
19 | if [ $a == 1 ]
20 | then
21 | echo " $(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=)')"
22 | else
23 | echo " News"
24 | fi
25 |
26 | if [ $BLOCK_BUTTON == 3 ]; then
27 | xdg-open https://www.lescienze.it/news/
28 | fi
29 |
30 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/full_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | # quando lo clicco mi ricarica il dispositivo fino al 100% e poi disabilita la feature
4 | path="/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/VPC2004:00/conservation_mode"
5 | value=$(cat $path)
6 | if [ $value -eq "" ];then
7 | echo "only ideapad"
8 | fi
9 |
10 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
11 |
12 | if [ $BLOCK_BUTTON -eq 1 ] && [ $value -eq "1" ];then
13 | echo " full"
14 | echo $PASSW | sudo -S sh -c "echo 0 > $path"
15 | fi
16 |
17 |
18 | if [ $level -ge "95" ] && [ $value -eq "0" ];then
19 | echo " Csv"
20 | echo $PASSW | sudo -S sh -c "echo 1 > $path"
21 | fi
22 |
23 | if [ $value -eq 0 ];then
24 | echo " full"
25 | else
26 | echo " Csv"
27 | fi
28 |
29 |
30 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/meteo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | meteo=$(curl wttr.in/Sedriano?format=1| xargs echo)
3 | first="${meteo%% *}"
4 | if [ "$meteo" == "" ] || [ "$first" == "Unknown" ]; then
5 | echo " Off"
6 |
7 | else
8 | echo $meteo
9 | fi
10 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/ora.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=1
3 |
4 | path=~/.config/i3/scripts/miei/ora.sh
5 |
6 | cambia_var () {
7 | if [ $a == 0 ]; then
8 | sed -i '2d' $path
9 | sed -i '2ia=1' $path
10 | # se non mostri la variabile subito ci sarà il delay di interval
11 | a=1
12 | return 1
13 | fi
14 | if [ $a == 1 ]; then
15 | sed -i '2d' $path
16 | sed -i '2ia=0' $path
17 | a=0
18 | return 0
19 | fi
20 | }
21 |
22 | if [ $BLOCK_BUTTON == 1 ]; then
23 | cambia_var
24 | fi
25 |
26 | if [ $a == 0 ]; then
27 | date '+%a %d %b %H:%M'
28 | fi
29 |
30 | if [ $a == 1 ]; then
31 | date '+%H:%M'
32 | fi
33 |
34 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/power.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then
8 | ~/.config/i3/scripts/miei/power_charge.sh
9 | exit 1
10 | fi
11 |
12 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
13 |
14 | unit=20
15 | vite=$(($level/unit))
16 |
17 | if [ $vite == 5 ]; then
18 | echo ""
19 | echo ""
20 | echo "#cdd6f4"
21 | fi
22 |
23 | if [ $vite == 4 ]; then
24 | echo ""
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 3 ]; then
29 | echo ""
30 | echo ""
31 | echo "#a6e3a1"
32 | fi
33 | if [ $vite == 2 ]; then
34 | echo ""
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ $vite == 1 ]; then
39 | echo ""
40 | echo ""
41 | echo "#fab387"
42 | fi
43 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
44 | echo ""
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 | if [ "$level" -lt "10" ]; then
49 | echo "!"
50 | echo ""
51 | echo "#f38ba8"
52 | fi
53 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/power_charge.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #echo " "
3 | #echo ""
4 | #echo "#a6e3a1"
5 | #
6 |
7 | level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*")
8 |
9 | unit=20
10 | vite=$(($level/unit))
11 |
12 | if [ $vite == 5 ]; then
13 | echo " "
14 | echo ""
15 | echo "#cdd6f4"
16 | fi
17 |
18 | if [ $vite == 4 ]; then
19 | echo " "
20 | echo ""
21 | echo "#a6e3a1"
22 | fi
23 | if [ $vite == 3 ]; then
24 | echo " "
25 | echo ""
26 | echo "#a6e3a1"
27 | fi
28 | if [ $vite == 2 ]; then
29 | echo " "
30 | echo ""
31 | echo "#fab387"
32 | fi
33 | if [ $vite == 1 ]; then
34 | echo " "
35 | echo ""
36 | echo "#fab387"
37 | fi
38 | if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then
39 | echo " "
40 | echo ""
41 | echo "#f38ba8"
42 | fi
43 | if [ "$level" -lt "10" ]; then
44 | echo " !"
45 | echo ""
46 | echo "#f38ba8"
47 | fi
48 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/schermata.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | a=$(date +"%Y-%m-%d-%T")-schermata.png
3 |
4 | maim --select ~/Immagini/Schermate/$a
5 | notify-send "Screenshot saved to ~/$a"
6 | #kdialog --yesno "Screenshot salvato, vuoi aprirlo?"
7 | #if [ $? == 0 ]; then
8 | eog ~/Immagini/Schermate/$a
9 | #fi
10 |
11 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/timer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | #creazione meccanismo di cambiamento timer modalità m (modifica)
3 | path=/tmp/miotimer
4 |
5 | modifica () {
6 | if [ $BLOCK_BUTTON == 4 ];then
7 | current=$((current + 1))
8 | echo $mode > $path
9 | echo $current >> $path
10 | fi
11 | if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then
12 | current=$((current - 1))
13 | echo $mode > $path
14 | echo $current >> $path
15 | fi
16 | if [ $current == 0 ];then
17 | echo " Tmr"
18 | else
19 | echo " $(sed '2!d' $path) m"
20 | echo ""
21 | echo "#f9e2af"
22 | fi
23 | }
24 |
25 | timer () {
26 | start=$(sed '2!d' $path)
27 | start=$((start * 60))
28 | now=$(date +%s)
29 | first=$(sed '3!d' $path)
30 | manca=$((start-now+first))
31 | if [ $manca != 0 ];then
32 | echo " $((manca / 60)):$((manca % 60))"
33 | echo ""
34 | echo "#a6e3a1"
35 |
36 | else
37 | echo " Tmr"
38 | notify-send "Timer is over"
39 | rm $path
40 | fi
41 | }
42 |
43 |
44 |
45 |
46 | if [ -f $path ]
47 | then
48 |
49 |
50 | mode=$(sed '1!d' $path)
51 | current=$(sed '2!d' $path)
52 |
53 | if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then
54 | if [ $mode == "w" ];then
55 | rm $path
56 | echo " Tmr"
57 | exit
58 | fi
59 | mode=w
60 | echo $mode > $path
61 | echo $current >> $path
62 | echo $(date +%s) >> $path
63 | fi
64 |
65 |
66 | if [ $mode == "m" ];then
67 | modifica
68 | fi
69 |
70 | if [ $mode == "w" ];then
71 | timer
72 | fi
73 |
74 |
75 |
76 | else
77 | echo m > $path
78 | echo 0 >> $path
79 | echo " Tmr"
80 | fi
81 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/update.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 |
3 | if [ $BLOCK_BUTTON -eq "1" ];then
4 | kitty -e sudo dnf upgrade
5 | kitty -e flatpak update
6 | fi
7 |
8 |
9 | numero=$(dnf check-update| grep -Ec ' updates$')
10 | if [ $numero -eq "0" ];then
11 | echo " "
12 | else
13 | echo " $numero"
14 | echo ""
15 | echo "#f9e2af"
16 | fi
17 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/volcolor.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | level=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1 )
4 |
5 | unit=10
6 | vite=$(($level/unit))
7 | mute=$(pactl get-sink-mute @DEFAULT_SINK@)
8 |
9 | if [ "$mute" == "Mute: sì" ] || [ "$mute" == "Mute: yes" ]; then
10 | echo " "
11 | echo ""
12 | echo "#cdd6f4"
13 | else
14 | if [ $vite == 10 ]; then
15 | echo " "
16 | echo ""
17 | echo "#f38ba8"
18 | fi
19 |
20 | if [ $vite == 9 ]; then
21 | echo " "
22 | echo ""
23 | echo "#f38ba8"
24 | fi
25 | if [ $vite == 8 ]; then
26 | echo " "
27 | echo ""
28 | echo "#f38ba8"
29 | fi
30 | if [ $vite == 7 ]; then
31 | echo " "
32 | echo ""
33 | echo "#f38ba8"
34 | fi
35 | if [ $vite == 6 ]; then
36 | echo " "
37 | echo ""
38 | echo "#fab387"
39 | fi
40 | if [ $vite == 5 ]; then
41 | echo " "
42 | echo ""
43 | echo "#fab387"
44 | fi
45 | if [ $vite == 4 ]; then
46 | echo " "
47 | echo ""
48 | echo "#a6e3a1"
49 | fi
50 | if [ $vite == 3 ]; then
51 | echo " "
52 | echo ""
53 | echo "#a6e3a1"
54 | fi
55 | if [ $vite == 2 ]; then
56 | echo " "
57 | echo ""
58 | echo "#a6e3a1"
59 | fi
60 | if [ $vite == 1 ]; then
61 | echo " "
62 | echo ""
63 | echo "#a6e3a1"
64 | fi
65 | if [ $vite == 0 ] && [ $level != 0 ]; then
66 | echo " "
67 | echo ""
68 | echo "#a6e3a1"
69 | fi
70 | if [ $vite == 0 ] && [ $level == 0 ]; then
71 | echo " "
72 | echo ""
73 | echo "#cdd6f4"
74 | fi
75 |
76 |
77 | fi
78 |
79 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/miei/wallpaper.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | w_path=~/.config/wallpaper/
3 | c_path=~/.config/wallpaper/current
4 | config=~/.config/
5 | current=$(cat $c_path)
6 |
7 | if [ $BLOCK_BUTTON == 1 ];then
8 | new=$((current+1))
9 | if [ $new == 13 ]; then
10 | new=0
11 | fi
12 | fi
13 |
14 | if [ $BLOCK_BUTTON == 3 ];then
15 | new=$((current - 1))
16 | if [ $new == "-1" ]; then
17 | new=12
18 | fi
19 | fi
20 |
21 | rm "${config}sfondo.jpg"
22 | cp "$w_path$new.jpg" $config
23 | mv "$config$new.jpg" "${config}sfondo.jpg"
24 | sed -i '1d' $c_path
25 | echo $new >> $c_path
26 | feh --bg-fill ~/.config/sfondo.jpg
27 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/pomodoro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ -f /tmp/pomo_timer ];then
3 | pluto=$(cat /tmp/pomo_timer)
4 |
5 | case $BLOCK_BUTTON in
6 | 3) if [ $pluto -eq "0" ];then
7 | echo "1" > /tmp/pomo_timer
8 | pluto=1
9 | else
10 | echo "0" > /tmp/pomo_timer
11 | pluto=0
12 | fi
13 |
14 | ;;
15 | esac
16 |
17 |
18 |
19 | if [ $pluto -eq "0" ];then
20 |
21 | # Config variables
22 | # 40min = 2400s
23 | # 25min = 1500s
24 | # 20min = 1200s
25 | # 5min = 300s
26 |
27 | # In secondi
28 | work_time=2400
29 | break_time=1200
30 |
31 | msg_start=" Pom"
32 | work_prefix=" "
33 | break_prefix=" "
34 |
35 | #start_color="#b39df3"
36 | #start_color="#E06C75"
37 | start_color="#cdd6f4"
38 |
39 | break_color="#a6e3a1"
40 | work_color="#f38ba8"
41 |
42 | break_command="notify-send -t 2500 'Grab a tea'"
43 | work_command="notify-send -t 2500 'Time to work!'"
44 |
45 | pom_path="/tmp/pomodoro"
46 |
47 | function display () {
48 | min=$((s/60))
49 | sek=$((s%60))
50 | if [ $min -eq 0 ]
51 | then
52 | min=00
53 | elif [ $min -lt 10 ]
54 | then
55 | min=0$min
56 | fi
57 | if [ $sek -lt 10 ]
58 | then
59 | sek=0$sek
60 | fi
61 | case $2 in # richiamo alla seconda variabile, t
62 | w)
63 | echo "$work_prefix$min:$sek"
64 | echo $min:$sek
65 | echo $work_color
66 | ;;
67 | b)
68 | echo "$break_prefix$min:$sek"
69 | echo $min:$sek
70 | echo $break_color
71 | ;;
72 | esac
73 | }
74 |
75 | if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ]
76 | then
77 | p=$(sed '1 d' $pom_path) # time
78 | t=$(sed '2 d' $pom_path) # mode
79 | case $t in
80 | w) dur=$work_time;;
81 | b) dur=$break_time;;
82 | esac
83 | now=$(date +%s)
84 | s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione
85 | if [ $s -le 0 ] # if time less than 0 then switch mode
86 | then
87 | case $t in
88 | w)
89 | echo b > $pom_path
90 | eval "$break_command"
91 | paplay $HOME/.config/i3/scripts/bell.wav
92 | ;;
93 | b)
94 | echo w > $pom_path
95 | eval "$work_command"
96 | paplay $HOME/.config/i3/scripts/bell_end.wav
97 |
98 | ;;
99 | esac
100 | echo "$now" >> $pom_path
101 | fi
102 | display "$s" "$t"
103 | else
104 | echo "$msg_start"
105 | echo "$msg_start"
106 | echo "$start_color"
107 | fi
108 |
109 | case $BLOCK_BUTTON in
110 | 1)
111 | if [ -f $pom_path ]; then # if file exists then stop reset timer
112 | rm $pom_path
113 | else
114 | echo w > $pom_path # else start timer
115 | date +%s >> $pom_path
116 | fi
117 | ;;
118 | esac
119 | # è 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.
120 |
121 | fi
122 |
123 |
124 | if [ $pluto -eq "1" ];then
125 | ~/.config/i3/scripts/miei/timer.sh
126 | fi
127 |
128 | else
129 | echo "0" > /tmp/pomo_timer
130 | fi
131 |
132 |
133 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/powermenu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Use rofi/zenity to change system runstate thanks to systemd.
4 | #
5 | # Note: this currently relies on associative array support in the shell.
6 | #
7 | # Inspired from i3pystatus wiki:
8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
9 | #
10 | # Copyright 2015 Benjamin Chrétien
11 | #
12 | # This program is free software: you can redistribute it and/or modify
13 | # it under the terms of the GNU General Public License as published by
14 | # the Free Software Foundation, either version 3 of the License, or
15 | # (at your option) any later version.
16 |
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 |
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program. If not, see .
24 |
25 | # modified to work with latest rofi update by joekamprad
26 |
27 | #######################################################################
28 | # BEGIN CONFIG #
29 | #######################################################################
30 |
31 | # Use a custom lock script
32 | #LOCKSCRIPT="i3lock-extra -m pixelize"
33 |
34 | # Colors: FG (foreground), BG (background), HL (highlighted)
35 | FG_COLOR="#bbbbbb"
36 | BG_COLOR="#111111"
37 | HLFG_COLOR="#111111"
38 | HLBG_COLOR="#bbbbbb"
39 | BORDER_COLOR="#222222"
40 |
41 | # Options not related to colors (most rofi options do not work anymore)
42 | ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi)
43 | # Zenity options
44 | ZENITY_TITLE="Power Menu"
45 | ZENITY_TEXT="Action:"
46 | ZENITY_OPTIONS=(--column= --hide-header)
47 |
48 | #######################################################################
49 | # END CONFIG #
50 | #######################################################################
51 |
52 | # Whether to ask for user's confirmation
53 | enable_confirmation=false
54 |
55 | # Preferred launcher if both are available
56 | preferred_launcher="rofi"
57 |
58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
59 |
60 | where:
61 | -h show this help text
62 | -c ask for user confirmation
63 | -p preferred launcher (rofi or zenity)
64 |
65 | This script depends on:
66 | - systemd,
67 | - i3,
68 | - rofi or zenity."
69 |
70 | # Check whether the user-defined launcher is valid
71 | launcher_list=(rofi zenity)
72 | function check_launcher() {
73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
74 | echo "Supported launchers: ${launcher_list[*]}"
75 | exit 1
76 | else
77 | # Get array with unique elements and preferred launcher first
78 | # Note: uniq expects a sorted list, so we cannot use it
79 | i=1
80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
82 | fi
83 | }
84 |
85 | # Parse CLI arguments
86 | while getopts "hcp:" option; do
87 | case "${option}" in
88 | h) echo "${usage}"
89 | exit 0
90 | ;;
91 | c) enable_confirmation=true
92 | ;;
93 | p) preferred_launcher="${OPTARG}"
94 | check_launcher "${preferred_launcher}"
95 | ;;
96 | *) exit 1
97 | ;;
98 | esac
99 | done
100 |
101 | # Check whether a command exists
102 | function command_exists() {
103 | command -v "$1" &> /dev/null 2>&1
104 | }
105 |
106 | # systemctl required
107 | if ! command_exists systemctl ; then
108 | exit 1
109 | fi
110 |
111 | # menu defined as an associative array
112 | typeset -A menu
113 |
114 | # Menu with keys/commands
115 |
116 | menu=(
117 | [ Shutdown]="systemctl poweroff"
118 | [ Reboot]="systemctl reboot"
119 | [ Suspend]="systemctl suspend"
120 | [ Lock]="~/.config/i3/scripts/blur-lock"
121 | [ Logout]="i3-msg exit"
122 | )
123 |
124 | menu_nrows=${#menu[@]}
125 |
126 | # Menu entries that may trigger a confirmation message
127 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
128 |
129 | launcher_exe=""
130 | launcher_options=""
131 | rofi_colors=""
132 |
133 | function prepare_launcher() {
134 | if [[ "$1" == "rofi" ]]; then
135 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
136 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
137 | launcher_exe="rofi"
138 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
139 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
140 | elif [[ "$1" == "zenity" ]]; then
141 | launcher_exe="zenity"
142 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
143 | "${ZENITY_OPTIONS[@]}")
144 | fi
145 | }
146 |
147 | for l in "${launcher_list[@]}"; do
148 | if command_exists "${l}" ; then
149 | prepare_launcher "${l}"
150 | break
151 | fi
152 | done
153 |
154 | # No launcher available
155 | if [[ -z "${launcher_exe}" ]]; then
156 | exit 1
157 | fi
158 |
159 | launcher=(${launcher_exe} "${launcher_options[@]}")
160 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
161 |
162 | function ask_confirmation() {
163 | if [ "${launcher_exe}" == "rofi" ]; then
164 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
165 | "${rofi_colors}" "${ROFI_OPTIONS[@]}")
166 | [ "${confirmed}" == "Yes" ] && confirmed=0
167 | elif [ "${launcher_exe}" == "zenity" ]; then
168 | zenity --question --text "Are you sure you want to ${selection,,}?"
169 | confirmed=$?
170 | fi
171 |
172 | if [ "${confirmed}" == 0 ]; then
173 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
174 | fi
175 | }
176 |
177 | if [[ $? -eq 0 && ! -z ${selection} ]]; then
178 | if [[ "${enable_confirmation}" = true && \
179 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
180 | ask_confirmation
181 | else
182 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
183 | fi
184 | fi
185 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/volume:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Copyright (C) 2014 Julien Bonjean
3 | # Copyright (C) 2014 Alexander Keller
4 |
5 | # This program is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 3 of the License, or
8 | # (at your option) any later version.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 |
15 | # You should have received a copy of the GNU General Public License
16 | # along with this program. If not, see .
17 |
18 | # original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
19 | # check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
20 | #------------------------------------------------------------------------
21 |
22 | # The second parameter overrides the mixer selection
23 | # For PulseAudio users, eventually use "pulse"
24 | # For Jack/Jack2 users, use "jackplug"
25 | # For ALSA users, you may use "default" for your primary card
26 | # or you may use hw:# where # is the number of the card desired
27 | if [[ -z "$MIXER" ]] ; then
28 | MIXER="default"
29 | if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
30 | # pulseaudio is running, but not all installations use "pulse"
31 | if amixer -D pulse info >/dev/null 2>&1 ; then
32 | MIXER="pulse"
33 | fi
34 | fi
35 | [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
36 | MIXER="${2:-$MIXER}"
37 | fi
38 |
39 | # The instance option sets the control to report and configure
40 | # This defaults to the first control of your selected mixer
41 | # For a list of the available, use `amixer -D $Your_Mixer scontrols`
42 | if [[ -z "$SCONTROL" ]] ; then
43 | SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
44 | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
45 | head -n1
46 | )}"
47 | fi
48 |
49 | # The first parameter sets the step to change the volume by (and units to display)
50 | # This may be in in % or dB (eg. 5% or 3dB)
51 | if [[ -z "$STEP" ]] ; then
52 | STEP="${1:-5%}"
53 | fi
54 |
55 | # AMIXER(1):
56 | # "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
57 | # more natural for human ear."
58 | NATURAL_MAPPING=${NATURAL_MAPPING:-0}
59 | if [[ "$NATURAL_MAPPING" != "0" ]] ; then
60 | AMIXER_PARAMS="-M"
61 | fi
62 |
63 | #------------------------------------------------------------------------
64 |
65 | capability() { # Return "Capture" if the device is a capture device
66 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
67 | sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
68 | }
69 |
70 | volume() {
71 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
72 | }
73 |
74 | format() {
75 |
76 | perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
77 | perl_filter+='{CORE::say $4 eq "off" ? "0%" : "'
78 | # If dB was selected, print that instead
79 | perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
80 | perl_filter+='"; exit}'
81 | # output=$(/home/flavio/.config/i3/scripts/miei/volcolor.sh)
82 | # valore=${output::-1}
83 | # basandomi sul valore di output cambio icona
84 | ~/.config/i3/scripts/miei/volcolor.sh
85 | }
86 |
87 | #------------------------------------------------------------------------
88 |
89 | case $BLOCK_BUTTON in
90 | 1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
91 | 3) pavucontrol;;
92 |
93 | 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
94 | 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
95 | esac
96 |
97 | volume | format
98 |
--------------------------------------------------------------------------------
/i3_polybar/scripts/volume_brightness.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
3 |
4 | # taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
5 |
6 | # See README.md for usage instructions
7 | bar_color="#a6da95"
8 | volume_step=5
9 | brightness_step=5%
10 | max_volume=100
11 |
12 | # Uses regex to get volume from pactl
13 | function get_volume {
14 | pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
15 | }
16 |
17 | # Uses regex to get mute status from pactl
18 | function get_mute {
19 | pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
20 | }
21 |
22 | # Uses regex to get brightness from xbacklight
23 | function get_brightness {
24 | brightnessctl g | grep -Po '[0-9]{1,3}' | head -n 1
25 |
26 | }
27 |
28 | # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
29 | function get_volume_icon {
30 | volume=$(get_volume)
31 | mute=$(get_mute)
32 | if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
33 | volume_icon=" "
34 | elif [ "$volume" -lt 50 ]; then
35 | volume_icon=" "
36 | else
37 | volume_icon=" "
38 | fi
39 | }
40 |
41 | # Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
42 | function get_brightness_icon {
43 | brightness_icon=" "
44 | }
45 |
46 | # Displays a volume notification using dunstify
47 | function show_volume_notif {
48 | volume=$(get_mute)
49 | get_volume_icon
50 | dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
51 | }
52 |
53 | # Displays a brightness notification using dunstify
54 | function show_brightness_notif {
55 | massima=$(brightnessctl m)
56 | brightness=$(($(get_brightness)*100/$massima))
57 | get_brightness_icon
58 | dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color
59 | }
60 |
61 | # Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
62 | case $1 in
63 | volume_up)
64 | # Unmutes and increases volume, then displays the notification
65 | pactl set-sink-mute @DEFAULT_SINK@ 0
66 | volume=$(get_volume)
67 | if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
68 | pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
69 | else
70 | pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
71 | fi
72 | show_volume_notif
73 | ;;
74 |
75 | volume_down)
76 | # Raises volume and displays the notification
77 | pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
78 | show_volume_notif
79 | ;;
80 |
81 | volume_mute)
82 | # Toggles mute and displays the notification
83 | pactl set-sink-mute @DEFAULT_SINK@ toggle
84 | show_volume_notif
85 | ;;
86 |
87 | brightness_up)
88 | # Increases brightness and displays the notification
89 | brightnessctl s +$brightness_step
90 | show_brightness_notif
91 | ;;
92 |
93 | brightness_down)
94 | # Decreases brightness and displays the notification
95 | brightnessctl s $brightness_step-
96 | show_brightness_notif
97 | ;;
98 | esac
99 |
--------------------------------------------------------------------------------
/kitty/kitty.conf:
--------------------------------------------------------------------------------
1 | enable_audio_bell no
2 | font_family FiraCodeNerdFont
3 | bold_font auto
4 | italic_font auto
5 | bold_italic_font auto
6 |
7 | font_size 11
8 | background_opacity 0.80
9 | confirm_os_window_close 0
10 |
11 |
12 |
13 |
14 | # vim:ft=kitty
15 |
16 | ## name: Catppuccin Kitty Mocha
17 | ## author: Catppuccin Org
18 | ## license: MIT
19 | ## upstream: https://github.com/catppuccin/kitty/blob/main/themes/mocha.conf
20 | ## blurb: Soothing pastel theme for the high-spirited!
21 |
22 |
23 |
24 | # The basic colors
25 | foreground #CDD6F4
26 | background #1E1E2E
27 | selection_foreground #1E1E2E
28 | selection_background #F5E0DC
29 |
30 | # Cursor colors
31 | cursor #F5E0DC
32 | cursor_text_color #1E1E2E
33 |
34 | # URL underline color when hovering with mouse
35 | url_color #F5E0DC
36 |
37 | # Kitty window border colors
38 | active_border_color #B4BEFE
39 | inactive_border_color #6C7086
40 | bell_border_color #F9E2AF
41 |
42 | # OS Window titlebar colors
43 | wayland_titlebar_color #1E1E2E
44 | macos_titlebar_color #1E1E2E
45 |
46 | # Tab bar colors
47 | active_tab_foreground #11111B
48 | active_tab_background #CBA6F7
49 | inactive_tab_foreground #CDD6F4
50 | inactive_tab_background #181825
51 | tab_bar_background #11111B
52 |
53 | # Colors for marks (marked text in the terminal)
54 | mark1_foreground #1E1E2E
55 | mark1_background #B4BEFE
56 | mark2_foreground #1E1E2E
57 | mark2_background #CBA6F7
58 | mark3_foreground #1E1E2E
59 | mark3_background #74C7EC
60 |
61 | # The 16 terminal colors
62 |
63 | # black
64 | color0 #45475A
65 | color8 #585B70
66 |
67 | # red
68 | color1 #F38BA8
69 | color9 #F38BA8
70 |
71 | # green
72 | color2 #A6E3A1
73 | color10 #A6E3A1
74 |
75 | # yellow
76 | color3 #F9E2AF
77 | color11 #F9E2AF
78 |
79 | # blue
80 | color4 #89B4FA
81 | color12 #89B4FA
82 |
83 | # magenta
84 | color5 #F5C2E7
85 | color13 #F5C2E7
86 |
87 | # cyan
88 | color6 #94E2D5
89 | color14 #94E2D5
90 |
91 | # white
92 | color7 #BAC2DE
93 | color15 #A6ADC8
94 |
--------------------------------------------------------------------------------
/picom/picom.conf:
--------------------------------------------------------------------------------
1 |
2 | #################################
3 | #
4 | # Backend
5 | #
6 | #################################
7 |
8 | # Backend to use: "xrender" or "glx".
9 | # GLX backend is typically much faster but depends on a sane driver.
10 |
11 | # backend = "xrender";
12 | # backend = "xr_glx_hybrid";
13 | backend = "glx";
14 |
15 | #################################
16 | #
17 | # GLX backend
18 | #
19 | #################################
20 |
21 | glx-no-stencil = true;
22 |
23 | # GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
24 | # My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
25 | # but a 20% increase when only 1/4 is.
26 | # My tests on nouveau show terrible slowdown.
27 | # Useful with --glx-swap-method, as well.
28 | glx-copy-from-front = false;
29 |
30 | # GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
31 | # My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
32 | # May break VSync and is not available on some drivers.
33 | # Overrides --glx-copy-from-front.
34 | # glx-use-copysubbuffermesa = true;
35 |
36 | # GLX backend: Avoid rebinding pixmap on window damage.
37 | # Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
38 | # Recommended if it works.
39 |
40 | glx-no-rebind-pixmap = true;
41 |
42 |
43 | use-damage = false;
44 |
45 | # Disabled to avoid artifacts painting under blur transparent windows.
46 |
47 | #################################
48 | #
49 | # Shadows
50 | #
51 | #################################
52 |
53 | # Enabled client-side shadows on windows.
54 | shadow = true;
55 |
56 |
57 | # The blur radius for shadows. (default 12)
58 | shadow-radius = 10;
59 | # The left offset for shadows. (default -15)
60 | shadow-offset-x = -10;
61 | # The top offset for shadows. (default -15)
62 | shadow-offset-y = -10;
63 | # The translucency for shadows. (default .75)
64 | shadow-opacity = 0.4;
65 |
66 | # Set if you want different colour shadows
67 | # shadow-red = 0.0;
68 | # shadow-green = 0.0;
69 | # shadow-blue = 0.0;
70 |
71 |
72 |
73 | # shadow-exclude-reg = "x10+0+0";
74 | # xinerama-shadow-crop = true;
75 |
76 |
77 | # The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
78 | # (most applications are fine, only apps that do weird things with xshapes or argb are affected).
79 | # This list includes all the affected apps I found in my testing. The "! name~=''" part excludes
80 | # shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
81 |
82 | # shadow-exclude = "n:e:Notification";
83 |
84 | shadow-exclude = [
85 | "_GTK_FRAME_EXTENTS@:c",
86 | # Removed to avoid no-shadow in modal dialog windows.
87 | # "! name~=''",
88 | "name = 'Notification'",
89 | "name = 'Plank'",
90 | "name = 'Docky'",
91 | "name = 'Kupfer'",
92 | "name = 'Pensela'",
93 | "name = 'Drawing Board'",
94 | #
95 | # Workaround for VirtualBox empty window at launching
96 | "name = 'VirtualBox'",
97 | "name = 'VirtualBoxVM'",
98 | #
99 | # Avoid shadow in Negatron popups
100 | "name = 'Negatron v0.100.1' && argb",
101 | #
102 | # Avoid shadow for the XFCE alt tab TaskSwitcher
103 | "name ?= 'xfwm4' && argb",
104 | #
105 | # "name *= 'compton'",
106 | "class_g = 'Conky'",
107 | "class_g = 'Kupfer'",
108 | "class_g = 'Synapse'",
109 | "class_g ?= 'Notify-osd'",
110 | "class_g ?= 'Cairo-dock'",
111 | "class_g = 'Cairo-clock'",
112 | "class_g ?= 'Xfce4-notifyd'",
113 | #
114 | # Exclude special Firefox/Firefox-esr/Thunderbird dropdowns.
115 | # Ref: https://github.com/chjj/compton/issues/247
116 | "class_g = 'Thunderbird' && argb",
117 | "class_g = 'Telegram' && argb",
118 | "name ?= 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu')",
119 | #
120 | # Exclude some special popup menu shadows, but Modal Windows.
121 | # These are more finetuning thant previous ones:
122 | "class_g ?= 'Thunderbird' && class_i = 'Popup' && argb",
123 | "class_g = 'firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
124 | "class_g = 'Firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
125 | "class_g = 'firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
126 | "class_g = 'Firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
127 | "class_g = 'Tor Browser' && (window_type = 'utility') && argb",
128 | "class_g = 'Navegador Tor' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
129 | "class_g = 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
130 | "class_g = 'Mozilla Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb",
131 | "class_g ?= 'Xfce4-power-manager'",
132 | #
133 | # Exclude Vokoscreen and VokoscreenNG area selector
134 | #
135 | "class_g ?= 'vokoscreen' && argb",
136 | "name = 'Área'",
137 | "name *= 'Cuenta regresiva'",
138 | "_NET_WM_WINDOW_TYPE:a *= '_KDE_NET_WM_WINDOW_TYPE_OVERRIDE'"
139 | # "override_redirect = true"
140 | ];
141 | # Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
142 | # Deprecated, use --shadow-exclude 'bounding_shaped' or --shadow-exclude 'bounding_shaped && !rounded_corners' instead.
143 | shadow-ignore-shaped = false;
144 |
145 |
146 |
147 |
148 | #################################
149 | #
150 | # Opacity
151 | #
152 | #################################
153 |
154 |
155 | inactive-opacity = 1;
156 | active-opacity = 1;
157 | frame-opacity = 1;
158 | inactive-opacity-override = false;
159 |
160 |
161 | # Desaturate and darken the inactive windows
162 | # Dim inactive windows. (0.0 - 1.0)
163 |
164 | #inactive-dim = 0.2;
165 | #inactive-dim-fixed = true;
166 |
167 |
168 |
169 |
170 | # Do not let dimness adjust based on window opacity.
171 | # inactive-dim-fixed = true;
172 |
173 |
174 | # Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
175 |
176 | blur-background = true;
177 |
178 | blur:
179 | {
180 | method = "gaussian";
181 | size = 20;
182 | deviation = 15;
183 | };
184 |
185 |
186 |
187 | #blur-method = "kernel";
188 | #blur-size = 50;
189 | #blur-deviation = 5.0;
190 |
191 |
192 |
193 | # Blur background of opaque windows with transparent frames as well.
194 | # blur-background-frame = true;
195 | # Do not let blur radius adjust based on window opacity.
196 | #blur-background-fixed = true;
197 |
198 | # blur-kern = "3x3box";
199 | # blur-kern = "5x5box";
200 | # blur-kern = "5x5gaussian"
201 | #blur-kern = "9x9gaussian"
202 |
203 | blur-background-exclude = [
204 | "class_g = 'Peek'",
205 | "class_g = 'slop'",
206 | "class_g = 'Pensela'",
207 | "name = 'Drawing Board'",
208 | # "window_type = 'dock'",
209 | "window_type = 'dropdown_menu'",
210 | "window_type = 'combo'",
211 | "window_type = 'popup_menu'",
212 | "window_type = 'utility'",
213 | "window_type = 'desktop'",
214 | "_GTK_FRAME_EXTENTS@:c"
215 | ];
216 | opacity-exclude = [
217 | "name = 'Stratagus'"
218 | ];
219 |
220 | opacity-rule = [
221 | "90:class_g = 'Rofi'",
222 | "85:class_g = 'i3bar'",
223 | "85:name = 'Startpage Search Results – Mozilla Firefox'",
224 | "85:name = 'Mozilla Firefox'",
225 | "90:name = 'Iscrizioni - FreeTube'",
226 | "90:class_g = 'Thunar'",
227 | #"90:class_g = 'Evince'",
228 | "90:class_g = 'Anki'",
229 | ];
230 | #################################
231 | #
232 | # Fading
233 | #
234 | #################################
235 |
236 | fading = true;
237 | # fade-delta = 30;
238 | #fade-in-step = 0.03;
239 | #fade-out-step = 0.03;
240 | fade-in-step = 0.07;
241 | fade-out-step = 0.07;
242 | # no-fading-openclose = true;
243 | # no-fading-destroyed-argb = true;
244 | fade-exclude = [ ];
245 |
246 |
247 |
248 | #################################
249 | #
250 | # OTHER CONFIG
251 | #
252 | #################################
253 |
254 | log-level = "warn";
255 | # log-file = "/path/to/your/log/file";
256 |
257 |
258 | mark-wmwin-focused = true;
259 | mark-ovredir-focused = true;
260 | # use-ewmh-active-win = true;
261 | detect-rounded-corners = true;
262 | detect-client-opacity = true;
263 | refresh-rate = 0;
264 |
265 |
266 | vsync = true;
267 |
268 |
269 | # sw-opti = true;
270 | # unredir-if-possible = true;
271 | # unredir-if-possible-delay = 5000;
272 | # unredir-if-possible-exclude = [ ];
273 |
274 | focus-exclude = [ "class_g = 'Cairo-clock'" ];
275 |
276 | detect-transient = true;
277 | detect-client-leader = true;
278 | invert-color-include = [ ];
279 |
280 | resize-damage = 2;
281 |
282 |
283 |
284 |
285 |
286 | #################################
287 | #
288 | # Window type settings
289 | #
290 | #################################
291 | wintypes:
292 | {
293 | dock = { shadow = false; }
294 | dnd = { shadow = false; }
295 | popup_menu = { opacity = 1; }
296 | dropdown_menu = { opacity = 1; }
297 |
298 | # This avoid problems with transparent windows while use-damage = true;.
299 | # normal = { full-shadow = true;};
300 |
301 | # tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
302 |
303 |
304 |
305 | };
306 |
307 |
308 |
309 | #################################
310 | #
311 | # Deprecated
312 | #
313 | #################################
314 |
315 |
316 | # Avoid drawing shadows on dock/panel windows.
317 | # This option is deprecated, you should use the wintypes option in your config file instead.
318 | # no-dock-shadow = false;
319 |
320 |
321 | # Don't draw shadows on DND windows.
322 | # This option is deprecated, you should use the wintypes option in your config file instead.
323 | # no-dnd-shadow = false;
324 |
325 | # Option `menu-opacity` is deprecated, and will be removed.Please use the wintype option `opacity` of `popup_menu` and `dropdown_menu` instead.
326 | # menu-opacity = 1;
327 |
328 | # GLX backend: GLX buffer swap method we assume.
329 | # Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
330 | # undefined is the slowest and the safest, and the default value.
331 | # copy is fastest, but may fail on some drivers,
332 | # 2-6 are gradually slower but safer (6 is still faster than 0).
333 | # Usually, double buffer means 2, triple buffer means 3.
334 | # buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
335 | # Useless with --glx-use-copysubbuffermesa.
336 | # Partially breaks --resize-damage.
337 | # Defaults to undefined.
338 | # glx-swap-method has been deprecated since v6, your setting "undefined" should be replaced by `use-damage = true`
339 | # glx-swap-method = "undefined";
340 |
341 |
342 | # Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
343 | # "clear-shadow" is removed as an option, and is always enabled now. Consider removing it from your config file
344 | # clear-shadow = true;
345 |
346 | # "alpha-step" has been removed, compton now tries to make use of all alpha values
347 | # alpha-step = 0.06;
348 |
349 |
--------------------------------------------------------------------------------
/polybar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jifuwater/Cattendeavour/9b8e9175982c2766459cc05a1362088292df8bb3/polybar.png
--------------------------------------------------------------------------------
/polybar/config.ini:
--------------------------------------------------------------------------------
1 | ;=========================================================
2 | ;
3 | ;
4 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
5 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
6 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
7 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
8 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
9 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
10 | ;
11 | ;
12 | ; To learn more about how to configure Polybar
13 | ; go to https://github.com/polybar/polybar
14 | ;
15 | ; The README contains a lot of information
16 | ;
17 | ;==========================================================
18 |
19 | [colors]
20 | background = #00282A2E
21 | background-alt = #373B41
22 | foreground = #cdd6f4
23 | primary = #F0C674
24 | secondary = #8ABEB7
25 | alert = #A54242
26 | disabled = #707880
27 |
28 | [bar/example]
29 | width = 100%
30 | height = 18pt
31 | radius = 0
32 |
33 | ; dpi = 96
34 |
35 | background = ${colors.background}
36 | foreground = ${colors.foreground}
37 |
38 | line-size = 2pt
39 |
40 | border-size = 0pt
41 | border-color = #00000000
42 |
43 | padding-left = 0
44 | padding-right = 0
45 |
46 | module-margin = 0
47 |
48 | separator =
49 | separator-foreground = ${colors.disabled}
50 |
51 | font-0 = "FiraCode Nerd Font:pixelsize=12;0"
52 | font-1 = "NotoColorEmoji:scale=10"
53 |
54 | modules-left = rofi i3 timer lofi todo wall term close
55 | #modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date powermenu
56 | modules-right = meteo cpu pomo powerprofiles pulseaudio date powermenu
57 | modules-center = xworkspaces
58 |
59 | cursor-click = pointer
60 | cursor-scroll = ns-resize
61 |
62 | enable-ipc = true
63 | ; wm-restack = generic
64 | ; wm-restack = bspwm
65 | ; wm-restack = i3
66 |
67 | ; override-redirect = true
68 |
69 |
70 | [module/timer]
71 | type = custom/script
72 |
73 | exec = ~/.config/polybar/script/timer/timer.sh
74 | tail = true
75 | scroll-up = ~/.config/polybar/script/timer/toggle.sh up
76 | scroll-down = ~/.config/polybar/script/timer/toggle.sh dw
77 | click-left = ~/.config/polybar/script/timer/toggle.sh start
78 | label-background = #CC1e1e2e
79 | label-underline = #a6e3a1
80 | interval = 0.1
81 |
82 | [module/lofi]
83 | type = custom/script
84 |
85 | exec = ~/.config/polybar/script/lofi/lofi.sh
86 | tail = true
87 | click-left = ~/.config/polybar/script/lofi/stop.sh
88 | label-background = #CC1e1e2e
89 | label-underline = #b4befe
90 | label-foreground = #b4befe
91 | interval = 0.1
92 |
93 |
94 |
95 | [module/systray]
96 | type = internal/tray
97 |
98 | format-margin = 8pt
99 | tray-spacing = 16pt
100 | tray-background = #CC1e1e2e
101 |
102 | [module/tray]
103 | type = custom/script
104 | exec = echo "<"
105 | format =