Skip to content

vitorpy/GNewsWire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GNewsWire

A native Linux RSS/Atom feed reader built with Swift and GTK4/libadwaita, inspired by NetNewsWire.

Swift GTK libadwaita

Features

  • πŸ“° RSS/Atom Support: Full RSS 2.0 and Atom 1.0 feed parsing
  • 🎨 Native GNOME UI: Built with GTK4 and libadwaita for seamless desktop integration
  • πŸ“š Smart Folders: Built-in All, Unread, and Starred article collections
  • πŸ” Three-Column Layout: Familiar feed reader interface with feeds, articles, and reader panes
  • πŸ’Ύ SQLite Database: Persistent storage for feeds and articles
  • 🌐 Async Networking: Modern Swift concurrency with AsyncHTTPClient
  • 🎯 Swift 6: Built with the latest Swift language features

Architecture

GNewsWire/
β”œβ”€β”€ Sources/
β”‚   └── GNewsWire/
β”‚       β”œβ”€β”€ Models/          # Feed, Article, Author data models
β”‚       β”œβ”€β”€ Views/           # Adwaita UI views
β”‚       β”œβ”€β”€ Services/        # Feed parsing and fetching
β”‚       └── GNewsWireApp.swift
β”œβ”€β”€ Package.swift            # Swift package manifest
└── run.sh                  # Build and run script

Dependencies

  • Adwaita for Swift: SwiftUI-like declarative UI framework for GNOME
  • SQLite.swift: Type-safe SQLite database layer
  • AsyncHTTPClient: Modern async HTTP networking
  • XMLCoder: XML parsing for RSS/Atom feeds

Building

Prerequisites

# Install GTK4 and libadwaita development packages
sudo apt install libgtk-4-dev libadwaita-1-dev  # Debian/Ubuntu
sudo dnf install gtk4-devel libadwaita-devel     # Fedora
sudo pacman -S gtk4 libadwaita                   # Arch

# Swift 6.0+ is required
# Visit https://swift.org/install for installation instructions

Build & Run

# Clone the repository
git clone https://github.com/yourusername/GNewsWire.git
cd GNewsWire

# Build
swift build

# Run
./run.sh
# or
.build/debug/GNewsWire

Usage

  1. Launch: Run the app to see the three-column interface
  2. Smart Folders: Browse built-in collections:
    • πŸ“š All Articles: View all available articles
    • πŸ“¨ Unread: Filter to unread articles only
    • ⭐ Starred: View your starred/favorited articles
  3. Adding Feeds: Click the + menu in the toolbar:
    • Select "Add Hacker News" for tech news
    • Select "Add BBC News" for world news
  4. Reading: Click any article to read it in the right pane
  5. Article Actions: Use buttons in the reader to:
    • Mark as Read/Unread
    • Star/Unstar articles
    • Open in browser

Technical Implementation

Swift 6 on Linux

This project showcases modern Swift development for Linux desktop:

  • Full Swift 6.0 language features and concurrency
  • Native Linux implementations (no Foundation/AppKit dependencies)
  • GTK4/libadwaita integration through Swift bindings

Adwaita for Swift

Using declarative UI patterns similar to SwiftUI:

NavigationSplitView(sidebar: {
    FeedListView(feeds: $feeds, selectedFeed: $selectedFeed)
}) {
    ArticleListView(articles: $articles, selectedArticle: $selectedArticle)
}

Database Design

SQLite.swift with namespace-aware types to handle Swift 6 changes:

// Avoid Foundation.Expression conflict with explicit namespace
private let feedIdCol = SQLite.Expression<Int64>("id")
private let feedTitle = SQLite.Expression<String>("title")

Feed Parsing

Comprehensive RSS/Atom parsing with XMLCoder:

  • RSS 2.0 with enclosures and categories
  • Atom 1.0 with multiple link relations
  • Automatic feed type detection
  • Multiple date format support (RFC822, ISO8601)

Project Status

βœ… Implemented

  • Complete three-column UI layout
  • RSS/Atom feed parser with full spec support
  • SQLite database with feeds and articles tables
  • Smart folders (All, Unread, Starred)
  • Feed selection and article viewing
  • Sample article data for testing
  • Article read/unread status
  • Star/favorite functionality
  • Basic feed management menu

🚧 Roadmap

  • Live feed fetching with progress indicators
  • OPML import/export
  • Feed categories and folders
  • Full-text search
  • Keyboard shortcuts (j/k navigation)
  • WebKit article rendering
  • Feed edit/delete functionality
  • Sync service integration
  • System notifications
  • Offline reading mode

Development

Code Style

The project follows Swift API Design Guidelines with Linux-specific adaptations:

  • Declarative UI with Adwaita's SwiftUI-like syntax
  • Protocol-oriented design for services
  • Async/await for network operations
  • Value types for models

Testing

swift test

Contributing

Contributions are welcome! Areas needing help:

  • Feed fetching robustness
  • UI polish and animations
  • Keyboard navigation
  • Performance optimization
  • Documentation

Comparison with NetNewsWire

Feature NetNewsWire GNewsWire
Platform macOS/iOS Linux/GNOME
UI Framework SwiftUI/AppKit GTK4/libadwaita
Database Core Data SQLite
Sync iCloud/Feedbin Planned
Feed Formats RSS/Atom/JSON RSS/Atom
Swift Version 5.x 6.0

License

GNU General Public License v3.0 - See LICENSE file for details

This ensures GNewsWire remains free software for the community.

Acknowledgments

Screenshots

The app features a clean GNOME-native interface:

  • Left sidebar: Feed list with unread counts and icons
  • Center: Article list with read/unread indicators
  • Right: Article reader with action buttons

(Live screenshots coming soon - run the app to see it in action!)


Note: This is a proof-of-concept demonstrating Swift's viability for Linux desktop development. While functional, it's not yet ready for daily use. Contributions and feedback are highly encouraged!

About

Native Linux RSS/Atom feed reader built with Swift and GTK4/libadwaita

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors