trisquel stuff
This commit is contained in:
6
.bashrc
6
.bashrc
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
export TERM=xterm-256color
|
||||||
|
|
||||||
|
#If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
#Source global definitions
|
#Source global definitions
|
||||||
@@ -134,7 +136,6 @@ alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
|
|||||||
# Translate
|
# Translate
|
||||||
alias tbr='trans :pt-BR'
|
alias tbr='trans :pt-BR'
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# WORK
|
# WORK
|
||||||
#######################################################
|
#######################################################
|
||||||
@@ -185,3 +186,4 @@ PS1="${CYAN}[\u@\h ${YELLOW}\w${GREEN}\$(parse_git_branch)${CYAN}]${WHITE}${RESE
|
|||||||
#######################################################
|
#######################################################
|
||||||
eval $(keychain --eval --quiet ry_ecdsa)
|
eval $(keychain --eval --quiet ry_ecdsa)
|
||||||
eval $(keychain --eval --quiet id_rsa)
|
eval $(keychain --eval --quiet id_rsa)
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
|
|
||||||
(defun opal/org-mode-visual-fill ()
|
(defun opal/org-mode-visual-fill ()
|
||||||
(setq visual-fill-column-width 150
|
(setq visual-fill-column-width 150
|
||||||
visual-fill-column-center-text t)
|
visual-fill-column-center-text t)
|
||||||
(visual-fill-column-mode 1))
|
(visual-fill-column-mode 1))
|
||||||
|
|
||||||
(use-package visual-fill-column
|
(use-package visual-fill-column
|
||||||
@@ -202,13 +202,16 @@
|
|||||||
|
|
||||||
(global-set-key (kbd "C-c y") 'opal/play-yt-url-at-point)
|
(global-set-key (kbd "C-c y") 'opal/play-yt-url-at-point)
|
||||||
|
|
||||||
|
(setq browse-url-browser-function 'browse-url-generic
|
||||||
|
browse-url-generic-program "/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community")
|
||||||
|
|
||||||
;; Elfeed
|
;; Elfeed
|
||||||
(defun opal/elfeed-open-in-firefox ()
|
(defun opal/elfeed-open-in-browser ()
|
||||||
"Open the current Elfeed entry link in Firefox."
|
"Open the current Elfeed entry link in browser (LibreWolf)."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((link (elfeed-entry-link (elfeed-search-selected :single))))
|
(let ((link (elfeed-entry-link (elfeed-search-selected :single))))
|
||||||
(if link
|
(if link
|
||||||
(browse-url-firefox link)
|
(browse-url link)
|
||||||
(message "No link to open."))))
|
(message "No link to open."))))
|
||||||
|
|
||||||
(defun opal/elfeed-open-in-eww()
|
(defun opal/elfeed-open-in-eww()
|
||||||
@@ -248,8 +251,8 @@
|
|||||||
|
|
||||||
;; Evil keybindings for Elfeed
|
;; Evil keybindings for Elfeed
|
||||||
(evil-define-key 'normal elfeed-search-mode-map
|
(evil-define-key 'normal elfeed-search-mode-map
|
||||||
"f" 'opal/elfeed-open-in-firefox ;; Open link in Firefox
|
"f" 'opal/elfeed-open-in-browser ;; Open link in Browser
|
||||||
"e" 'opal/elfeed-open-in-eww ;; Open link in Firefox
|
"e" 'opal/elfeed-open-in-eww ;; Open link in eww
|
||||||
"r" 'opal/elfeed-mark-all-read ;; Marks all feeds as read
|
"r" 'opal/elfeed-mark-all-read ;; Marks all feeds as read
|
||||||
"gr" 'elfeed-update ;; Refresh feeds
|
"gr" 'elfeed-update ;; Refresh feeds
|
||||||
"q" 'quit-window)) ;; Quit Elfeed
|
"q" 'quit-window)) ;; Quit Elfeed
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
[global]
|
[global]
|
||||||
|
geometry = "300x50-10+50"
|
||||||
monitor = 0
|
monitor = 0
|
||||||
follow = keyboard
|
follow = keyboard
|
||||||
indicate_hidden = yes
|
indicate_hidden = yes
|
||||||
@@ -23,7 +24,7 @@ show_indicators = no
|
|||||||
icon_position = off
|
icon_position = off
|
||||||
sticky_history = yes
|
sticky_history = yes
|
||||||
history_length = 20
|
history_length = 20
|
||||||
browser = /usr/bin/icecat -new-tab
|
browser = /usr/bin/abrowser -new-tab
|
||||||
always_run_script = true
|
always_run_script = true
|
||||||
title = Dunst
|
title = Dunst
|
||||||
class = Dunst
|
class = Dunst
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
[Added Associations]
|
[Added Associations]
|
||||||
video/mp4=org.videolan.VLC.desktop;org.kde.dragonplayer.desktop;mpv.desktop;
|
video/mp4=mpv.desktop;
|
||||||
video/quicktime=org.videolan.VLC.desktop;org.kde.dragonplayer.desktop;mpv.desktop;
|
video/quicktime=mpv.desktop;
|
||||||
|
|
||||||
[Default Applications]
|
[Default Applications]
|
||||||
inode/directory=pcmanfm-qt
|
inode/directory=thunar
|
||||||
video/mp4=org.videolan.VLC.desktop;
|
video/mp4=mpv.desktop;
|
||||||
video/quicktime=org.videolan.VLC.desktop
|
video/quicktime=mpv.desktop
|
||||||
|
|
||||||
text/html=/usr/bin/firefox
|
text/html=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
application/xhtml+xml=/usr/bin/firefox
|
application/xhtml+xml=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
application/xml=/usr/bin/firefox
|
application/xml=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
text/xml=/usr/bin/firefox
|
text/xml=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
text/xsl=/usr/bin/firefox
|
text/xsl=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
application/rss+xml=/usr/bin/firefox
|
application/rss+xml=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
application/atom+xml=/usr/bin/firefox
|
application/atom+xml=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/http=/usr/bin/firefox
|
x-scheme-handler/http=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/https=/usr/bin/firefox
|
x-scheme-handler/https=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/ftp=/usr/bin/firefox
|
x-scheme-handler/ftp=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/chrome=/usr/bin/firefox
|
x-scheme-handler/chrome=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/about=/usr/bin/firefox
|
x-scheme-handler/about=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
x-scheme-handler/mailto=/usr/bin/firefox
|
x-scheme-handler/mailto=/var/lib/flatpak/exports/bin/io.gitlab.librewolf-community
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ set $menu rofi -show
|
|||||||
# Start a terminal
|
# Start a terminal
|
||||||
bindsym $mod+Return exec $term
|
bindsym $mod+Return exec $term
|
||||||
|
|
||||||
# Start wofi
|
# Start rofi
|
||||||
bindsym $mod+d exec $menu
|
bindsym $mod+d exec $menu
|
||||||
|
|
||||||
# Kill focused window
|
# Kill focused window
|
||||||
@@ -43,6 +43,9 @@ bindsym $mod+Shift+c reload
|
|||||||
# Exit sway (logs you out of your Wayland session)
|
# Exit sway (logs you out of your Wayland session)
|
||||||
# bindsym $mod+Shift+x exec swaymsg -r exit
|
# bindsym $mod+Shift+x exec swaymsg -r exit
|
||||||
|
|
||||||
|
# Reload the configuration file
|
||||||
|
bindsym $mod+Shift+comma exec /usr/bin/keepassxc
|
||||||
|
|
||||||
## Volume
|
## Volume
|
||||||
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
|
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
|
||||||
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
|
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
|
||||||
@@ -163,53 +166,43 @@ bindsym $mod+Ctrl+g exec grimshot save window
|
|||||||
#bindsym $mod+Shift+e exec wlogout -p layer-shell
|
#bindsym $mod+Shift+e exec wlogout -p layer-shell
|
||||||
|
|
||||||
# Bookmarks
|
# Bookmarks
|
||||||
bindsym $mod+Insert exec wtype $(grep -v '^#' ~/.local/share/bookmarks/bookmarks | bemenu -p Bookmark: -l 50 -c -M 500 --fn 'Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | cut -d ' ' -f1)
|
# bindsym $mod+Insert exec wtype $(grep -v '^#' ~/.local/share/bookmarks/bookmarks | bemenu -p Bookmark: -l 50 -c -M 500 --fn 'Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | cut -d ' ' -f1)
|
||||||
|
|
||||||
bindsym $mod+Shift+Insert exec ~/.local/bin/bookmark_insert
|
# bindsym $mod+Shift+Insert exec ~/.local/bin/bookmark_insert
|
||||||
|
|
||||||
# Emojis
|
# Emojis
|
||||||
bindsym $mod+Shift+e exec wtype $(awk '{print $1, $0}' ~/.local/share/chars/emojis* | bemenu -p Emoji: -l 25 -c -M 500 --fn 'Noto Color Emoji,Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | awk '{print $1}')
|
# bindsym $mod+Shift+e exec wtype $(awk '{print $1, $0}' ~/.local/share/chars/emojis* | bemenu -p Emoji: -l 25 -c -M 500 --fn 'Noto Color Emoji,Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | awk '{print $1}')
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# EXECS
|
# EXECS
|
||||||
#######################
|
#######################
|
||||||
|
|
||||||
set $cursor-theme breeze_cursors
|
set $gnome-schema org.gnome.desktop.interface
|
||||||
set $cursor-size 30 # Adjust to your desired size
|
|
||||||
|
|
||||||
exec_always {
|
# Set GTK/icon theme
|
||||||
export XCURSOR_THEME=$cursor-theme
|
exec {
|
||||||
export XCURSOR_SIZE=$cursor-size
|
gsettings set $gnome-schema gtk-theme 'Arc-Darker'
|
||||||
|
gsettings set $gnome-schema icon-theme 'Papirus'
|
||||||
|
gsettings set $gnome-schema cursor-theme 'breeze_cursors'
|
||||||
|
gsettings set $gnome-schema cursor-size 30
|
||||||
|
gsettings set $schema gtk-application-prefer-dark-theme true
|
||||||
}
|
}
|
||||||
|
|
||||||
# set $gnome-schema org.gnome.desktop.interface
|
|
||||||
|
|
||||||
# # Set GTK/icon theme
|
|
||||||
# exec_always {
|
|
||||||
# gsettings set $gnome-schema gtk-theme 'ArcDarker'
|
|
||||||
# gsettings set $gnome-schema icon-theme 'Papirus'
|
|
||||||
# gsettings set $gnome-schema cursor-theme 'Breeze'
|
|
||||||
# gsettings set $gnome-schema cursor-size 30
|
|
||||||
# }
|
|
||||||
|
|
||||||
# Syncthing
|
# Syncthing
|
||||||
exec /usr/bin/syncthing
|
exec /usr/bin/syncthing &
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
exec_always pgrep -x dunst > /dev/null || dunst
|
exec pgrep -x dunst > /dev/null || dunst
|
||||||
|
|
||||||
# Wlsunset (Night Light)
|
|
||||||
#exec_always pgrep -x wlsunset > /dev/null || wlsunset -l 47.6 -L -122.3 -t 2000 -T 3000
|
|
||||||
|
|
||||||
# Gammastep until wlsunset becomes a thing again:
|
# Gammastep until wlsunset becomes a thing again:
|
||||||
exec_always pgrep -x gammastep > /dev/null || gammastep -l 47.6062:-122.3321 -t 3000:2500
|
exec_always sleep 2 && pgrep -x gammastep > /dev/null || gammastep -l 47.6062:-122.3321 -t 3000:2500
|
||||||
|
|
||||||
# udiskie - auto usb mounting
|
# udiskie - auto usb mounting
|
||||||
exec /usr/bin/udiskie &
|
exec /usr/bin/udiskie &
|
||||||
|
|
||||||
# Network Manager tray applet
|
# Network Manager tray applet
|
||||||
exec_always pgrep -x nm-tray || /usr/bin/nm-tray
|
exec pgrep -x nm-tray || /usr/bin/nm-tray
|
||||||
|
|
||||||
# Bluetooth manager tray applet
|
# Bluetooth manager tray applet
|
||||||
exec /usr/bin/blueman-applet
|
exec /usr/bin/blueman-applet
|
||||||
@@ -221,6 +214,9 @@ exec /usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1
|
|||||||
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
||||||
exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
||||||
|
|
||||||
|
# Weather script (runs every 900 seconds, updates /tmp/weather.txt for swaybar to read from).
|
||||||
|
exec_always sleep 2 && ~/.config/sway/scripts/weather_swaybar.scm &
|
||||||
|
|
||||||
# Idle configuration
|
# Idle configuration
|
||||||
#exec swayidle -w \
|
#exec swayidle -w \
|
||||||
# timeout 3200 'swaymsg "output * dpms off"' \
|
# timeout 3200 'swaymsg "output * dpms off"' \
|
||||||
@@ -246,6 +242,8 @@ set $opacity 0.9
|
|||||||
for_window [class="Emacs"] opacity $opacity
|
for_window [class="Emacs"] opacity $opacity
|
||||||
for_window [app_id="foot"] opacity $opacity
|
for_window [app_id="foot"] opacity $opacity
|
||||||
for_window [app_id="strawberry"] opacity $opacity
|
for_window [app_id="strawberry"] opacity $opacity
|
||||||
|
for_window [class="KeePassXC"] opacity $opacity
|
||||||
|
for_window [class="KeePassXC"] floating enable
|
||||||
#for_window [app_id="org.kde.polkit-kde-authentication-agent-1"] floating enable
|
#for_window [app_id="org.kde.polkit-kde-authentication-agent-1"] floating enable
|
||||||
#for_window [app_id="bemenu"] floating enable
|
#for_window [app_id="bemenu"] floating enable
|
||||||
#for_window [app_id="bemenu"] layer top
|
#for_window [app_id="bemenu"] layer top
|
||||||
@@ -282,7 +280,7 @@ input "1241:1031:USB-HID_Keyboard_Mouse" {
|
|||||||
accel_profile "flat"
|
accel_profile "flat"
|
||||||
}
|
}
|
||||||
|
|
||||||
seat seat0 xcursor_theme Breeze_Light 30
|
seat seat0 xcursor_theme breeze_cursors 30
|
||||||
|
|
||||||
# Hide mouse cursor after inactivity
|
# Hide mouse cursor after inactivity
|
||||||
seat * hide_cursor 10000
|
seat * hide_cursor 10000
|
||||||
|
|||||||
@@ -93,11 +93,17 @@ get_volume() {
|
|||||||
echo -n " $VOLUME"
|
echo -n " $VOLUME"
|
||||||
else
|
else
|
||||||
# Volume is muted, display mute icon
|
# Volume is muted, display mute icon
|
||||||
echo -n " Muted"
|
echo -n " Muted"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_weather() {
|
||||||
|
temp=$(cat /tmp/weather.txt)
|
||||||
|
echo "$temp"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
echo "$(get_volume) $(get_date) $(get_battery)"
|
echo "$(get_weather) $(get_volume) $(get_date) $(get_battery)"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|||||||
91
.config/sway/scripts/weather_swaybar.scm
Executable file
91
.config/sway/scripts/weather_swaybar.scm
Executable file
@@ -0,0 +1,91 @@
|
|||||||
|
#!/usr/bin/env guile-3.0
|
||||||
|
!#
|
||||||
|
|
||||||
|
(use-modules (web client)
|
||||||
|
(json)
|
||||||
|
(rnrs bytevectors)
|
||||||
|
(ice-9 receive)
|
||||||
|
(srfi srfi-18)) ;; For sleep functionality
|
||||||
|
|
||||||
|
(define api-key "99631af2d6db903d1f689c7d2cb13764")
|
||||||
|
(define city-id "5809844")
|
||||||
|
(define units "metric")
|
||||||
|
|
||||||
|
;; Construct the openweathermap URL with API token, city ID, and unit of measurement
|
||||||
|
(define weather-url
|
||||||
|
(format #f "http://api.openweathermap.org/data/2.5/weather?id=~a&units=~a&appid=~a"
|
||||||
|
city-id units api-key))
|
||||||
|
|
||||||
|
;; Define weather icons as an association list
|
||||||
|
(define weather-icons
|
||||||
|
'(("clear sky" . "☀️")
|
||||||
|
("few clouds" . "🌤️")
|
||||||
|
("scattered clouds" . "🌥️")
|
||||||
|
("broken clouds" . "☁️")
|
||||||
|
("overcast clouds" . "☁️")
|
||||||
|
("shower rain" . "🌦️")
|
||||||
|
("light rain" . "🌧️")
|
||||||
|
("light intensity drizzle" . "🌧️")
|
||||||
|
("rain" . "🌧️")
|
||||||
|
("moderate rain" . "🌧️")
|
||||||
|
("thunderstorm" . "⛈️")
|
||||||
|
("snow" . "❄️")
|
||||||
|
("mist" . "🌫️")
|
||||||
|
("haze" . "🌫️")
|
||||||
|
("smoke" . "🌫️")
|
||||||
|
("fog" . "🌫️")))
|
||||||
|
|
||||||
|
;; Convert Celsius to Fahrenheit
|
||||||
|
(define (celsius-to-fahrenheit celsius)
|
||||||
|
(+ (* celsius (/ 9 5)) 32))
|
||||||
|
|
||||||
|
;; Get weather icon based on description
|
||||||
|
(define (get-weather-icon description)
|
||||||
|
(or (assoc-ref weather-icons description) "❓"))
|
||||||
|
|
||||||
|
;; Parse and extract weather data from JSON
|
||||||
|
(define (extract-weather-data json-data)
|
||||||
|
(let* ((main (assoc "main" json-data))
|
||||||
|
(temp-c (and main
|
||||||
|
(cdr (assoc "temp" (cdr main)))))
|
||||||
|
;; Round and convert to exact integer
|
||||||
|
(temp-c-value (and temp-c
|
||||||
|
(inexact->exact
|
||||||
|
(round temp-c))))
|
||||||
|
(weather-description
|
||||||
|
(cdr (assoc "description"
|
||||||
|
(vector-ref (cdr (assoc "weather" json-data)) 0)))))
|
||||||
|
;; Return temperature (C, F), description, and icon
|
||||||
|
(values temp-c-value
|
||||||
|
(and temp-c-value
|
||||||
|
(inexact->exact
|
||||||
|
(round (celsius-to-fahrenheit temp-c-value))))
|
||||||
|
weather-description
|
||||||
|
(get-weather-icon weather-description))))
|
||||||
|
|
||||||
|
;; Fetch and display weather data to a file
|
||||||
|
(define (get-weather)
|
||||||
|
;; Request and parse the data
|
||||||
|
(receive (response-status response-body)
|
||||||
|
(http-request weather-url)
|
||||||
|
(let ((json-data (json-string->scm
|
||||||
|
(utf8->string response-body))))
|
||||||
|
(call-with-values
|
||||||
|
(lambda () (extract-weather-data json-data))
|
||||||
|
(lambda (temp-c temp-f description icon)
|
||||||
|
;; Open file for writing
|
||||||
|
(call-with-output-file "/tmp/weather.txt"
|
||||||
|
(lambda (port)
|
||||||
|
;; Write the weather information to the file
|
||||||
|
(if temp-c
|
||||||
|
(format port "~a ~d°C / ~d°F~%" icon temp-c temp-f)
|
||||||
|
(format port "Error: Temperature data not available.\n")))))))))
|
||||||
|
|
||||||
|
;; Run the script indefinitely, fetching weather every 900 seconds (15 minutes)
|
||||||
|
(define (run-indefinitely)
|
||||||
|
(let loop ()
|
||||||
|
(get-weather)
|
||||||
|
(sleep 900) ;; Sleep for 900 seconds (15 minutes)
|
||||||
|
(loop)))
|
||||||
|
|
||||||
|
(run-indefinitely)
|
||||||
Reference in New Issue
Block a user