Steam detection added, bound to s in rp mode.
This commit is contained in:
@@ -1052,6 +1052,10 @@ fi)
|
|||||||
bindsym \$mod+e exec $emailClient, mode "default"
|
bindsym \$mod+e exec $emailClient, mode "default"
|
||||||
# Web browser bound to w
|
# Web browser bound to w
|
||||||
bindsym w exec $webBrowser, mode "default"
|
bindsym w exec $webBrowser, mode "default"
|
||||||
|
$(if command -v steam &> /dev/null ; then
|
||||||
|
echo "# Steam bound to s"
|
||||||
|
echo "bindsym s exec --no-startup-id command steam -bigpicture, mode \"default\""
|
||||||
|
fi)
|
||||||
# Kill window bound to k
|
# Kill window bound to k
|
||||||
bindsym k kill, mode "default"
|
bindsym k kill, mode "default"
|
||||||
$(if command -v mumble &> /dev/null ; then
|
$(if command -v mumble &> /dev/null ; then
|
||||||
|
|||||||
@@ -1,4 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
AI Assistant Interface
|
AI Assistant Interface
|
||||||
Provides accessibility-focused AI interaction with multiple providers
|
Provides accessibility-focused AI interaction with multiple providers
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Find out if we're using i3 or sway
|
# Find out if we're using i3 or sway
|
||||||
if ! [[ -n "${WAYLAND_DISPLAY}" ]]; then
|
if ! [[ -n "${WAYLAND_DISPLAY}" ]]; then
|
||||||
cmd="i3-msg"
|
cmd="i3-msg"
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# I38 i3 Watchdog - Monitors i3 responsiveness and auto-restarts on lockup
|
# I38 i3 Watchdog - Monitors i3 responsiveness and auto-restarts on lockup
|
||||||
# This script runs in the background and checks if i3 is responding to commands
|
# This script runs in the background and checks if i3 is responding to commands
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk, GLib, Gio, Gdk
|
from gi.repository import Gtk, GLib, Gio, Gdk
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Initialize variables
|
# Initialize variables
|
||||||
cpuUsage=0
|
cpuUsage=0
|
||||||
|
|||||||
+58
-33
@@ -1,5 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This file is part of I38.
|
||||||
|
|
||||||
|
# I38 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.
|
||||||
|
|
||||||
|
# I38 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 I38. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Configuration settings
|
# Configuration settings
|
||||||
defaultCity="Raleigh, NC"
|
defaultCity="Raleigh, NC"
|
||||||
@@ -67,18 +76,17 @@ refreshBtn=0
|
|||||||
quitBtn=1
|
quitBtn=1
|
||||||
settingsBtn=2
|
settingsBtn=2
|
||||||
|
|
||||||
trap "pkill -P $$" EXIT INT TERM
|
trap 'pkill -P $$' EXIT INT TERM
|
||||||
|
|
||||||
# Load configuration if available
|
# Load configuration if available
|
||||||
if [ -f "$configFile" ]; then
|
if [ -f "$configFile" ]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
source "$configFile"
|
source "$configFile"
|
||||||
# Convert lastWeatherUpdate string to integer if it exists
|
# Convert lastWeatherUpdate string to integer if it exists
|
||||||
[[ -n "$lastWeatherUpdate" ]] && weatherLastUpdate=$lastWeatherUpdate || weatherLastUpdate=0
|
[[ -n "$lastWeatherUpdate" ]] && weatherLastUpdate=$lastWeatherUpdate || weatherLastUpdate=0
|
||||||
|
|
||||||
if [[ -n "$city" ]]; then
|
if [[ -n "$city" ]]; then
|
||||||
cityName="$city"
|
cityName="$city"
|
||||||
latitude="$latitude"
|
|
||||||
longitude="$longitude"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to reload saved weather data
|
# Try to reload saved weather data
|
||||||
@@ -94,10 +102,10 @@ if [ -f "$configFile" ]; then
|
|||||||
varMax="savedForecastMax_$i"
|
varMax="savedForecastMax_$i"
|
||||||
varCond="savedForecastCond_$i"
|
varCond="savedForecastCond_$i"
|
||||||
|
|
||||||
[[ -n "${!varDate}" ]] && forecastFormattedDates[$i]="${!varDate}"
|
[[ -n "${!varDate}" ]] && forecastFormattedDates[i]="${!varDate}"
|
||||||
[[ -n "${!varMin}" ]] && forecastMinTemps[$i]="${!varMin}"
|
[[ -n "${!varMin}" ]] && forecastMinTemps[i]="${!varMin}"
|
||||||
[[ -n "${!varMax}" ]] && forecastMaxTemps[$i]="${!varMax}"
|
[[ -n "${!varMax}" ]] && forecastMaxTemps[i]="${!varMax}"
|
||||||
[[ -n "${!varCond}" ]] && forecastConditions[$i]="${!varCond}"
|
[[ -n "${!varCond}" ]] && forecastConditions[i]="${!varCond}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -105,8 +113,10 @@ fi
|
|||||||
# Helper functions
|
# Helper functions
|
||||||
time_diff() {
|
time_diff() {
|
||||||
local timestamp="$1"
|
local timestamp="$1"
|
||||||
local now=$(date +%s)
|
local now
|
||||||
local diff=$((now - timestamp))
|
local diff
|
||||||
|
now=$(date +%s)
|
||||||
|
diff=$((now - timestamp))
|
||||||
|
|
||||||
if [ $diff -lt 60 ]; then
|
if [ $diff -lt 60 ]; then
|
||||||
echo "just now"
|
echo "just now"
|
||||||
@@ -216,12 +226,14 @@ get_location() {
|
|||||||
if [[ $? -eq 0 && -n "$locationData" && $(echo "$locationData" | jq -e '.city') ]]; then
|
if [[ $? -eq 0 && -n "$locationData" && $(echo "$locationData" | jq -e '.city') ]]; then
|
||||||
echo "Location data received successfully"
|
echo "Location data received successfully"
|
||||||
cityName=$(echo "$locationData" | jq -r '.city // "Unknown"')
|
cityName=$(echo "$locationData" | jq -r '.city // "Unknown"')
|
||||||
local region=$(echo "$locationData" | jq -r '.region // ""')
|
local region
|
||||||
|
region=$(echo "$locationData" | jq -r '.region // ""')
|
||||||
# Add region/state to city name if available
|
# Add region/state to city name if available
|
||||||
[[ -n "$region" ]] && cityName="$cityName, $region"
|
[[ -n "$region" ]] && cityName="$cityName, $region"
|
||||||
|
|
||||||
# Extract coordinates directly from the "loc" field
|
# Extract coordinates directly from the "loc" field
|
||||||
local loc=$(echo "$locationData" | jq -r '.loc // "0,0"')
|
local loc
|
||||||
|
loc=$(echo "$locationData" | jq -r '.loc // "0,0"')
|
||||||
latitude=$(echo "$loc" | cut -d',' -f1)
|
latitude=$(echo "$loc" | cut -d',' -f1)
|
||||||
longitude=$(echo "$loc" | cut -d',' -f2)
|
longitude=$(echo "$loc" | cut -d',' -f2)
|
||||||
save_config
|
save_config
|
||||||
@@ -236,17 +248,21 @@ get_location() {
|
|||||||
|
|
||||||
# Function to fetch weather data
|
# Function to fetch weather data
|
||||||
fetch_weather_data() {
|
fetch_weather_data() {
|
||||||
local now=$(date +%s)
|
local now
|
||||||
local elapsedMinutes=$(( (now - weatherLastUpdate) / 60 ))
|
local elapsedMinutes
|
||||||
|
now=$(date +%s)
|
||||||
|
elapsedMinutes=$(( (now - weatherLastUpdate) / 60 ))
|
||||||
|
|
||||||
# Only fetch if needed
|
# Only fetch if needed
|
||||||
if [[ $weatherLastUpdate -eq 0 || $elapsedMinutes -ge $updateInterval ]]; then
|
if [[ $weatherLastUpdate -eq 0 || $elapsedMinutes -ge $updateInterval ]]; then
|
||||||
local url="https://api.open-meteo.com/v1/forecast?latitude=$latitude&longitude=$longitude¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=auto"
|
local url="https://api.open-meteo.com/v1/forecast?latitude=$latitude&longitude=$longitude¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=auto"
|
||||||
local response=$(curl -s --connect-timeout 10 "$url" 2>/dev/null)
|
local response
|
||||||
|
response=$(curl -s --connect-timeout 10 "$url" 2>/dev/null)
|
||||||
|
|
||||||
if [[ $? -eq 0 && -n "$response" && $(echo "$response" | jq -e '.current' 2>/dev/null) ]]; then
|
if [[ $? -eq 0 && -n "$response" && $(echo "$response" | jq -e '.current' 2>/dev/null) ]]; then
|
||||||
# Update current weather data
|
# Update current weather data
|
||||||
local tempCelsius=$(echo "$response" | jq -r '.current.temperature_2m // "--"' 2>/dev/null)
|
local tempCelsius
|
||||||
|
tempCelsius=$(echo "$response" | jq -r '.current.temperature_2m // "--"' 2>/dev/null)
|
||||||
[[ "$tempCelsius" != "--" && "$tempCelsius" != "null" ]] && currentTemp=$(celsius_to_fahrenheit "$tempCelsius") || currentTemp="--"
|
[[ "$tempCelsius" != "--" && "$tempCelsius" != "null" ]] && currentTemp=$(celsius_to_fahrenheit "$tempCelsius") || currentTemp="--"
|
||||||
|
|
||||||
currentHumidity=$(echo "$response" | jq -r '.current.relative_humidity_2m // "--"' 2>/dev/null)
|
currentHumidity=$(echo "$response" | jq -r '.current.relative_humidity_2m // "--"' 2>/dev/null)
|
||||||
@@ -260,7 +276,8 @@ fetch_weather_data() {
|
|||||||
currentWindSpeedMph="--"
|
currentWindSpeedMph="--"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local weatherCode=$(echo "$response" | jq -r '.current.weather_code // 0' 2>/dev/null)
|
local weatherCode
|
||||||
|
weatherCode=$(echo "$response" | jq -r '.current.weather_code // 0' 2>/dev/null)
|
||||||
[[ "$weatherCode" == "null" ]] && weatherCode=0
|
[[ "$weatherCode" == "null" ]] && weatherCode=0
|
||||||
currentConditions="${weatherCodes[$weatherCode]:-Unknown}"
|
currentConditions="${weatherCodes[$weatherCode]:-Unknown}"
|
||||||
|
|
||||||
@@ -279,21 +296,24 @@ fetch_weather_data() {
|
|||||||
if [[ $(echo "$response" | jq -e '.daily' 2>/dev/null) ]]; then
|
if [[ $(echo "$response" | jq -e '.daily' 2>/dev/null) ]]; then
|
||||||
for i in {0..2}; do
|
for i in {0..2}; do
|
||||||
# Process forecast data
|
# Process forecast data
|
||||||
forecastDates[$i]=$(echo "$response" | jq -r ".daily.time[$i] // \"--\"" 2>/dev/null)
|
forecastDates[i]=$(echo "$response" | jq -r ".daily.time[$i] // \"--\"" 2>/dev/null)
|
||||||
[[ "${forecastDates[$i]}" != "--" && "${forecastDates[$i]}" != "null" ]] && \
|
[[ "${forecastDates[i]}" != "--" && "${forecastDates[i]}" != "null" ]] && \
|
||||||
forecastFormattedDates[$i]=$(format_date "${forecastDates[$i]}") || forecastFormattedDates[$i]="--"
|
forecastFormattedDates[i]=$(format_date "${forecastDates[i]}") || forecastFormattedDates[i]="--"
|
||||||
|
|
||||||
local minTempC=$(echo "$response" | jq -r ".daily.temperature_2m_min[$i] // \"--\"" 2>/dev/null)
|
local minTempC
|
||||||
|
minTempC=$(echo "$response" | jq -r ".daily.temperature_2m_min[$i] // \"--\"" 2>/dev/null)
|
||||||
[[ "$minTempC" != "--" && "$minTempC" != "null" ]] && \
|
[[ "$minTempC" != "--" && "$minTempC" != "null" ]] && \
|
||||||
forecastMinTemps[$i]=$(celsius_to_fahrenheit "$minTempC") || forecastMinTemps[$i]="--"
|
forecastMinTemps[i]=$(celsius_to_fahrenheit "$minTempC") || forecastMinTemps[i]="--"
|
||||||
|
|
||||||
local maxTempC=$(echo "$response" | jq -r ".daily.temperature_2m_max[$i] // \"--\"" 2>/dev/null)
|
local maxTempC
|
||||||
|
maxTempC=$(echo "$response" | jq -r ".daily.temperature_2m_max[$i] // \"--\"" 2>/dev/null)
|
||||||
[[ "$maxTempC" != "--" && "$maxTempC" != "null" ]] && \
|
[[ "$maxTempC" != "--" && "$maxTempC" != "null" ]] && \
|
||||||
forecastMaxTemps[$i]=$(celsius_to_fahrenheit "$maxTempC") || forecastMaxTemps[$i]="--"
|
forecastMaxTemps[i]=$(celsius_to_fahrenheit "$maxTempC") || forecastMaxTemps[i]="--"
|
||||||
|
|
||||||
local code=$(echo "$response" | jq -r ".daily.weather_code[$i] // 0" 2>/dev/null)
|
local code
|
||||||
|
code=$(echo "$response" | jq -r ".daily.weather_code[$i] // 0" 2>/dev/null)
|
||||||
[[ "$code" == "null" ]] && code=0
|
[[ "$code" == "null" ]] && code=0
|
||||||
forecastConditions[$i]="${weatherCodes[$code]:-Unknown}"
|
forecastConditions[i]="${weatherCodes[$code]:-Unknown}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -315,7 +335,8 @@ change_location() {
|
|||||||
|
|
||||||
if [[ -n "$newLocation" && "$newLocation" != "$cityName" ]]; then
|
if [[ -n "$newLocation" && "$newLocation" != "$cityName" ]]; then
|
||||||
# Try to parse the location using curl to a geocoding service
|
# Try to parse the location using curl to a geocoding service
|
||||||
local result=$(curl -s --connect-timeout 10 "https://nominatim.openstreetmap.org/search?q=$newLocation&format=json" 2>/dev/null)
|
local result
|
||||||
|
result=$(curl -s --connect-timeout 10 "https://nominatim.openstreetmap.org/search?q=$newLocation&format=json" 2>/dev/null)
|
||||||
|
|
||||||
if [[ -n "$result" && $(echo "$result" | jq -e '.[0]') ]]; then
|
if [[ -n "$result" && $(echo "$result" | jq -e '.[0]') ]]; then
|
||||||
cityName="$newLocation"
|
cityName="$newLocation"
|
||||||
@@ -382,7 +403,8 @@ End of text. Press Control+Home to return to the beginning."
|
|||||||
|
|
||||||
# Function to display settings dialog
|
# Function to display settings dialog
|
||||||
display_settings() {
|
display_settings() {
|
||||||
local ret=$(yad --pname=I38WeatherSettings \
|
local ret
|
||||||
|
ret=$(yad --pname=I38WeatherSettings \
|
||||||
--title="I38 Weather Settings" \
|
--title="I38 Weather Settings" \
|
||||||
--form \
|
--form \
|
||||||
--width=400 \
|
--width=400 \
|
||||||
@@ -397,9 +419,12 @@ display_settings() {
|
|||||||
local saveResult=$?
|
local saveResult=$?
|
||||||
|
|
||||||
if [[ $saveResult -eq 0 && -n "$ret" ]]; then
|
if [[ $saveResult -eq 0 && -n "$ret" ]]; then
|
||||||
local newLocation=$(echo "$ret" | cut -d"|" -f1)
|
local newLocation
|
||||||
local newUnit=$(echo "$ret" | cut -d"|" -f3)
|
local newUnit
|
||||||
local newInterval=$(echo "$ret" | cut -d"|" -f4)
|
local newInterval
|
||||||
|
newLocation=$(echo "$ret" | cut -d"|" -f1)
|
||||||
|
newUnit=$(echo "$ret" | cut -d"|" -f3)
|
||||||
|
newInterval=$(echo "$ret" | cut -d"|" -f4)
|
||||||
|
|
||||||
# Apply any changes
|
# Apply any changes
|
||||||
[[ -n "$newLocation" && "$newLocation" != "$cityName" ]] && change_location "$newLocation"
|
[[ -n "$newLocation" && "$newLocation" != "$cityName" ]] && change_location "$newLocation"
|
||||||
@@ -419,17 +444,17 @@ while : ; do
|
|||||||
|
|
||||||
# Handle button actions
|
# Handle button actions
|
||||||
case $ret in
|
case $ret in
|
||||||
$refreshBtn)
|
"$refreshBtn")
|
||||||
# Force a weather update
|
# Force a weather update
|
||||||
weatherLastUpdate=0
|
weatherLastUpdate=0
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
$settingsBtn)
|
"$settingsBtn")
|
||||||
# Display settings dialog
|
# Display settings dialog
|
||||||
display_settings
|
display_settings
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
$quitBtn|252)
|
"$quitBtn"|252)
|
||||||
# Quit button or window closed
|
# Quit button or window closed
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user