diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..4a6518d --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,435 @@ +# See dunst(5) for all configuration options + +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = none + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = 300 + + # The maximum height of a single notification, excluding the frame. + height = 300 + + # Position the notification in the top right corner + origin = top-right + + # Offset from the origin + offset = 40x60 + + # Scale factor. It is auto-detected if value is 0. + scale = 0 + + # Maximum number of notification (0 means no limit) + notification_limit = 5 + ### Progress bar ### + + # Turn on the progress bar. It appears when a progress hint is passed with + # for example dunstify -h int:value:12 + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + + # Show how many messages are currently hidden (because of + # notification_limit). + indicate_hidden = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). (X11 only) + transparency = 15 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 8 + + # Padding between text and icon. + text_icon_padding = 0 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 2 + + # Defines color of the frame around the notification window. + frame_color = "#a6e3a1" + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = auto + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + idle_threshold = 0 + + ### Text ### + + font = Noto Sans Regular 9 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # bold + # italic + # strikethrough + # underline + # + # For a complete reference see + # . + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = true + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = true + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + ### Icons ### + + # Align icons left/right/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 0 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 32 + + # Paths to default icons. + #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ + 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/ + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = false + + # Maximum amount of notifications kept in history + history_length = 0 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/xdg-open + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + #corner_radius = 10 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#313244" + foreground = "#ffffff" + timeout = 5 + # Icon for notifications with low urgency, uncomment to enable + icon = /usr/share/icons/Arc-X-D/status/16/dialog-information.png + +[urgency_normal] + background = "#313244" + foreground = "#ffffff" + timeout = 5 + # Icon for notifications with normal urgency, uncomment to enable + icon = /usr/share/icons/Arc-X-D/status/16/dialog-question.png + +[urgency_critical] + background = "#313244" + foreground = "#ffffff" + frame_color = "#f38ba8" + timeout = 120 + # Icon for notifications with critical urgency, uncomment to enable + icon = /usr/share/icons/Arc-X-D/status/16/dialog-warning.png + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# set_category +# timeout +# urgency +# skip_display +# history_ignore +# action_name +# word_wrap +# ellipsize +# alignment +# +# Shell-like globing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +[stack-volumes] + appname = "some_volume_notifiers" + set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..b7666ca --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,438 @@ +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause +bindsym XF86AudioNext exec --no-startup-id playerctl next +bindsym XF86AudioPrev exec --no-startup-id playerctl previous + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+q exec kitty +bindsym $mod+e exec dolphin +bindsym Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png +# kill focused window +bindsym $mod+c kill + +##################################### +# Application menu handled by rofi: # +##################################### + +## rofi bindings fancy application menu ($mod+d /F9 optional disabled) + +bindsym $mod+space exec --no-startup-id rofi -modi drun -show drun \ + -config ~/.config/rofi/rofidmenu.rasi + +#bindsym F9 exec --no-startup-id rofi -modi drun -show drun \ +# -config ~/.config/rofi/rofidmenu.rasi + +## rofi bindings for window menu ($mod+t /F10 optional disabled) + +bindsym $mod+a exec --no-startup-id rofi -show window \ + -config ~/.config/rofi/rofidmenu.rasi + +#bindsym F10 exec --no-startup-id rofi -show window \ +# -config ~/.config/rofi/rofidmenu.rasi + +## rofi bindings to manage clipboard (install rofi-greenclip from the AUR) + +#exec --no-startup-id greenclip daemon>/dev/null +#bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \ +# -config ~/.config/rofi/rofidmenu.rasi + + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+n split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+Shift+s layout stacking +bindsym $mod+Shift+w layout tabbed +bindsym $mod+Shift+e layout toggle split + +# toggle tiling / floating +bindsym $mod+v floating toggle + +# change focus between tiling / floating windows +#bindsym $mod+space focus mode_toggle + +# focus the parent container +#bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} + +############################## +# extra options for windows: # +############################## +default_border pixel 1 +# Set inner/outer gaps +gaps inner 2 +gaps outer 0 + +# show window title bars (not officially supported with i3gaps) +#default_border normal +default_border pixel 2 +# window title alignment +#title_align center + +############## +# compositor # +############## + +# transparency +# uncomment one of them to be used +# options could need changes, related to used GPU and drivers. +# to find the right setting consult the archwiki or ask at the forum. +# +# xcompmgr: https://wiki.archlinux.org/title/Xcompmgr +# manpage: https://man.archlinux.org/man/xcompmgr.1.en +# install xcompmgr package to use it (yay -S xcompmgr) +#exec --no-startup-id xcompmgr -C -n & +# or an more specialized config like this: +#exec --no-startup-id xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 & +# +# or: +# +# picom: https://wiki.archlinux.org/title/Picom +# manpage: https://man.archlinux.org/man/picom.1.en +# The default configuration is available in /etc/xdg/picom.conf +# For modifications, it can be copied to ~/.config/picom/picom.conf or ~/.config/picom.conf +# install picom package (yay -S picom) +# start using default config +#exec_always --no-startup-id picom -b +# +# for custom config: +#exec --no-startup-id picom --config ~/.config/picom/picom.conf + +############################################# +# autostart applications/services on login: # +############################################# + +exec_always autotiling +#fix monitor layout +exec --no-startup-id "xrandr --output HDMI-0 --left-of DP-0 && xrandr --output DP-0 --mode 2560x1440 --rate 165.00" + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +#exec_always --no-startup-id nm-tray +#exec --no-startup-id nm-applet +#get auth work with polkit-gnome +#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +# dex execute .desktop files + apps using /etc/xdg/autostart. +# when second to i3 a DE is installed or mixed usage of i3 + xfce4 or GNOME +# in this cases better disable dex and use manual starting apps using xdg/autostart +# if enabled you should comment welcome app. +# https://github.com/jceb/dex +#exec --no-startup-id dex -a -s /etc/xdg/autostart/:~/.config/autostart/ +#exec --no-startup-id dex --autostart --environment i3 +#exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK +# start welcome app +#exec --no-startup-id sh /usr/share/endeavouros/scripts/welcome --startdelay=3 + +# num lock activated +#exec --no-startup-id numlockx on + +# configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example) +#exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle' + +# start conky: +#exec_always --no-startup-id conky + +# start a script to setup displays +# uncomment the next line, use arandr to setup displays and save the file as monitor: +#exec --no-startup-id ~/.screenlayout/monitor.sh + +# set wallpaper +# exec --no-startup-id sleep 2 && nitrogen --restore +exec_always --no-startup-id sleep 1 && feh --bg-fill $HOME/.config/wallpapers/yuyukowallpaper.png + +# set powersavings for display: +# exec --no-startup-id xset s 480 dpms 600 600 600 +#exec --no-startup-id xset s off + +# disable power saving (for example if using xscreensaver) +#exec --no-startup-id xset -dpms + +#blur enable +#blur_xray enable +#blur_passes 2 +#blur_radius 5 + +# use xautolock to use autosuspend rules for mobile devices +# https://wiki.archlinux.org/title/Session_lock#xautolock +#exec --no-startup-id xautolock -time 60 -locker "systemctl suspend" + + +# xscreensaver +# https://www.jwz.org/xscreensaver +#exec --no-startup-id xscreensaver --no-splash + +# Desktop notifications +# dunst config used ~/.config/dunst/dunstrc +# set alternative config if needed: +#exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc +# may need to run dbus-launch explicitly: +#exec --no-startup-id dbus-launch /usr/bin/dunst +#exec --no-startup-id /usr/bin/env dunst +# alternative if you installed aside with XFCE4: +# exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd & + +# autotiling script +# https://github.com/nwg-piotr/autotiling +# `yay -S autotiling ;) (it is in AUR) +#exec_always --no-startup-id autotiling + +# Autostart apps as you like +#exec --no-startup-id sleep 2 && xfce4-terminal +#exec --no-startup-id sleep 7 && firefox https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md +#exec --no-startup-id sleep 3 && thunar + +############### +# system tray # +############### +# if you do not use dex: exec --no-startup-id dex --autostart --environment i3 +# you need to have tray apps started manually one by one: + +# start blueberry app for managing bluetooth devices from tray: +#exec_always --no-startup-id blueberry-tray + +# networkmanager-applet +# clipman-applet +#exec --no-startup-id xfce4-clipman + + +###################################### +# color settings for bar and windows # +###################################### + +# Define colors variables: +set $darkbluetrans #313244 +set $darkblue #b4befe +set $lightblue #eba0ac +#set $urgentred #e53935 + +set $urgentred #f38ba8 +set $white #cdd6f4 +set $black #1e1e2e +set $purple #6870A1 +set $darkgrey #383c4a +set $grey #b0b5bd +set $mediumgrey #8b8b8b +set $yellowbrown #e1b700 + +# define colors for windows: +#class border bground text indicator child_border + +client.focused $darkblue $black $white $darkblue $darkblue +client.unfocused $purple $black $grey $darkgrey $darkgrey +client.focused_inactive $black $black $grey $darkgrey $darkgrey +client.urgent $urgentred $urgentred $white $darkblue $yellowbrown +############################################ +# bar settings (input comes from i3blocks) # +############################################ + +# Start i3bar to display a workspace bar +# (plus the system information i3status finds out, if available) +#bar { +#id bar-primary +#mode dock +# font pango: FiraCode Nerd Font medium 11.3 +# status_command i3blocks -c ~/.config/i3/i3blocks.conf +# position top +## i3bar_command i3bar --transparency +## it could be that you have no primary display set: set one (xrandr --output --primary) +## reference: https://i3wm.org/docs/userguide.html#_tray_output +##tray_output primary +##tray_output none +#tray_output none +## When strip_workspace_numbers is set to yes, +## any workspace that has a name of the form +## “[n][:][NAME]” will display only the name. +#strip_workspace_numbers yes +###strip_workspace_name no +# +# colors { +# separator $purple +# # background $darkgrey +# background #1e1e2eD9 +# statusline $white +## border bg txt +# focused_workspace #1e1e2eD9 #1e1e2eD9 #b4befe +# active_workspace #1e1e2eD9 #1e1e2eD9 #a6adc8 +# inactive_workspace #1e1e2eD9 #1e1e2eD9 #7f849c +# urgent_workspace #1e1e2eD9 #1e1e2eD9 #a6e3a1 +# +# } +#} +# +#bar { +#id bar-tray +#mode invisible +# font pango: FiraCode Nerd Font medium 11.3 +# status_command i3blocks -c ~/.config/i3/i3blocks.conf +# position top +##modifier none +## i3bar_command i3bar --transparency +## it could be that you have no primary display set: set one (xrandr --output --primary) +## reference: https://i3wm.org/docs/userguide.html#_tray_output +##tray_output primary +# +## When strip_workspace_numbers is set to yes, +## any workspace that has a name of the form +## “[n][:][NAME]” will display only the name. +#strip_workspace_numbers yes +###strip_workspace_name no +# +# colors { +# separator $purple +# # background $darkgrey +# background #1e1e2eD9 +# statusline $white +## border bg txt +# focused_workspace #1e1e2eD9 #1e1e2eD9 #cdd6f4 +# active_workspace #1e1e2eD9 #1e1e2eD9 #a6adc8 +# inactive_workspace #1e1e2eD9 #1e1e2eD9 #7f849c +# urgent_workspace #1e1e2eD9 #1e1e2eD9 #a6e3a1 +# } +#} +#bindsym $mod+p bar mode dock bar-tray; bar mode invisible bar-primary diff --git a/.config/i3/i3blocks.conf b/.config/i3/i3blocks.conf new file mode 100644 index 0000000..c1daecf --- /dev/null +++ b/.config/i3/i3blocks.conf @@ -0,0 +1,184 @@ +# File configurazione i3block + + +separator=false +markup=pango +separator_block_width=6 +color=#cdd6f4 + + + +[search] +full_text= 󰍉 +color=#f38ba8 +command= rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi + +#[files] +#full_text=  +#color=#cba6f7 +#command=i3-msg -q exec thunar ~/ + +[todo] +full_text=  +color=#89b4fa +command=rofi -config ~/.config/rofi/todo.rasi -modi Todo:~/.config/rofi/rofitodo.sh -show Todo + +[wallpaper] +full_text=󰸉 +color=#fab387 +command=~/.config/i3/scripts/miei/wallpaper.sh + +[expander] +full_text=  +command=i3-msg -q "exec --no-startup-id ~/.config/i3/scripts/miei/active.sh" +color=#b4befe + +[terminal] +full_text=  +color=#94e2d5 +command=i3-msg -q exec kitty + + +[close] +full_text= 󰅙 +color=#f38ba8 +command=i3-msg -q kill +separator_block_width=0 + + +[simple-2] +full_text=: +color=#717171 + + +#[meteo] +#command=~/.config/i3/scripts/miei/meteo.sh +#interval=1000 + +[separator] +full_text="⟨" +color=#585b70 + +#[update] +#full_text= +#command=~/.config/i3/scripts/miei/update.sh +#interval=1800 + + + +[separator] +full_text="⟨" +color=#585b70 + +[cpu_usage] +full_text= +label= +command=~/.config/i3/scripts/miei/cpu.sh +interval=10 + +#[separator] +#full_text="⟨" +#color=#585b70 + +#[news] +#full_text="" +#command=~/.config/i3/scripts/miei/feed.sh +#interval=once + + +[separator] +full_text="⟨" +color=#585b70 + +#[pavucontrol] +#full_text= +#command=pavucontrol + +[volume-pulseaudio] +command=~/.config/i3/scripts/volume +instance=Master +interval=1 + + +#[timer] +#full_text= +#command=~/.config/i3/scripts/miei/timer.sh +#interval=1 + + +[separator] +full_text="⟨" +color=#585b70 + +[pomodoro] +command=~/.config/i3/scripts/pomodoro.sh +interval=1 + +[separator] +full_text="⟨" +color=#585b70 + +#[gestione_energia] +#full_text= +#command=/home/flavio/.config/i3/scripts/miei/energia.sh +#interval=once + + + +[separator] +full_text="⟨" +color=#585b70 + +#[battery] +#command=~/.config/i3/scripts/battery2 +#label= +#interval=30 + +#[separator] +#full_text="|" + +#[separator] +#full_text="|" +#color=#585b70 +[icona] +full_text=󰁹 + +#[battery] +#command=~/.config/i3/scripts/miei/power.sh +#label= +#interval=1 + +[separator] +full_text="⟨" +color=#585b70 + +[time] +full_text= +label= +interval=1 +command=~/.config/i3/scripts/miei/ora.sh +separator_block_width=10 +color=#b4befe + +#color=#f38ba8 + +[separator] +full_text=" " +separator_block_width=0 +background=#272836 + + + + +[shutdown_menu] +full_text= +#full_text= +command=~/.config/i3/scripts/powermenu +#color=#b4befe + +#color=#f5e0dc +#background=#e71853 +background=#313244 +#separator_block_width=0 +#color=#f38ba8 +separator_block_width=0 diff --git a/.config/i3/scripts/bell.wav b/.config/i3/scripts/bell.wav new file mode 100644 index 0000000..d2d34f1 Binary files /dev/null and b/.config/i3/scripts/bell.wav differ diff --git a/.config/i3/scripts/bell_end.wav b/.config/i3/scripts/bell_end.wav new file mode 100644 index 0000000..7e3d6ad Binary files /dev/null and b/.config/i3/scripts/bell_end.wav differ diff --git a/.config/i3/scripts/blur-lock b/.config/i3/scripts/blur-lock new file mode 100644 index 0000000..4ff7ed6 --- /dev/null +++ b/.config/i3/scripts/blur-lock @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +PICTURE=/tmp/i3lock.png +SCREENSHOT="scrot -z $PICTURE" + +BLUR="5x4" + +$SCREENSHOT +convert $PICTURE -blur $BLUR $PICTURE +i3lock -i $PICTURE +rm $PICTURE diff --git a/.config/i3/scripts/miei/active.sh b/.config/i3/scripts/miei/active.sh new file mode 100755 index 0000000..96b1870 --- /dev/null +++ b/.config/i3/scripts/miei/active.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +if [ -f /tmp/tray ]; then + var=$(cat /tmp/tray) + if [ $var == 1 ]; then + echo 0 > /tmp/tray + i3-msg -q "bar mode dock bar-tray" + i3-msg -q "bar mode invisible bar-primary" + fi + + if [ $var == 0 ]; then + echo 1 > /tmp/tray + i3-msg -q "bar mode invisible bar-tray" + i3-msg -q "bar mode dock bar-primary" + + fi +else + echo 0 > /tmp/tray + i3-msg -q "bar mode dock bar-tray" + i3-msg -q "bar mode invisible bar-primary" +fi diff --git a/.config/i3/scripts/miei/cpu.sh b/.config/i3/scripts/miei/cpu.sh new file mode 100755 index 0000000..a043f49 --- /dev/null +++ b/.config/i3/scripts/miei/cpu.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +if [ $BLOCK_BUTTON == 1 ]; then + kitty -e htop +fi + +echo ""$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%" diff --git a/.config/i3/scripts/miei/energia.sh b/.config/i3/scripts/miei/energia.sh new file mode 100755 index 0000000..df097da --- /dev/null +++ b/.config/i3/scripts/miei/energia.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +a=0 +path=~/.config/i3/scripts/miei/energia.sh + +if [ $BLOCK_BUTTON == 1 ] +then +if [ $a == 0 ] +then + sed -i '2d' $path + sed -i '2ia=1' $path + a=1 +else + sed -i '2d' $path + sed -i '2ia=0' $path + a=0 +fi +fi + +if [ $a == 1 ]; then + +echo " Pro" +powerprofilesctl set balanced + +fi + +if [ $a == 0 ]; then +echo " Eco" +powerprofilesctl set power-saver +fi + + + + + diff --git a/.config/i3/scripts/miei/feed.sh b/.config/i3/scripts/miei/feed.sh new file mode 100755 index 0000000..be58a78 --- /dev/null +++ b/.config/i3/scripts/miei/feed.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +a=0 +path=~/.config/i3/scripts/miei/feed.sh + +if [ $BLOCK_BUTTON == 1 ] +then +if [ $a == 0 ] +then + sed -i '2d' $path + sed -i '2ia=1' $path + a=1 +else + sed -i '2d' $path + sed -i '2ia=0' $path + a=0 +fi +fi + +if [ $a == 1 ] +then + echo " $(curl https://www.lescienze.it/news/ -s -L | grep -o href.*h2 | head -n 1 | grep -o -P '(?<=">).*(?=)')" +else + echo "󰈙 News" +fi + +if [ $BLOCK_BUTTON == 3 ]; then + xdg-open https://www.lescienze.it/news/ +fi + diff --git a/.config/i3/scripts/miei/full_charge.sh b/.config/i3/scripts/miei/full_charge.sh new file mode 100755 index 0000000..1fd44f2 --- /dev/null +++ b/.config/i3/scripts/miei/full_charge.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# quando lo clicco mi ricarica il dispositivo fino al 100% e poi disabilita la feature +path="/sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/VPC2004:00/conservation_mode" +value=$(cat $path) +if [ $value -eq "" ];then + echo "only ideapad" +fi + +level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*") + +if [ $BLOCK_BUTTON -eq 1 ] && [ $value -eq "1" ];then + echo "󱟡 full" + echo $PASSW | sudo -S sh -c "echo 0 > $path" +fi + + +if [ $level -ge "95" ] && [ $value -eq "0" ];then + echo "󱈑 Csv" + echo $PASSW | sudo -S sh -c "echo 1 > $path" +fi + +if [ $value -eq 0 ];then + echo "󱟡 full" +else + echo "󱈑 Csv" +fi + + diff --git a/.config/i3/scripts/miei/meteo.sh b/.config/i3/scripts/miei/meteo.sh new file mode 100755 index 0000000..19cf2c8 --- /dev/null +++ b/.config/i3/scripts/miei/meteo.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +meteo=$(curl wttr.in/Sedriano?format=1| xargs echo) +first="${meteo%% *}" +if [ "$meteo" == "" ] || [ "$first" == "Unknown" ]; then + echo " Off" + +else + echo $meteo +fi diff --git a/.config/i3/scripts/miei/ora.sh b/.config/i3/scripts/miei/ora.sh new file mode 100755 index 0000000..51f233a --- /dev/null +++ b/.config/i3/scripts/miei/ora.sh @@ -0,0 +1,33 @@ +#!/usr/bin/bash +a=1 + +path=~/.config/i3/scripts/miei/ora.sh + +cambia_var () { +if [ $a == 0 ]; then + sed -i '2d' $path + sed -i '2ia=1' $path + # se non mostri la variabile subito ci sarà il delay di interval + a=1 + return 1 +fi +if [ $a == 1 ]; then + sed -i '2d' $path + sed -i '2ia=0' $path + a=0 + return 0 +fi +} + +if [ $BLOCK_BUTTON == 1 ]; then + cambia_var +fi + +if [ $a == 0 ]; then + date '+%a %d %b %H:%M' +fi + +if [ $a == 1 ]; then + date '+%H:%M' +fi + diff --git a/.config/i3/scripts/miei/power.sh b/.config/i3/scripts/miei/power.sh new file mode 100755 index 0000000..7d7902d --- /dev/null +++ b/.config/i3/scripts/miei/power.sh @@ -0,0 +1,52 @@ +#!/usr/bin/bash +#echo " 󰣐 󰣐 󰣐 󰣐 󰋔 " +#echo "" +#echo "#a6e3a1" +# + +if [ $(cat /sys/class/power_supply/ACAD/online) == 1 ];then +~/.config/i3/scripts/miei/power_charge.sh +exit 1 +fi + +level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*") + +unit=20 +vite=$(($level/unit)) + +if [ $vite == 5 ]; then + echo "" + echo "" + echo "#cdd6f4" +fi + +if [ $vite == 4 ]; then + echo "" + echo "" + echo "#a6e3a1" +fi +if [ $vite == 3 ]; then + echo "" + echo "" + echo "#a6e3a1" +fi +if [ $vite == 2 ]; then + echo "" + echo "" + echo "#fab387" +fi +if [ $vite == 1 ]; then + echo "" + echo "" + echo "#fab387" +fi +if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then + echo "" + echo "" + echo "#f38ba8" +fi +if [ "$level" -lt "10" ]; then + echo "!" + echo "" + echo "#f38ba8" +fi diff --git a/.config/i3/scripts/miei/power_charge.sh b/.config/i3/scripts/miei/power_charge.sh new file mode 100755 index 0000000..9a75b80 --- /dev/null +++ b/.config/i3/scripts/miei/power_charge.sh @@ -0,0 +1,47 @@ +#!/usr/bin/bash +#echo " 󰣐 󰣐 󰣐 󰣐 󰋔 " +#echo "" +#echo "#a6e3a1" +# 󰁹󱐋 + +level=$( upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -o "[0-9]*") + +unit=20 +vite=$(($level/unit)) + +if [ $vite == 5 ]; then + echo "󱐋 " + echo "" + echo "#cdd6f4" +fi + +if [ $vite == 4 ]; then + echo "󱐋 " + echo "" + echo "#a6e3a1" +fi +if [ $vite == 3 ]; then + echo "󱐋 " + echo "" + echo "#a6e3a1" +fi +if [ $vite == 2 ]; then + echo "󱐋 " + echo "" + echo "#fab387" +fi +if [ $vite == 1 ]; then + echo "󱐋 " + echo "" + echo "#fab387" +fi +if [ "$level" -lt "20" ] && [ "$level" -ge "10" ]; then + echo "󱐋 " + echo "" + echo "#f38ba8" +fi +if [ "$level" -lt "10" ]; then + echo "󱐋 !" + echo "" + echo "#f38ba8" +fi diff --git a/.config/i3/scripts/miei/schermata.sh b/.config/i3/scripts/miei/schermata.sh new file mode 100755 index 0000000..a2da424 --- /dev/null +++ b/.config/i3/scripts/miei/schermata.sh @@ -0,0 +1,10 @@ +#!/usr/bin/bash +a=$(date +"%Y-%m-%d-%T")-schermata.png + +maim --select ~/Immagini/Schermate/$a +notify-send "Screenshot saved to ~/$a" +#kdialog --yesno "Screenshot salvato, vuoi aprirlo?" +#if [ $? == 0 ]; then + eog ~/Immagini/Schermate/$a +#fi + diff --git a/.config/i3/scripts/miei/timer.sh b/.config/i3/scripts/miei/timer.sh new file mode 100755 index 0000000..9ba8b77 --- /dev/null +++ b/.config/i3/scripts/miei/timer.sh @@ -0,0 +1,80 @@ +#!/usr/bin/bash +#creazione meccanismo di cambiamento timer modalità m (modifica) +path=/tmp/miotimer + +modifica () { +if [ $BLOCK_BUTTON == 4 ];then + current=$((current + 1)) + echo $mode > $path + echo $current >> $path +fi +if [ $BLOCK_BUTTON == 5 ] && [ $current != 0 ];then + current=$((current - 1)) + echo $mode > $path + echo $current >> $path +fi +if [ $current == 0 ];then + echo "󰔛 Tmr" +else +echo " $(sed '2!d' $path) m" +echo "" +echo "#f9e2af" +fi +} + +timer () { +start=$(sed '2!d' $path) +start=$((start * 60)) +now=$(date +%s) +first=$(sed '3!d' $path) +manca=$((start-now+first)) +if [ $manca != 0 ];then + echo "󰄉 $((manca / 60)):$((manca % 60))" + echo "" + echo "#a6e3a1" + +else + echo "󰔛 Tmr" + notify-send "Timer is over" + rm $path +fi +} + + + + +if [ -f $path ] +then + + + mode=$(sed '1!d' $path) + current=$(sed '2!d' $path) + + if [ $BLOCK_BUTTON == 1 ] && [ $current != 0 ];then + if [ $mode == "w" ];then + rm $path + echo "󰔛 Tmr" + exit + fi + mode=w + echo $mode > $path + echo $current >> $path + echo $(date +%s) >> $path + fi + + + if [ $mode == "m" ];then + modifica + fi + + if [ $mode == "w" ];then + timer + fi + + + +else +echo m > $path +echo 0 >> $path +echo "󰔛 Tmr" +fi diff --git a/.config/i3/scripts/miei/update.sh b/.config/i3/scripts/miei/update.sh new file mode 100755 index 0000000..2d372b2 --- /dev/null +++ b/.config/i3/scripts/miei/update.sh @@ -0,0 +1,16 @@ +#!/usr/bin/bash + +if [ $BLOCK_BUTTON -eq "1" ];then + kitty -e sudo dnf upgrade + kitty -e flatpak update +fi + + +numero=$(dnf check-update| grep -Ec ' updates$') +if [ $numero -eq "0" ];then +echo " " +else +echo "󰏕 $numero" +echo "" +echo "#f9e2af" +fi diff --git a/.config/i3/scripts/miei/wallpaper.sh b/.config/i3/scripts/miei/wallpaper.sh new file mode 100755 index 0000000..d15d3ad --- /dev/null +++ b/.config/i3/scripts/miei/wallpaper.sh @@ -0,0 +1,26 @@ +#!/usr/bin/bash +w_path=~/.config/wallpaper/ +c_path=~/.config/wallpaper/current +config=~/.config/ +current=$(cat $c_path) + +if [ $BLOCK_BUTTON == 1 ];then +new=$((current+1)) +if [ $new == 13 ]; then + new=0 +fi +fi + +if [ $BLOCK_BUTTON == 3 ];then +new=$((current - 1)) +if [ $new == "-1" ]; then + new=12 +fi +fi + +rm "${config}sfondo.jpg" +cp "$w_path$new.jpg" $config +mv "$config$new.jpg" "${config}sfondo.jpg" +sed -i '1d' $c_path +echo $new >> $c_path +feh --bg-fill ~/.config/wallpaper/yuyukowallpaper.png diff --git a/.config/i3/scripts/pomodoro.sh b/.config/i3/scripts/pomodoro.sh new file mode 100755 index 0000000..4f74787 --- /dev/null +++ b/.config/i3/scripts/pomodoro.sh @@ -0,0 +1,132 @@ +#!/usr/bin/env bash +if [ -f /tmp/pomo_timer ];then + pluto=$(cat /tmp/pomo_timer) + +case $BLOCK_BUTTON in + 3) if [ $pluto -eq "0" ];then + echo "1" > /tmp/pomo_timer + pluto=1 + else + echo "0" > /tmp/pomo_timer + pluto=0 + fi + + ;; +esac + + + +if [ $pluto -eq "0" ];then + +# Config variables +# 40min = 2400s +# 25min = 1500s +# 20min = 1200s +# 5min = 300s + +# In secondi +work_time=2400 +break_time=1200 + +msg_start=" Pom" +work_prefix=" " +break_prefix="󰅶 " + +#start_color="#b39df3" +#start_color="#E06C75" +start_color="#cdd6f4" + +break_color="#a6e3a1" +work_color="#f38ba8" + +break_command="notify-send -t 2500 'Grab a tea'" +work_command="notify-send -t 2500 'Time to work!'" + +pom_path="/tmp/pomodoro" + +function display () { + min=$((s/60)) + sek=$((s%60)) + if [ $min -eq 0 ] + then + min=00 + elif [ $min -lt 10 ] + then + min=0$min + fi + if [ $sek -lt 10 ] + then + sek=0$sek + fi + case $2 in # richiamo alla seconda variabile, t + w) + echo "$work_prefix$min:$sek" + echo $min:$sek + echo $work_color + ;; + b) + echo "$break_prefix$min:$sek" + echo $min:$sek + echo $break_color + ;; + esac +} + +if [ -f "$pom_path" ] && [ "$(wc -l $pom_path | awk '{print $1}')" -eq 2 ] +then + p=$(sed '1 d' $pom_path) # time + t=$(sed '2 d' $pom_path) # mode + case $t in + w) dur=$work_time;; + b) dur=$break_time;; + esac + now=$(date +%s) + s=$((dur-now+p)) # sec mancanti basandosi su orologio e istante chiamata questa fzione + if [ $s -le 0 ] # if time less than 0 then switch mode + then + case $t in + w) + echo b > $pom_path + eval "$break_command" + paplay $HOME/.config/i3/scripts/bell.wav + ;; + b) + echo w > $pom_path + eval "$work_command" + paplay $HOME/.config/i3/scripts/bell_end.wav + + ;; + esac + echo "$now" >> $pom_path + fi + display "$s" "$t" +else + echo "$msg_start" + echo "$msg_start" + echo "$start_color" +fi + +case $BLOCK_BUTTON in + 1) + if [ -f $pom_path ]; then # if file exists then stop reset timer + rm $pom_path + else + echo w > $pom_path # else start timer + date +%s >> $pom_path + fi + ;; +esac +# è scritto in modo carino ma non ha sostanziali differenze rispetto al mio , per aggiornarsi sfrutta l'interval integrato. Inoltre è vincolato dalla stampa dell'orario effettivo che non gli permette di andare fuori dal taiming e rimanere sempre in orario. Dovrei evitare la funzione di chiamata e quella di sleep ed optare per un intervallo dentro il blocco. L'aggiornamento nel primo caso non cambia nulla nel secondo mostra secondi differenti ma si può fare. + +fi + + +if [ $pluto -eq "1" ];then +~/.config/i3/scripts/miei/timer.sh +fi + +else + echo "0" > /tmp/pomo_timer +fi + + diff --git a/.config/i3/scripts/powermenu b/.config/i3/scripts/powermenu new file mode 100644 index 0000000..1e61086 --- /dev/null +++ b/.config/i3/scripts/powermenu @@ -0,0 +1,184 @@ +#!/usr/bin/env bash +# +# Use rofi/zenity to change system runstate thanks to systemd. +# +# Note: this currently relies on associative array support in the shell. +# +# Inspired from i3pystatus wiki: +# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu +# +# Copyright 2015 Benjamin Chrétien +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# modified to work with latest rofi update by joekamprad + +####################################################################### +# BEGIN CONFIG # +####################################################################### + +# Use a custom lock script +#LOCKSCRIPT="i3lock-extra -m pixelize" + +# Colors: FG (foreground), BG (background), HL (highlighted) +FG_COLOR="#bbbbbb" +BG_COLOR="#111111" +HLFG_COLOR="#111111" +HLBG_COLOR="#bbbbbb" +BORDER_COLOR="#222222" + +# Options not related to colors (most rofi options do not work anymore) +ROFI_OPTIONS=(-theme ~/.config/rofi/pw.rasi) +# Zenity options +ZENITY_TITLE="Power Menu" +ZENITY_TEXT="Action:" +ZENITY_OPTIONS=(--column= --hide-header) + +####################################################################### +# END CONFIG # +####################################################################### + +# Whether to ask for user's confirmation +enable_confirmation=false + +# Preferred launcher if both are available +preferred_launcher="rofi" + +usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. + +where: + -h show this help text + -c ask for user confirmation + -p preferred launcher (rofi or zenity) + +This script depends on: + - systemd, + - i3, + - rofi or zenity." + +# Check whether the user-defined launcher is valid +launcher_list=(rofi zenity) +function check_launcher() { + if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then + echo "Supported launchers: ${launcher_list[*]}" + exit 1 + else + # Get array with unique elements and preferred launcher first + # Note: uniq expects a sorted list, so we cannot use it + i=1 + launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ + | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) + fi +} + +# Parse CLI arguments +while getopts "hcp:" option; do + case "${option}" in + h) echo "${usage}" + exit 0 + ;; + c) enable_confirmation=true + ;; + p) preferred_launcher="${OPTARG}" + check_launcher "${preferred_launcher}" + ;; + *) exit 1 + ;; + esac +done + +# Check whether a command exists +function command_exists() { + command -v "$1" &> /dev/null 2>&1 +} + +# systemctl required +if ! command_exists systemctl ; then + exit 1 +fi + +# menu defined as an associative array +typeset -A menu + +# Menu with keys/commands + +menu=( + [ Shutdown]="systemctl poweroff" + [ Reboot]="systemctl reboot" + [ Suspend]="systemctl suspend" + [ Lock]="~/.config/i3/scripts/blur-lock" + [ Logout]="i3-msg exit" +) + +menu_nrows=${#menu[@]} + +# Menu entries that may trigger a confirmation message +menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" + +launcher_exe="" +launcher_options="" +rofi_colors="" + +function prepare_launcher() { + if [[ "$1" == "rofi" ]]; then + rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ + -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") + launcher_exe="rofi" + launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ + "${rofi_colors}" "${ROFI_OPTIONS[@]}") + elif [[ "$1" == "zenity" ]]; then + launcher_exe="zenity" + launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ + "${ZENITY_OPTIONS[@]}") + fi +} + +for l in "${launcher_list[@]}"; do + if command_exists "${l}" ; then + prepare_launcher "${l}" + break + fi +done + +# No launcher available +if [[ -z "${launcher_exe}" ]]; then + exit 1 +fi + +launcher=(${launcher_exe} "${launcher_options[@]}") +selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")" + +function ask_confirmation() { + if [ "${launcher_exe}" == "rofi" ]; then + confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ + "${rofi_colors}" "${ROFI_OPTIONS[@]}") + [ "${confirmed}" == "Yes" ] && confirmed=0 + elif [ "${launcher_exe}" == "zenity" ]; then + zenity --question --text "Are you sure you want to ${selection,,}?" + confirmed=$? + fi + + if [ "${confirmed}" == 0 ]; then + i3-msg -q "exec --no-startup-id ${menu[${selection}]}" + fi +} + +if [[ $? -eq 0 && ! -z ${selection} ]]; then + if [[ "${enable_confirmation}" = true && \ + ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then + ask_confirmation + else + i3-msg -q "exec --no-startup-id ${menu[${selection}]}" + fi +fi diff --git a/.config/i3/scripts/volume b/.config/i3/scripts/volume new file mode 100644 index 0000000..3efda7b --- /dev/null +++ b/.config/i3/scripts/volume @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume +# check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md +#------------------------------------------------------------------------ + +# The second parameter overrides the mixer selection +# For PulseAudio users, eventually use "pulse" +# For Jack/Jack2 users, use "jackplug" +# For ALSA users, you may use "default" for your primary card +# or you may use hw:# where # is the number of the card desired +if [[ -z "$MIXER" ]] ; then + MIXER="default" + if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then + # pulseaudio is running, but not all installations use "pulse" + if amixer -D pulse info >/dev/null 2>&1 ; then + MIXER="pulse" + fi + fi + [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" + MIXER="${2:-$MIXER}" +fi + +# The instance option sets the control to report and configure +# This defaults to the first control of your selected mixer +# For a list of the available, use `amixer -D $Your_Mixer scontrols` +if [[ -z "$SCONTROL" ]] ; then + SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | + sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | + head -n1 + )}" +fi + +# The first parameter sets the step to change the volume by (and units to display) +# This may be in in % or dB (eg. 5% or 3dB) +if [[ -z "$STEP" ]] ; then + STEP="${1:-5%}" +fi + +# AMIXER(1): +# "Use the mapped volume for evaluating the percentage representation like alsamixer, to be +# more natural for human ear." +NATURAL_MAPPING=${NATURAL_MAPPING:-0} +if [[ "$NATURAL_MAPPING" != "0" ]] ; then + AMIXER_PARAMS="-M" +fi + +#------------------------------------------------------------------------ + +capability() { # Return "Capture" if the device is a capture device + amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL | + sed -n "s/ Capabilities:.*cvolume.*/Capture/p" +} + +volume() { + amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability) +} + +format() { + + perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' + perl_filter+='{CORE::say $4 eq "off" ? "0%" : "' + # If dB was selected, print that instead + perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') + perl_filter+='"; exit}' + output=$(perl -ne "$perl_filter") + valore=${output::-1} +# basandomi sul valore di output cambio icona +if [ "$valore" -eq "0" ]; then + echo " " + echo "" + echo "#f38ba8" +else + +if [ "$valore" -le "20" ]; then + echo " $output" +fi +if [ "$valore" -le "40" ] && [ "$valore" -gt "20" ]; then + echo " $output" +fi +if [ "$valore" -gt "40" ]; then + echo " $output" +fi +fi +} + +#------------------------------------------------------------------------ + +case $BLOCK_BUTTON in + 1) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute + 3) pavucontrol;; + + 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase + 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease +esac + +volume | format diff --git a/.config/i3/scripts/volume_brightness.sh b/.config/i3/scripts/volume_brightness.sh new file mode 100755 index 0000000..312541a --- /dev/null +++ b/.config/i3/scripts/volume_brightness.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +# original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator + +# taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator + +# See README.md for usage instructions +bar_color="#a6da95" +volume_step=5 +brightness_step=5% +max_volume=100 + +# Uses regex to get volume from pactl +function get_volume { + pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1 +} + +# Uses regex to get mute status from pactl +function get_mute { + pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)' +} + +# Uses regex to get brightness from xbacklight +function get_brightness { + brightnessctl g | grep -Po '[0-9]{1,3}' | head -n 1 + +} + +# Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume +function get_volume_icon { + volume=$(get_volume) + mute=$(get_mute) + if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then + volume_icon="󰸈 " + elif [ "$volume" -lt 50 ]; then + volume_icon="󰕾 " + else + volume_icon=" " + fi +} + +# Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome +function get_brightness_icon { + brightness_icon=" " +} + +# Displays a volume notification using dunstify +function show_volume_notif { + volume=$(get_mute) + get_volume_icon + dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color +} + +# Displays a brightness notification using dunstify +function show_brightness_notif { + massima=$(brightnessctl m) + brightness=$(($(get_brightness)*100/$massima)) + get_brightness_icon + dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color +} + +# Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down" +case $1 in + volume_up) + # Unmutes and increases volume, then displays the notification + pactl set-sink-mute @DEFAULT_SINK@ 0 + volume=$(get_volume) + if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then + pactl set-sink-volume @DEFAULT_SINK@ $max_volume% + else + pactl set-sink-volume @DEFAULT_SINK@ +$volume_step% + fi + show_volume_notif + ;; + + volume_down) + # Raises volume and displays the notification + pactl set-sink-volume @DEFAULT_SINK@ -$volume_step% + show_volume_notif + ;; + + volume_mute) + # Toggles mute and displays the notification + pactl set-sink-mute @DEFAULT_SINK@ toggle + show_volume_notif + ;; + + brightness_up) + # Increases brightness and displays the notification + brightnessctl s +$brightness_step + show_brightness_notif + ;; + + brightness_down) + # Decreases brightness and displays the notification + brightnessctl s $brightness_step- + show_brightness_notif + ;; +esac diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf new file mode 100644 index 0000000..abcddd4 --- /dev/null +++ b/.config/picom/picom.conf @@ -0,0 +1,348 @@ + +################################# +# +# Backend +# +################################# + +# Backend to use: "xrender" or "glx". +# GLX backend is typically much faster but depends on a sane driver. + +# backend = "xrender"; +# backend = "xr_glx_hybrid"; +backend = "glx"; + +################################# +# +# GLX backend +# +################################# + +glx-no-stencil = true; + +# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. +# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, +# but a 20% increase when only 1/4 is. +# My tests on nouveau show terrible slowdown. +# Useful with --glx-swap-method, as well. +glx-copy-from-front = false; + +# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. +# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. +# May break VSync and is not available on some drivers. +# Overrides --glx-copy-from-front. +# glx-use-copysubbuffermesa = true; + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). +# Recommended if it works. + +glx-no-rebind-pixmap = true; + + +use-damage = false; + +# Disabled to avoid artifacts painting under blur transparent windows. + +################################# +# +# Shadows +# +################################# + +# Enabled client-side shadows on windows. +shadow = true; + + +# The blur radius for shadows. (default 12) +shadow-radius = 10; +# The left offset for shadows. (default -15) +shadow-offset-x = -10; +# The top offset for shadows. (default -15) +shadow-offset-y = -10; +# The translucency for shadows. (default .75) +shadow-opacity = 0.4; + +# Set if you want different colour shadows +# shadow-red = 0.0; +# shadow-green = 0.0; +# shadow-blue = 0.0; + + + +# shadow-exclude-reg = "x10+0+0"; +# xinerama-shadow-crop = true; + + +# 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 +# (most applications are fine, only apps that do weird things with xshapes or argb are affected). +# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes +# shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. + +# shadow-exclude = "n:e:Notification"; + +shadow-exclude = [ + "_GTK_FRAME_EXTENTS@:c", + # Removed to avoid no-shadow in modal dialog windows. + # "! name~=''", + "name = 'Notification'", + "name = 'Plank'", + "name = 'Docky'", + "name = 'Kupfer'", + "name = 'Pensela'", + "name = 'Drawing Board'", + # + # Workaround for VirtualBox empty window at launching + "name = 'VirtualBox'", + "name = 'VirtualBoxVM'", + # + # Avoid shadow in Negatron popups + "name = 'Negatron v0.100.1' && argb", + # + # Avoid shadow for the XFCE alt tab TaskSwitcher + "name ?= 'xfwm4' && argb", + # + # "name *= 'compton'", + "class_g = 'Conky'", + "class_g = 'Kupfer'", + "class_g = 'Synapse'", + "class_g ?= 'Notify-osd'", + "class_g ?= 'Cairo-dock'", + "class_g = 'Cairo-clock'", + "class_g ?= 'Xfce4-notifyd'", + # + # Exclude special Firefox/Firefox-esr/Thunderbird dropdowns. + # Ref: https://github.com/chjj/compton/issues/247 + "class_g = 'Thunderbird' && argb", + "class_g = 'Telegram' && argb", + "name ?= 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu')", + # + # Exclude some special popup menu shadows, but Modal Windows. + # These are more finetuning thant previous ones: + "class_g ?= 'Thunderbird' && class_i = 'Popup' && argb", + "class_g = 'firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'Firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'Firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'Tor Browser' && (window_type = 'utility') && argb", + "class_g = 'Navegador Tor' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g = 'Mozilla Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb", + "class_g ?= 'Xfce4-power-manager'", + # + # Exclude Vokoscreen and VokoscreenNG area selector + # + "class_g ?= 'vokoscreen' && argb", + "name = 'Área'", + "name *= 'Cuenta regresiva'", + "_NET_WM_WINDOW_TYPE:a *= '_KDE_NET_WM_WINDOW_TYPE_OVERRIDE'" +# "override_redirect = true" +]; +# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) +# Deprecated, use --shadow-exclude 'bounding_shaped' or --shadow-exclude 'bounding_shaped && !rounded_corners' instead. +shadow-ignore-shaped = false; + + + + +################################# +# +# Opacity +# +################################# + + +inactive-opacity = 1; +active-opacity = 1; +frame-opacity = 1; +inactive-opacity-override = false; + + +# Desaturate and darken the inactive windows +# Dim inactive windows. (0.0 - 1.0) + +#inactive-dim = 0.2; +#inactive-dim-fixed = true; + + + + +# Do not let dimness adjust based on window opacity. +# inactive-dim-fixed = true; + + +# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. + +blur-background = true; + +blur: +{ +method = "gaussian"; +size = 20; +deviation = 15; +}; + + + +#blur-method = "kernel"; +#blur-size = 50; +#blur-deviation = 5.0; + + + +# Blur background of opaque windows with transparent frames as well. +# blur-background-frame = true; +# Do not let blur radius adjust based on window opacity. +#blur-background-fixed = true; + +# blur-kern = "3x3box"; +# blur-kern = "5x5box"; +# blur-kern = "5x5gaussian" +#blur-kern = "9x9gaussian" + +blur-background-exclude = [ + "class_g = 'Peek'", + "class_g = 'slop'", + "class_g = 'Pensela'", + "name = 'Drawing Board'", +# "window_type = 'dock'", + "window_type = 'dropdown_menu'", + "window_type = 'combo'", + "window_type = 'popup_menu'", + "window_type = 'utility'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; +opacity-exclude = [ + "name = 'Stratagus'" +]; + +opacity-rule = [ + "90:class_g = 'Rofi'", + "85:class_g = 'i3bar'", + "85:name = 'Startpage Search Results – Ablaze Floorp'", + "85:name = 'Ablaze Floorp'", + "90:name = 'Subscriptions - FreeTube'", + "90:class_g = 'Thunar'", + #"90:class_g = 'Evince'", + "90:class_g = 'Anki'", + +]; +################################# +# +# Fading +# +################################# + +fading = true; +# fade-delta = 30; +#fade-in-step = 0.03; +#fade-out-step = 0.03; +fade-in-step = 0.07; +fade-out-step = 0.07; +# no-fading-openclose = true; +# no-fading-destroyed-argb = true; +fade-exclude = [ ]; + + + +################################# +# +# OTHER CONFIG +# +################################# + +log-level = "warn"; +# log-file = "/path/to/your/log/file"; + + +mark-wmwin-focused = true; +mark-ovredir-focused = true; +# use-ewmh-active-win = true; +detect-rounded-corners = true; +detect-client-opacity = true; +refresh-rate = 0; + + +vsync = true; + + +# sw-opti = true; +# unredir-if-possible = true; +# unredir-if-possible-delay = 5000; +# unredir-if-possible-exclude = [ ]; + +focus-exclude = [ "class_g = 'Cairo-clock'" ]; + +detect-transient = true; +detect-client-leader = true; +invert-color-include = [ ]; + +resize-damage = 2; + + + + + +################################# +# +# Window type settings +# +################################# +wintypes: +{ + dock = { shadow = false; } + dnd = { shadow = false; } + popup_menu = { opacity = 1; } + dropdown_menu = { opacity = 1; } + + # This avoid problems with transparent windows while use-damage = true;. + # normal = { full-shadow = true;}; + +# tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + + + +}; + + + +################################# +# +# Deprecated +# +################################# + + +# Avoid drawing shadows on dock/panel windows. +# This option is deprecated, you should use the wintypes option in your config file instead. +# no-dock-shadow = false; + + +# Don't draw shadows on DND windows. +# This option is deprecated, you should use the wintypes option in your config file instead. +# no-dnd-shadow = false; + +# Option `menu-opacity` is deprecated, and will be removed.Please use the wintype option `opacity` of `popup_menu` and `dropdown_menu` instead. +# menu-opacity = 1; + +# GLX backend: GLX buffer swap method we assume. +# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). +# undefined is the slowest and the safest, and the default value. +# copy is fastest, but may fail on some drivers, +# 2-6 are gradually slower but safer (6 is still faster than 0). +# Usually, double buffer means 2, triple buffer means 3. +# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. +# Useless with --glx-use-copysubbuffermesa. +# Partially breaks --resize-damage. +# Defaults to undefined. +# glx-swap-method has been deprecated since v6, your setting "undefined" should be replaced by `use-damage = true` +# glx-swap-method = "undefined"; + + +# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows. +# "clear-shadow" is removed as an option, and is always enabled now. Consider removing it from your config file +# clear-shadow = true; + +# "alpha-step" has been removed, compton now tries to make use of all alpha values +# alpha-step = 0.06; diff --git a/.config/rofi/arc_dark_colors.rasi b/.config/rofi/arc_dark_colors.rasi new file mode 100644 index 0000000..6918845 --- /dev/null +++ b/.config/rofi/arc_dark_colors.rasi @@ -0,0 +1,34 @@ +/******************************************************* + * ROFI Arc Dark colors for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +* { + selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); + foreground: rgba ( 196, 203, 212, 100 % ); + normal-foreground: @foreground; + alternate-normal-background: rgba ( 64, 69, 82, 59 % ); + red: rgba ( 220, 50, 47, 100 % ); + selected-urgent-foreground: rgba ( 249, 249, 249, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + urgent-foreground: rgba ( 204, 102, 102, 100 % ); + alternate-urgent-background: rgba ( 75, 81, 96, 90 % ); + active-foreground: rgba ( 101, 172, 255, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba ( 249, 249, 249, 100 % ); + alternate-active-background: rgba ( 75, 81, 96, 89 % ); + background: rgba ( 45, 48, 59, 95 % ); + alternate-normal-foreground: @foreground; + normal-background: @background; + lightfg: rgba ( 88, 104, 117, 100 % ); + selected-normal-background: rgba ( 64, 132, 214, 100 % ); + border-color: rgba ( 124, 131, 137, 100 % ); + spacing: 2; + separatorcolor: rgba ( 29, 31, 33, 100 % ); + urgent-background: rgba ( 29, 31, 33, 17 % ); + selected-urgent-background: rgba ( 165, 66, 66, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 29, 31, 33, 17 % ); + selected-active-background: rgba ( 68, 145, 237, 100 % ); +} diff --git a/.config/rofi/arc_dark_transparent_colors.rasi b/.config/rofi/arc_dark_transparent_colors.rasi new file mode 100644 index 0000000..52d51a7 --- /dev/null +++ b/.config/rofi/arc_dark_transparent_colors.rasi @@ -0,0 +1,34 @@ +/******************************************************* + * ROFI Arch Dark Transparent colors for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +* { + selected-normal-foreground: rgba(243 139 168 / 1); + foreground: rgba ( 196, 203, 212, 100 % ); + normal-foreground: @foreground; + alternate-normal-background: rgba ( 45, 48, 59, 1 % ); + red: rgba(203 166 247 / 1); + selected-urgent-foreground: rgba(203 166 247 / 1); + blue: rgba(203 166 247 / 1); + urgent-foreground: rgba(203 166 247 / 1); + alternate-urgent-background: rgba ( 75, 81, 96, 90 % ); + active-foreground: rgba(203 166 247 / 1); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba(203 166 247 / 1); + alternate-active-background: rgba ( 45, 48, 59, 88 % ); + background: rgba(30 30 46 / 1); + alternate-normal-foreground: @foreground; + normal-background: rgba ( 45, 48, 59, 1 % ); + lightfg: rgba(203 166 247 / 1); + selected-normal-background: rgba ( 24, 26, 32, 100 % ); + border-color: rgba ( 124, 131, 137, 100 % ); + spacing: 2; + separatorcolor: rgba ( 45, 48, 59, 1 % ); + urgent-background: rgba ( 45, 48, 59, 15 % ); + selected-urgent-background: rgba ( 165, 66, 66, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 29, 31, 33, 17 % ); + selected-active-background: rgba ( 26, 28, 35, 100 % ); +} diff --git a/.config/rofi/pw.rasi b/.config/rofi/pw.rasi new file mode 100644 index 0000000..88bbf88 --- /dev/null +++ b/.config/rofi/pw.rasi @@ -0,0 +1,141 @@ +/******************************************************* + * ROFI configs i3 Apps menu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "FiraCode Nerd Font medium 10"; + show-icons: true; + icon-theme: "Qogir"; + display-drun: "Apps"; + drun-display-format: "{name}"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; +} + +@import "~/.config/rofi/arc_dark_transparent_colors.rasi" + +window { + background-color: @background; + border: 2; + padding: 5; + width: 220px; + border-color:#b4befe; + y-offset: -412; + x-offset: 825; +} +listview { + lines: 5; + columns: 1; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + spacing: 8px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +horizontal-align: 0.4; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: #b4befe; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: #b4befe; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + enabled: false; + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { +children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} diff --git a/.config/rofi/rofidmenu.rasi b/.config/rofi/rofidmenu.rasi new file mode 100644 index 0000000..298bf67 --- /dev/null +++ b/.config/rofi/rofidmenu.rasi @@ -0,0 +1,137 @@ +/******************************************************* + * ROFI configs i3 Apps menu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "FiraCode Nerd Font medium 10"; + show-icons: true; + icon-theme: "Qogir"; + display-drun: "Apps"; + drun-display-format: "{name}"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; +} + +@import "~/.config/rofi/arc_dark_transparent_colors.rasi" + +window { + background-color: @background; + border: 2; + border-color: #585b70; + padding: 30; +} +listview { + lines: 10; + columns: 3; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + spacing: 8px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + placeholder: " Program "; + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + children: [ textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: "󰍉 " ; + margin: 0px 0.3em 0em 0em; + text-color: #f38ba8; +} diff --git a/.config/rofi/rofitodo.sh b/.config/rofi/rofitodo.sh new file mode 100644 index 0000000..787557f --- /dev/null +++ b/.config/rofi/rofitodo.sh @@ -0,0 +1,39 @@ +#!/bin/bash +TODO_FILE=~/.rofi_todos + +if [[ ! -a "${TODO_FILE}" ]]; then + touch "${TODO_FILE}" +fi + +function add_todo() { + echo -e "$*" >> "${TODO_FILE}" +} + +function remove_todo() { + if [[ ! -z "$DONE_FILE" ]]; then + echo "${*}" >> "${DONE_FILE}" + fi + #echo "${*}" | xclip -selection clipboard + sed -i "/^${*}$/d" "${TODO_FILE}" +} + +function get_todos() { + echo "$(cat "${TODO_FILE}")" +} + +if [ -z "$@" ]; then + get_todos +else + LINE=$(echo "${@}" | sed "s/\([^a-zA-Z0-9]\)/\\\\\\1/g") + LINE_UNESCAPED=${@} + if [[ $LINE_UNESCAPED == +* ]]; then + LINE_UNESCAPED=$(echo $LINE_UNESCAPED | sed s/^+//g |sed s/^\s+//g ) + add_todo ${LINE_UNESCAPED} + else + MATCHING=$(grep "^${LINE_UNESCAPED}$" "${TODO_FILE}") + if [[ -n "${MATCHING}" ]]; then + remove_todo ${LINE_UNESCAPED} + fi + fi + get_todos +fi diff --git a/.config/rofi/todo.rasi b/.config/rofi/todo.rasi new file mode 100644 index 0000000..ceeeede --- /dev/null +++ b/.config/rofi/todo.rasi @@ -0,0 +1,141 @@ +/******************************************************* + * ROFI configs i3 Apps menu for EndeavourOS + * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] + *******************************************************/ +configuration { + font: "Firacode Nerd Font medium 10"; + show-icons: true; + icon-theme: "Qogir"; + display-drun: "Apps"; + drun-display-format: "{name}"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; +} + +@import "~/.config/rofi/arc_dark_transparent_colors.rasi" + +window { + background-color: @background; + border: 2; + padding: 5; + width: 300px; + border-color: #89b4fa; + y-offset: -400; + x-offset: 785; +} +listview { + lines: 5; + columns: 1; +} +mainbox { + border: 0; + padding: 0; +} +message { + border: 2px 0px 0px; + border-color: @separatorcolor; + padding: 1px; +} +textbox { + text-color: @foreground; +} +listview { + fixed-height: 0; + border: 8px 0px 0px; + border-color: @separatorcolor; + spacing: 8px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: #89b4fa; +} +element.selected.normal { + background-color: #181825; + text-color: #89b4fa; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: #89b4fa; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + placeholder: " + Todo"; + spacing: 0; + text-color: @normal-foreground; +} +prompt { + enabled: false; + spacing: 0; + text-color: @normal-foreground; +} +inputbar { +children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: "  "; + margin: 0px 0.3em 0em 0em; + text-color: #89b4fa; +} diff --git a/yuyukowallpaper1809.png b/.config/wallpapers/yuyukowallpaper.png similarity index 100% rename from yuyukowallpaper1809.png rename to .config/wallpapers/yuyukowallpaper.png diff --git a/home-manager/i3.nix b/home-manager/i3.nix new file mode 100644 index 0000000..831a4e1 --- /dev/null +++ b/home-manager/i3.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ...}: { + home.file.".config/i3" = { + enable = true; + recursive = true; + source = ../.config/i3; + target = ".config/i3"; + }; + + home.file.".config/picom" = { + enable = true; + recursive = true; + source = ../.config/picom; + target = ".config/picom"; + }; + + home.file.".config/wallpapers" = { + enable = true; + recursive = true; + source = ../.config/wallpapers; + target = ".config/wallpapers"; + }; +} diff --git a/modules/graphical/awesome.nix b/modules/graphical/awesome.nix new file mode 100644 index 0000000..9d349a4 --- /dev/null +++ b/modules/graphical/awesome.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: +let cfg = config.custom.graphical.awesome; +in { + options.custom.graphical.awesome = { + enable = lib.mkEnableOption "Enables awesome"; + }; + config = lib.mkIf cfg.enable { + services.xserver = { + enable = true; + + displayManager = { + sddm.enable = true; + defaultSession = "none+awesome"; + }; + + windowManager.awesome = { + enable = true; + luaModules = with pkgs.luaPackages; [ + luarocks # is the package manager for Lua modules + luadbi-mysql # Database abstraction layer + ]; + + }; + }; + }; +} diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 383dacd..3f21ec8 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -4,7 +4,9 @@ imports = [ ./audio.nix ./code.nix + ./awesome.nix ./emulators.nix + ./i3.nix ./gamemode.nix ./games.nix ./gnome.nix diff --git a/modules/graphical/i3.nix b/modules/graphical/i3.nix new file mode 100644 index 0000000..22cbf0e --- /dev/null +++ b/modules/graphical/i3.nix @@ -0,0 +1,52 @@ +{ config, pkgs, lib, ... }: +let cfg = config.custom.graphical.i3; +in { + + options = { + custom.graphical.i3.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable i3 window manager"; + }; + }; + + config = lib.mkIf cfg.enable { + environment.pathsToLink = [ + "/libexec" + ]; # links /libexec from derivations to /run/current-system/sw + + services.xserver = { + enable = true; + + desktopManager = { xterm.enable = false; }; + + displayManager = { defaultSession = "none+i3"; }; + + windowManager.i3 = { + enable = true; + extraPackages = with pkgs; [ + i3status # gives you the default i3 status bar + i3lock # default i3 screen locker + i3blocks # if you are planning on using i3blocks over i3status + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + #picom # compositor + rofi # application + maim # takes screenshots + xclip + dex # starts applications according to .desktop files + xss-lock # locks the screen when the system is idle + pavucontrol + libsForQt5.dolphin + playerctl + brightnessctl + i3blocks + autotiling + feh # sets the wallpaper + nm-tray # NetworkManager tray icon + ]; + }; +} diff --git a/modules/graphical/stylix.nix b/modules/graphical/stylix.nix index 8e72146..b4aa63f 100644 --- a/modules/graphical/stylix.nix +++ b/modules/graphical/stylix.nix @@ -6,7 +6,7 @@ in { enable = mkEnableOption "Enables stylix"; image = mkOption { type = types.path; - default = ../../yuyukowallpaper1809.png; + default = ../../yuyukowallpaper.png; description = '' The wallpaper to use. ''; @@ -33,6 +33,10 @@ in { config = let nerdfonts = pkgs.nerdfonts.override { fonts = [ "Hack" "Noto" ]; }; in mkIf cfg.enable { + + home-manager = lib.mkIf config.custom.graphical.i3.enable { + users.${config.mainUser.name}.stylix.targets.kde.enable = false; + }; stylix = { autoEnable = mkForce true; polarity = "dark"; diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index da7060e..cd691f6 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -67,6 +67,7 @@ obs.enable = true; openrgb.enable = true; plasma.enable = true; + i3.enable = true; #gnome.enable = true; #cosmic.enable = true; shared.enable = true; diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix index 6b8b0ab..e8fefa0 100644 --- a/systems/vm/configuration.nix +++ b/systems/vm/configuration.nix @@ -1,5 +1,6 @@ -{ pkgs, config, ... }: { +{ pkgs, config, lib, ... }: { + imports = [ ./vm-common.nix ]; age.identityPaths = [ /home/kopatz/.ssh/id_rsa ]; mainUser.layout = "de"; mainUser.variant = "us"; @@ -15,25 +16,13 @@ ld.enable = true; settings.enable = true; }; - services = { - #adam-site.enable = true; - kop-fileshare = { - enable = true; - basePath = "/stash"; - }; + graphical = { + i3.enable = true; }; - graphical = { lxqt.enable = true; }; }; + networking.networkmanager.enable = true; + + + environment.systemPackages = with pkgs; [ firefox ]; - environment.systemPackages = [ pkgs.firefox ]; - services.nginx = { - enable = true; - virtualHosts = { - "localhost" = { - forceSSL = false; - enableACME = false; - locations."/stash".proxyPass = "http://127.0.0.1:7777"; - }; - }; - }; } diff --git a/systems/vm/vm-common.nix b/systems/vm/vm-common.nix new file mode 100644 index 0000000..236d003 --- /dev/null +++ b/systems/vm/vm-common.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, ... }: { + services.xserver = { + enable = true; + displayManager = { + autoLogin.enable = true; + autoLogin.user = "vm"; + }; + + resolutions = lib.mkOverride 9 ([ ] ++ [{ + x = 1680; + y = 1050; + }]); + }; + + virtualisation.vmVariant = { + virtualisation = { + memorySize = 8192; + cores = 8; + graphics = true; # Boot the vm in a window. + }; + }; +} diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index 2f49262..149aca3 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -26,6 +26,7 @@ ../../home-manager/rofi.nix #../../home-manager/theme.nix ../../home-manager/zsh.nix + ../../home-manager/i3.nix inputs.nixvim.homeManagerModules.nixvim inputs.nix-colors.homeManagerModule ]; diff --git a/users/vm/default.nix b/users/vm/default.nix index c2ba036..7b14780 100644 --- a/users/vm/default.nix +++ b/users/vm/default.nix @@ -7,12 +7,6 @@ { imports = [ ../default.nix ]; mainUser.name = "vm"; - virtualisation.vmVariant = { - virtualisation = { - memorySize = 8192; - cores = 8; - }; - }; home-manager = { users.${config.mainUser.name} = import ./home.nix; diff --git a/users/vm/home.nix b/users/vm/home.nix index 93302dd..8670598 100644 --- a/users/vm/home.nix +++ b/users/vm/home.nix @@ -1,13 +1,14 @@ -{ config, pkgs, inputs, ...}: -{ - home = { - stateVersion = "23.05"; - }; +{ config, pkgs, inputs, ... }: { + home = { stateVersion = "23.05"; }; imports = [ ../../home-manager/nvim.nix ../../home-manager/zsh.nix + ../../home-manager/rofi.nix + ../../home-manager/kitty.nix + ../../home-manager/i3.nix inputs.nixvim.homeManagerModules.nixvim inputs.nix-colors.homeManagerModule ]; + } diff --git a/yuyukowallpaper.png b/yuyukowallpaper.png new file mode 100644 index 0000000..b2cf633 Binary files /dev/null and b/yuyukowallpaper.png differ