Skip to content

Commit

Permalink
Extend blacklist: social, news, games
Browse files Browse the repository at this point in the history
  • Loading branch information
plutov committed Jul 23, 2024
1 parent ba1f581 commit d2baa5b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,40 @@ sudo ultrafocus

## Default blacklist

- facebook.com
- instagram.com
- tiktok.com
- twitter.com
- youtube.com
- netflix.com
- reddit.com
### Social Media
* facebook.com
* instagram.com
* twitter.com
* tiktok.com
* snapchat.com
* pinterest.com
* linkedin.com
* reddit.com
* imgur.com
* youtube.com
* whatsapp.com
* telegram.org
* discord.com

### News
* bbc.com
* cnn.com
* aljazeera.com
* theguardian.com
* nytimes.com
* google.com/news
* apple.news

### Games
* steampowered.com
* origin.com
* epicgames.com
* battle.net
* playstation.com
* xbox.com
* miniclip.com
* armorgames.com
* kongregate.com

## Run tests

Expand Down
8 changes: 2 additions & 6 deletions cli/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ func NewModel() model {

state := menuView
ti := textarea.New()
ti.Blur()
if len(domains) == 0 {
state = blacklistView
ti.SetValue(strings.Join(hosts.DefaultDomains, "\n"))
ti.Focus()
ti.CursorEnd()
} else {
ti.Blur()
domains = hosts.DefaultDomains
}

return model{
Expand Down
12 changes: 12 additions & 0 deletions hosts/domains.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hosts

var DefaultDomains = []string{
// Social media
"facebook.com", "instagram.com", "twitter.com", "tiktok.com", "snapchat.com", "pinterest.com", "linkedin.com", "reddit.com", "imgur.com", "youtube.com", "whatsapp.com", "telegram.org", "discord.com",

// News
"bbc.com", "cnn.com", "aljazeera.com", "theguardian.com", "nytimes.com", "google.com/news", "apple.news",

// Games
"steampowered.com", "origin.com", "epicgames.com", "battle.net", "playstation.com", "xbox.com", "miniclip.com", "armorgames.com", "kongregate.com",
}
2 changes: 0 additions & 2 deletions hosts/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const (
CommentStatusOff = "#ultrafocus:off"
)

var DefaultDomains = []string{"facebook.com", "instagram.com", "tiktok.com", "twitter.com", "youtube.com", "netflix.com", "reddit.com"}

func ExtractDomainsFromHostsFile() ([]string, FocusStatus, error) {
domains := []string{}
status := FocusStatusOff
Expand Down

0 comments on commit d2baa5b

Please sign in to comment.